Fall back to __str__ when encoding package metadata as JSON
Fall back to __str__ when encoding package metadata as JSON

This is a fix for finicky packages like unittest2 that pass
non-string parameters for version into setup(). If the JSON module
doesn't know explicitly about the type, it will raise a TypeError.
In this case, we check if the object's class has a __str__ method
defined, and if so, just encode the object as a string.

doghrim/fpm,schatt/fpm,wyaeld/fpm,hlawrenz/fpm,linearregression/fpm,rbramwell/fpm,joseph-onsip/fpm,gearmover/fpm,jerizm/fpm,snailwalker/fpm,schatt/fpm,dischord01/fpm,gearmover/fpm,pskrz/fpm,schatt/fpm,jerizm/fpm,snailwalker/fpm,pskrz/fpm,wyaeld/fpm,cturra/fpm,mildred/fpm,mzaccari/fpm,linearregression/fpm,vi4m/fpm,joseph-onsip/fpm,paul-krohn/fpm,hlawrenz/fpm,josephfrazier/fpm,hlawrenz/fpm,wyaeld/fpm,doghrim/fpm,snailwalker/fpm,tjyang/fpm,josephfrazier/fpm,rbramwell/fpm,mildred/fpm,mzaccari/fpm,jerizm/fpm,mildred/fpm,paul-krohn/fpm,elvido/fpm,dischord01/fpm,pskrz/fpm,tjyang/fpm,tjyang/fpm,godp1301/fpm,paul-krohn/fpm,joseph-onsip/fpm,doghrim/fpm,linearregression/fpm,godp1301/fpm,vi4m/fpm,dischord01/fpm,tjyang/fpm,elvido/fpm,jerizm/fpm,rbramwell/fpm,godp1301/fpm,joseph-onsip/fpm,josephfrazier/fpm,cturra/fpm,elvido/fpm,mzaccari/fpm,vi4m/fpm,schatt/fpm,wyaeld/fpm,mzaccari/fpm,dischord01/fpm,hlawrenz/fpm,paul-krohn/fpm,cturra/fpm,gearmover/fpm,cturra/fpm,doghrim/fpm,mildred/fpm,linearregression/fpm,gearmover/fpm,vi4m/fpm,godp1301/fpm,elvido/fpm,pskrz/fpm,rbramwell/fpm,snailwalker/fpm,josephfrazier/fpm