[issue31271] an assertion failure in io.TextIOWrapper.write

Serhiy Storchaka report at bugs.python.org
Sat Aug 26 11:47:24 EDT 2017


Serhiy Storchaka added the comment:

> do you still think we should backport to 2.7?

This is not trivial question. On one side, using PyString_GET_SIZE() with non-bytes object definitely is a bug. It is better to catch it earlier rather than hope on failing in the following code. On other side, adding a check for bytes can break existing user code that is passed now by accident. _PyBytes_Join() in 2.7 supports unicode objects.

I think that the fix should be backported, and the proper fix should allow bytes and unicode objects. But I left the decision on Benjamin.

----------
nosy: +benjamin.peterson

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue31271>
_______________________________________


More information about the Python-bugs-list mailing list