Skip to content

TextIOWrapper.encoding missing Optional Argument #3124

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

Closed
WillAyd opened this issue Jul 16, 2019 · 0 comments · Fixed by #3125
Closed

TextIOWrapper.encoding missing Optional Argument #3124

WillAyd opened this issue Jul 16, 2019 · 0 comments · Fixed by #3125

Comments

@WillAyd
Copy link
Contributor

WillAyd commented Jul 16, 2019

Happy to submit a PR to fix but I think this is wrong

from io import BytesIO, TextIOWrapper
from typing import Optional

encoding = None  # type: Optional[str]
buf = BytesIO()
TextIOWrapper(buf, encoding=encoding)
mypy_test.py:6: error: Argument "encoding" to "TextIOWrapper" has incompatible type "Optional[str]"; expected "str"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant