-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Support TextIOWrapper.reconfigure() #3049
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Currently |
For the following code import sys, io
if isinstance(sys.stdout, io.TextIOWrapper) and sys.version_info >= (3, 7):
sys.stdout.reconfigure(errors="replace") I get the error:
MyPy understand that |
What is worse -- I cannot silence the error by adding |
I haven't touched MyPy in many months but your platform check might be too complex for https://mypy.readthedocs.io/en/stable/common_issues.html#python-version-and-system-platform-checks to understand. Try splitting it into two |
FWIW, I just checked the following with mypy 0.770 using import sys, io
if isinstance(sys.stdout, io.TextIOWrapper) and sys.version_info >= (3, 7):
sys.stdout.reconfigure(errors="replace") # type: ignore That said, we'll gladly accept a PR that adds |
It is the same if split on two |
I'm getting a
error for
It's a new Python 3.7 feature. Was informed in Gitter that this hadn't been added to Typeshed yet and to open a ticket for it.
See https://docs.python.org/3/whatsnew/3.7.html#io
The text was updated successfully, but these errors were encountered: