Message300838
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'
``` |
|
Date |
User |
Action |
Args |
2017-08-25 13:36:54 | ncoghlan | set | recipients:
+ ncoghlan, serhiy.storchaka, veky, Oren Milman |
2017-08-25 13:36:54 | ncoghlan | set | messageid: <1503668214.82.0.0178289426871.issue31271@psf.upfronthosting.co.za> |
2017-08-25 13:36:54 | ncoghlan | link | issue31271 messages |
2017-08-25 13:36:54 | ncoghlan | create | |
|