-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
File streams: "BufferedWriter" has incompatible type "BinaryIO"; expected "RawIOBase" #10271
Comments
I fixed this in typeshed a while ago with a serious of overloads for open that return precise types. Maybe that didn't make it into the last mypy release? It should pick the overload at https://github.com/python/typeshed/blob/master/stdlib/builtins.pyi#L1084. |
Just checked, I have
in /usr/local/lib/python3.6/dist-packages/mypy/typeshed/stdlib/3/builtins.pyi |
I can confirm. With mypy 0.812 it doesn't pick up the correct overload, although it exists in the bundled typeshed and it looks like it should pick it. |
It's actually because mypy still has a custom plugin for |
Hi, |
Fixed with #9275 |
I can still reproduce it with mypy 0.931: $ mypy test.py
foo.py:5:24: error: Argument 1 to "BufferedWriter" has incompatible type "BinaryIO"; expected "RawIOBase"
Found 1 error in 1 file (checked 1 source file)
$ mypy --version
mypy 0.931 Edit: …but not with mypy 0.961. Ok then, I guess. |
Bug Report
This code
throws:
Your Environment
mypy.ini
(and other config files):The text was updated successfully, but these errors were encountered: