Nick Coghlan added the comment:

The proposed fix looks good to me, but it did make me wonder if we might have a 
missing check in the other direction as well. However, it looks like that case 
is already fine:


```
>>> hex_codec = codecs.lookup("hex")
>>> hex_codec._is_text_encoding = True
>>> t = io.TextIOWrapper(io.BytesIO(b'foo'), encoding="hex")
>>> t.buffer.write(b'abcd')
4
>>> t.read()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: decoder should return a string result, not 'bytes'
```

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue31271>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to