[docs] [issue13769] json.dump(ensure_ascii=False) return str instead of unicode

Terry J. Reedy report at bugs.python.org
Thu Oct 23 19:20:09 CEST 2014

Terry J. Reedy added the comment:

The revised doc admits the problem: "If *ensure_ascii* is False, some chunks written to *fp* may be unicode instances.  Unless fp.write() explicitly understands unicode (as in codecs.getwriter) this is likely to cause an error."

Making text be unicode in 3.x is our attempt at a generic fix to the problems resulting from the bug-prone 2.x 'text may be bytes or unicode' design.  Since continued 2.7 support is aimed at supporting legacy code, we are very reluctant to make behavior changes that could break working code.


Python tracker <report at bugs.python.org>

More information about the docs mailing list