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 berker.peksag
Recipients berker.peksag, qingyunha
Date 2018-03-23.21:27:27
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1521840448.0.0.467229070634.issue32358@psf.upfronthosting.co.za>
In-reply-to
Content
This is already documented in the json.dump() documentation:

    The json module always produces str objects, not bytes objects.
    Therefore, fp.write() must support str input.

Note that the traceback you've posted doesn't have anything to do with the json module and it's expected:

    >>> f = open('/tmp/t.json', 'wb')
    >>> f.write('foo')
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    TypeError: a bytes-like object is required, not 'str'
History
Date User Action Args
2018-03-23 21:27:28berker.peksagsetrecipients: + berker.peksag, qingyunha
2018-03-23 21:27:28berker.peksagsetmessageid: <1521840448.0.0.467229070634.issue32358@psf.upfronthosting.co.za>
2018-03-23 21:27:27berker.peksaglinkissue32358 messages
2018-03-23 21:27:27berker.peksagcreate