[issue25457] json dump fails for mixed-type keys when sort_keys is specified

2021-07-10 Thread Christian Tanzer
Christian Tanzer added the comment: Json keys *are strings*. That‘s why json.dump stringifies all keys. If you want to argue that this behavior is wrong I wouldn’t protest except for that it breaks extant code. But arguing that sorting the stringified keys would violate user’s expectations

[issue22005] datetime.__setstate__ fails decoding python2 pickle

2018-12-09 Thread Christian Tanzer
Christian Tanzer added the comment: Paul Ganssle wrote at Fri, 07 Dec 2018 17:22:36 +: > > Gregory P. Smith (gregory.p.smith) 2017-03-02 18:57 > > TL;DR - Just one more example of why nobody should *ever* use pickle > > under any circumstances. It i

[issue25457] json dump fails for mixed-type keys when sort_keys is specified

2018-05-21 Thread Christian Tanzer
Christian Tanzer <tan...@swing.co.at> added the comment: Aaron Hall wrote at Sun, 20 May 2018 16:49:06 +: > Now that dicts are sortable, does that make the sort_keys argument redundant? > > Should this bug be changed to "won't fix"? https://bugs.python.org/issue2

[issue22005] datetime.__setstate__ fails decoding python2 pickle

2016-04-14 Thread Christian Tanzer
Christian Tanzer added the comment: This issue is getting old. Is there any way to solve this for Python 3.6? -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue25545] email parsing docs: clarify that only ASCII strings are supported

2015-11-07 Thread Christian Tanzer
Christian Tanzer added the comment: Terry J. Reedy wrote at Fri, 06 Nov 2015 22:49:57 +: > email parsing docs: clarify that only ASCII strings are supported If that is the decision, `message_from_string` should raise an exception if it gets a non-ASCII argum

[issue25545] email parsing docs need to be clear that only ASCII strings are supported

2015-11-06 Thread Christian Tanzer
Christian Tanzer added the comment: > If you can suggest ways of improving the string support without > breaking existing python3 code that may be using it (most likely > wrongly, but working for them), then I will happily review them. At the moment, I'm mainly interested in ha

[issue25545] email parsing docs need to be clear that only ASCII strings are supported

2015-11-05 Thread Christian Tanzer
Christian Tanzer added the comment: > Yes, the port from python2 to python3 of the email package > was...suboptimal. > ... > The whole concept of using unicode as a 7bit data channel only is > just...weird. +100 to both. > But, we are now stuck with maintaining tha

[issue25545] email.message.get_payload returns wrong encoding

2015-11-04 Thread Christian Tanzer
Christian Tanzer added the comment: R. David Murray wrote at Tue, 03 Nov 2015 19:59:53 +: > Your problem is that your input email is ia unicode string. A unicode > string has no RFC defintion as an email, so things do not work right, > as you observed. Whether or not email sho

[issue25545] email.message.get_payload returns wrong encoding

2015-11-03 Thread Christian Tanzer
New submission from Christian Tanzer: For an email message with `Content-type: text/plain; charset=utf-8`, in Python 3.5, get_payload returns a bytes object encoded with `latin-1`. Python 2.7 returns a str object encoded with `utf-8` as expected. Running the attached test script

[issue25457] json dump fails for mixed-type keys when sort_keys is specified

2015-10-23 Thread Christian Tanzer
Christian Tanzer added the comment: Josh Rosenberg wrote at Fri, 23 Oct 2015 02:45:51 +: > The Python 2 sort order is a result of the "arbitrary but consistent > fallback comparison" (omitting details, it's comparing the names of > the types), thus the "strange"

[issue25457] json dump fails for mixed-type keys when sort_keys is specified

2015-10-23 Thread Christian Tanzer
Christian Tanzer added the comment: Josh Rosenberg wrote at Fri, 23 Oct 2015 02:56:30 +: > As a workaround (should you absolutely need to sort keys by some > arbitrary criteria), you can initialize a collections.OrderedDict from > the sorted items of your original dict (using wha

[issue25457] json dump fails for mixed-type keys when sort_keys is specified

2015-10-22 Thread Christian Tanzer
New submission from Christian Tanzer: In Python 3, trying to json-dump a dict with keys of different types fails with a TypeError when sort_keys is specified: python2.7 === Python 2.7.10 (default, May 29 2015, 10:02:30) [GCC 4.8.4] on linux2 Type "help", "copyr

[issue22005] datetime.__setstate__ fails decoding python2 pickle

2015-10-15 Thread Christian Tanzer
Christian Tanzer added the comment: IMNSHO, the problem lies in the Python 3 pickle.py and it is **not** restricted to datetime instances (for a detailed rambling see http://c-tanzer.at/en/breaking_py2_pickles_in_py3.html) . In Python 2, 8-bit strings are used for text and for binary data

[issue22005] datetime.__setstate__ fails decoding python2 pickle

2015-10-12 Thread Christian Tanzer
Christian Tanzer added the comment: > The code works when using encoding='bytes'. Thanks Tim for the suggestion. > So this is not a bug, but is there any sense in having encoding='ASCII' by > default in pickle ? It is most definitely a bug. And it adds another road block to movi