Serhiy Storchaka added the comment: > If someone is willing to do the work (and I am), is there a reason *not* to > allow TextIOWrapper to accept bytes-like objects?
Yes, there are. The code which works only with bytes is much simpler. Not only TextIOWrapper, but many other classes in the stdlib (GzipFile, BZ2File, LZMAFile, ZipFile) expect that the read method of underlied file object returns bytes, so your MyByteStream is just broken for such cases. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue21057> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com