[issue33255] json.dumps has different behaviour if encoding='utf-8' or encoding='utf8'

2018-04-29 Thread Nicolás Hatcher
Nicolás Hatcher added the comment: Hi Sehriy, I am ok with that change. I think it makes much more sense, but I also think it will break people's codes. At least with the simplest fix in which: >>> json.dumps({"g"}, ensure_ascii=False) u'"g"'

[issue33255] json.dumps has different behaviour if encoding='utf-8' or encoding='utf8'

2018-04-18 Thread Nicolás Hatcher
Change by Nicolás Hatcher : -- keywords: +patch pull_requests: +6217 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue33255> ___ ___ Py

[issue33255] json.dumps has different behaviour if encoding='utf-8' or encoding='utf8'

2018-04-10 Thread Nicolás Hatcher
New submission from Nicolás Hatcher : Hey I'm new here, so please let me know what incorrect things I am doing! I _think_ `json.dumps(o, ensure_ascii=False)` is doing the wrong thing when `o` has both unicode and str keys/values. For instance: ``` import json o = {u"greeting":