Message226057
_make_iterencode in python2.7/json/encoder.py encodes custom enum types incorrectly (the label will be printed without '"') because of these lines (line 320 in 2.7.6):
elif isinstance(value, (int, long)):
yield buf + str(value)
in constract, _make_iterencode in python 3 explicitly supports the enum types:
elif isinstance(value, int):
# Subclasses of int/float may override __str__, but we still
# want to encode them as integers/floats in JSON. One example
# within the standard library is IntEnum.
yield buf + str(int(value)) |
|
Date |
User |
Action |
Args |
2014-08-29 11:00:34 | eddygeek | set | recipients:
+ eddygeek |
2014-08-29 11:00:34 | eddygeek | set | messageid: <1409310034.91.0.63329091583.issue22297@psf.upfronthosting.co.za> |
2014-08-29 11:00:34 | eddygeek | link | issue22297 messages |
2014-08-29 11:00:34 | eddygeek | create | |
|