[issue10038] json.loads() on str should return unicode, not str

Nik Tautenhahn report at bugs.python.org
Tue Nov 2 16:33:07 CET 2010


Nik Tautenhahn <nik at livinglogic.de> added the comment:

There is even more inconsistency here.

As already mentioned, we have this:


>>> import json
>>> json.loads(json.dumps("abc"))

'abc'

If, however, I am evil and hide _json.so (which is the C-part of the json module for speedup), the JSON code falls back to its python implementation and voila:

>>> import json
>>> json.loads(json.dumps("abc"))

u'abc'

Not so neat, if your fallback is not a fallback but shows such different behaviour.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue10038>
_______________________________________


More information about the Python-bugs-list mailing list