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

zachrahan report at bugs.python.org
Mon May 21 03:29:20 EDT 2018


zachrahan <zpincus at gmail.com> added the comment:

Well, "wontfix" would be appropriate in the context of deprecating the sort_keys option (over the course of however many releases) and documenting that the new procedure for getting JSON output in a specific order is to ensure that the input dict was created in that order.

Certainly for regression testing, sort_keys is no longer needed, but that's not the only reason people are using that option. (It's certainly not why I use the option -- my use stems from sort_keys improving human readability of the JSON.)

But outside of deprecating sort_keys wholesale, it is still a bug that sort_keys=True can cause an error on input that would otherwise be valid for json.dump[s].

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue25457>
_______________________________________


More information about the Python-bugs-list mailing list