[issue17377] JSON module in standard library behaves incorrectly on input like a psutil constant

2013-03-07 Thread R. David Murray
R. David Murray added the comment: Right, the appropriate thing to do there is to write a custom encoder/decoder to handle those objects. json only automatically handles types that work like the fundamental types, and this is a good thing, security-wise :) -- nosy: +r.david.murray res

[issue17377] JSON module in standard library behaves incorrectly on input like a psutil constant

2013-03-07 Thread Sven Slootweg
New submission from Sven Slootweg: When faced with a subclass of int like a psutil constant (such as for process status), that actually returns a non-numeric string when used with str(), the JSON module will serialize it as a string without quotes. An example... Code (Python): [...] "key": ps