Closed
Description
For the following example:
import sys, io
if isinstance(sys.stdout, io.TextIOWrapper) and sys.version_info < (3, 7):
sys.stdout = io.TextIOWrapper(
sys.stdout.detach(),
encoding="ascii",
errors="replace")
I get the following error:
reconfigure36.py:5: error: Argument 1 to "TextIOWrapper" has incompatible type "IOBase"; expected "IO[bytes]"
Should not TextIOWrapper.detach()
return IO[bytes]
instead of IOBase
?
Replacing sys.stdout.detach()
with sys.stdout.buffer
fixes the complains.
Metadata
Metadata
Assignees
Labels
No labels