[New-bugs-announce] [issue25281] Incorrect enum behavior during json.dumps serialization

Vitaly Belman report at bugs.python.org
Wed Sep 30 16:48:44 CEST 2015


New submission from Vitaly Belman:

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}

----------
messages: 251945
nosy: Vitaly Belman
priority: normal
severity: normal
status: open
title: Incorrect enum behavior during json.dumps serialization
versions: Python 2.7

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue25281>
_______________________________________


More information about the New-bugs-announce mailing list