You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
io.TextIOWrapper is explicitly documented as buffered stream in CPython docs. As supporting buffered text streams is a separate issue, it was decided to implement needed functionality on the level of uio.TextIOBase. In CPython, it's an abstract base class, but we recast it as a generic, unbuffered adapter from binary to text streams.
So, now it's possible to do uio.TextIOBase(uio.BytesIO(b"1234")).
This change is made so far to the unix port, other ports need to catch up with it later. (For now, they keep using old uio.TextIOWrapper, so it's left in the codebase.)
Currently, it has constructor uio.TextIOWrapper(filename). Instead, it should be uio.TextIOWrapper(stream): https://docs.python.org/3/library/io.html#io.TextIOWrapper
Current situation effectively means that there's no way to convert a binary stream to text stream (socket has a workaround using .makefile() method).
The text was updated successfully, but these errors were encountered: