Message300863
all three versions do 'self->pending_bytes_count += PyBytes_GET_SIZE(b);',
while 'b' is the object the encoder returned.
in 3.6 and 3.7, the implementation of PyBytes_GET_SIZE() includes
'assert(PyBytes_Check(op))', but in 2.7, the implementation is 'PyString_GET_SIZE',
which is just 'Py_SIZE(op)'.
and so, in 2.7 there isn't an assertion failure. Moreover,
'self->pending_bytes_count' is used only to determine whether a flush is needed.
so ISTM that probably the bug's only risk is not flushing automatically after
writing.
note that whenever _textiowrapper_writeflush() is finally called (when the
encoder returned a non-string object), it would raise a TypeError by calling
string_join() on a non-string object.
do you still think we should backport to 2.7? |
|
Date |
User |
Action |
Args |
2017-08-26 08:09:28 | Oren Milman | set | recipients:
+ Oren Milman, ncoghlan, serhiy.storchaka, veky |
2017-08-26 08:09:28 | Oren Milman | set | messageid: <1503734968.19.0.875544407965.issue31271@psf.upfronthosting.co.za> |
2017-08-26 08:09:28 | Oren Milman | link | issue31271 messages |
2017-08-26 08:09:27 | Oren Milman | create | |
|