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

2020-01-05 Thread Cheryl Sabella
Change by Cheryl Sabella : -- resolution: -> wont fix stage: patch review -> resolved status: open -> closed ___ Python tracker ___

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

2018-08-15 Thread Matej Cepl
Change by Matej Cepl : -- nosy: +mcepl ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

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

2018-04-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: You could decode only non-ascii strings. But I'm not sure that it is worth to change something in 2.7. This could be treated aa a new feature. Left this on to Benjamin, the release manager of 2.7. -- nosy:

[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"' Which is again compatible

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

2018-04-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: In simplejson: >>> simplejson.dumps({u"greeting": "hi", "currency": "€"}, ensure_ascii=False, >>> encoding="utf8") u'{"currency": "\u20ac", "greeting": "hi"}' >>> simplejson.dumps({u"greeting": "hi", "currency": "€"},

[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 ___

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

2018-04-13 Thread Ivan Pozdeev
Ivan Pozdeev added the comment: Treating 'utf-8' and its aliases differently (when they specifically mean the Python's, rather than something else's, encoding) is definitely as issue. You shouldn't hardcode a list of aliases though; rather use existing facilities to

[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 =