[issue22767] `separators` argument to json.dumps() behaves unexpectedly across 2.x vs 3.x

Tom Christie report at bugs.python.org
Thu Oct 30 20:12:29 CET 2014


Tom Christie added the comment:

Not too fussed if this is addressed or not, but I think this is closed a little prematurely.

I don't think there's a problem under Python 3, that's entirely reasonable.

However under Python 2, `json.dumps()` will normally handle *either* bytes or unicode transparently for you (just altering the return type accordingly).

If you happen to be using unicode separators, then the normally lax behaviour of "either unicode or bytes" that stops being the case.

----------

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


More information about the Python-bugs-list mailing list