[issue18820] json.dump() ignores its 'default' option when serializing dictionary keys

2022-03-13 Thread Irit Katriel
Irit Katriel added the comment: Reproduced on 3.11. -- nosy: +iritkatriel versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.5, Python 3.6 ___ Python tracker ___

[issue18820] json.dump() ignores its 'default' option when serializing dictionary keys

2016-04-08 Thread Erwin Mayer
Erwin Mayer added the comment: Regarding the issues mentioned in https://github.com/simplejson/simplejson/issues/77, they already apply with the current implementation anyway (true is serialized as 'true'), so users must already be careful. The JSONEncoder with default parameters could

[issue18820] json.dump() ignores its 'default' option when serializing dictionary keys

2016-04-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: See also https://github.com/simplejson/simplejson/issues/42 https://github.com/simplejson/simplejson/issues/100 https://github.com/simplejson/simplejson/issues/103 And allowing non-string keys leads to other issue:

[issue18820] json.dump() ignores its 'default' option when serializing dictionary keys

2016-04-08 Thread Berker Peksag
Changes by Berker Peksag : -- assignee: docs@python -> components: -Documentation versions: -Python 3.4 ___ Python tracker

[issue18820] json.dump() ignores its 'default' option when serializing dictionary keys

2016-04-08 Thread Erwin Mayer
Erwin Mayer added the comment: Will this be merged? I also believe it is an unexpected behavior to not serialize dictionary keys when the default option is used. -- nosy: +Erwin Mayer ___ Python tracker

[issue18820] json.dump() ignores its 'default' option when serializing dictionary keys

2015-10-22 Thread Berker Peksag
Changes by Berker Peksag : -- nosy: +berker.peksag stage: test needed -> patch review type: enhancement -> behavior versions: +Python 3.5, Python 3.6 ___ Python tracker

[issue18820] json.dump() ignores its 'default' option when serializing dictionary keys

2014-05-15 Thread Chris Rebert
Changes by Chris Rebert pyb...@rebertia.com: -- nosy: +cvrebert ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18820 ___ ___ Python-bugs-list

[issue18820] json.dump() ignores its 'default' option when serializing dictionary keys

2013-08-23 Thread July Tikhonov
New submission from July Tikhonov: According to documentation of json.dump(), concerning its 'default' option: default(obj) is a function that should return a serializable version of obj or raise TypeError. The default simply raises TypeError. But this function is actually never applied to

[issue18820] json.dump() ignores its 'default' option when serializing dictionary keys

2013-08-23 Thread July Tikhonov
July Tikhonov added the comment: Oops, my patch disables 'skipkeys' argument of dump. Another version attached. -- Added file: http://bugs.python.org/file31437/json-default-dict-keys.diff ___ Python tracker rep...@bugs.python.org

[issue18820] json.dump() ignores its 'default' option when serializing dictionary keys

2013-08-23 Thread July Tikhonov
Changes by July Tikhonov july.t...@gmail.com: Removed file: http://bugs.python.org/file31436/json-default-dict-keys.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18820 ___

[issue18820] json.dump() ignores its 'default' option when serializing dictionary keys

2013-08-23 Thread Ezio Melotti
Ezio Melotti added the comment: Are there already tests that cover the changes in your patch? If not, could you add them? -- nosy: +ezio.melotti, pitrou, rhettinger stage: - test needed ___ Python tracker rep...@bugs.python.org

[issue18820] json.dump() ignores its 'default' option when serializing dictionary keys

2013-08-23 Thread July Tikhonov
July Tikhonov added the comment: Proposed tests attached. -- Added file: http://bugs.python.org/file31450/json-default-tests.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18820 ___