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.

Author Matthew Havard
Recipients Matthew Havard
Date 2015-06-30.20:16:21
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1435695382.36.0.927622903083.issue24540@psf.upfronthosting.co.za>
In-reply-to
Content
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".
History
Date User Action Args
2015-06-30 20:16:22Matthew Havardsetrecipients: + Matthew Havard
2015-06-30 20:16:22Matthew Havardsetmessageid: <1435695382.36.0.927622903083.issue24540@psf.upfronthosting.co.za>
2015-06-30 20:16:22Matthew Havardlinkissue24540 messages
2015-06-30 20:16:21Matthew Havardcreate