Message314332
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' |
|
Date |
User |
Action |
Args |
2018-03-23 21:27:28 | berker.peksag | set | recipients:
+ berker.peksag, qingyunha |
2018-03-23 21:27:28 | berker.peksag | set | messageid: <1521840448.0.0.467229070634.issue32358@psf.upfronthosting.co.za> |
2018-03-23 21:27:27 | berker.peksag | link | issue32358 messages |
2018-03-23 21:27:27 | berker.peksag | create | |
|