This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Incorrect enum behavior during json.dumps serialization
Type: Stage: resolved
Components: Versions: Python 2.7
process
Status: closed Resolution: third party
Dependencies: Superseder:
Assigned To: Nosy List: Vitaly Belman, ethan.furman, r.david.murray
Priority: normal Keywords:

Created on 2015-09-30 14:48 by Vitaly Belman, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (3)
msg251945 - (view) Author: Vitaly Belman (Vitaly Belman) Date: 2015-09-30 14:48
Possibly related to: http://bugs.python.org/issue18264


The following code:

>>> import IntEnum from enum
>>> from enum import IntEnum
>>> class a(IntEnum): a=0
>>> json.loads(json.dumps({"x": a.a}))

Produces:

ValueError: No JSON object could be decoded

Which makes sense because the json dumps function produces is: {"x": a.a}
msg251946 - (view) Author: Vitaly Belman (Vitaly Belman) Date: 2015-09-30 14:49
Note: Using pip library enum34
msg251947 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2015-09-30 15:05
As indicated by the issue you referenced and the fact that you are using enum34, this is not a bug in the python or its standard library.  I believe the correct place to report this is https://bitbucket.org/stoneleaf/enum34/issues?status=new&status=open.
History
Date User Action Args
2022-04-11 14:58:22adminsetgithub: 69468
2015-09-30 15:05:50r.david.murraysetstatus: open -> closed

nosy: + r.david.murray, ethan.furman
messages: + msg251947

resolution: third party
stage: resolved
2015-09-30 14:49:36Vitaly Belmansetmessages: + msg251946
2015-09-30 14:48:44Vitaly Belmancreate