Message305980
Given this traceback:
File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/encoder.py", line 184, in default
raise TypeError(repr(o) + " is not JSON serializable")
TypeError: 7.0374198 is not JSON serializable
It would actually be better to have the error reported as type(o)+ " is not JSON serializable." because at first glance, 7.0374198 *is* serializable. In this specific case, the issue can be fixed by attempting to serialize float(o), because it is a ndarray. Maybe there's a better way to do numpy types or some kind of automatic conversion but for now, this is only a request to alter the message, I'd hope to something like:
repr(o) + " of type " + type(o) + " is not JSON serializable"
It's it's really more about the type rather than the value being serialized. |
|
Date |
User |
Action |
Args |
2017-11-09 19:05:23 | Jason Hihn | set | recipients:
+ Jason Hihn |
2017-11-09 19:05:23 | Jason Hihn | set | messageid: <1510254323.87.0.213398074469.issue31994@psf.upfronthosting.co.za> |
2017-11-09 19:05:23 | Jason Hihn | link | issue31994 messages |
2017-11-09 19:05:23 | Jason Hihn | create | |
|