Martin Panter added the comment:

By default, open("test.json") will open the file in text mode, decoding from 
the encoding determined by your environment. See 
<https://docs.python.org/3.4/library/functions.html#open>, in particular, “The 
default encoding is platform dependent (whatever locale.getpreferredencoding() 
returns)”.

If your file’s encoding is determined some other way, you should specify that 
other encoding. For JSON, I understand UTF-8 is generally always used, so you 
should call open("test.json", encoding="utf-8").

----------
nosy: +martin.panter
resolution:  -> not a bug
status: open -> closed

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue25028>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to