Message226057
| Author |
eddygeek |
| Recipients |
eddygeek |
| Date |
2014年08月29日.11:00:34 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1409310034.91.0.63329091583.issue22297@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
_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)) |
|
History
|
|---|
| 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 |
|