[issue22701] Write unescaped unicode characters (Japanese, Chinese, etc) in JSON module when "ensure_ascii=False"

Michael Kuss report at bugs.python.org
Sat Nov 1 01:50:19 CET 2014


Michael Kuss added the comment:

Pardon the delay - this json dump function is embedded in a much larger script, so it took some untangling to get it running on Python 3.3, and scrub some personal identifying info from it. This script also does not work in Python 3.3:


  File "C:/Users/mkuss/PycharmProjects/TestJSON\dump_list_to_json_file.py", line 319, in dump_list_to_json_file
    json.dump(addresses, outfile, indent=4, separators=(',', ': '))
  File "C:\Python33\lib\json\__init__.py", line 184, in dump
    fp.write(chunk)
TypeError: 'str' does not support the buffer interface



In python 2.7, I still get escaped unicode when I try writing this dictionary using json.dump, so the work-around that I pasted originally is how I'm choosing to accomplish the task for now.

I'd you'd like, I can spend more time debugging this issue I'm running into running the script in python 3.3, but it maybe be til next week when I have sufficient time to solve. THANKS  --mike

----------
status: pending -> open

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


More information about the Python-bugs-list mailing list