Message245997
The documentation from json.dumps says this about skipkeys:
If ``skipkeys`` is false then ``dict`` keys that are not basic types
(``str``, ``int``, ``float``, ``bool``, ``None``) will be skipped
instead of raising a ``TypeError``.
However, that contradicts the docstrings for JSONEncoder in the encoder.py file, and json.dump in the same file, __init__.py:
json.dump:
If ``skipkeys`` is true then ``dict`` keys that are not basic types
(``str``, ``int``, ``float``, ``bool``, ``None``) will be skipped
instead of raising a ``TypeError``.
JSONEncoder:
If skipkeys is false, then it is a TypeError to attempt
encoding of keys that are not str, int, long, float or None. If
skipkeys is True, such items are simply skipped.
So the fix is just that the word "false" to "true". |
|
Date |
User |
Action |
Args |
2015-06-30 20:16:22 | Matthew Havard | set | recipients:
+ Matthew Havard |
2015-06-30 20:16:22 | Matthew Havard | set | messageid: <1435695382.36.0.927622903083.issue24540@psf.upfronthosting.co.za> |
2015-06-30 20:16:22 | Matthew Havard | link | issue24540 messages |
2015-06-30 20:16:21 | Matthew Havard | create | |
|