Skip to content
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

errors in other files are reported when running mypy on a file with lowercase drive letter #18590

Open
DetachHead opened this issue Feb 3, 2025 · 2 comments
Labels
bug mypy got something wrong

Comments

@DetachHead
Copy link
Contributor

# foo.py
from sandpit.bar import asdf
# bar.py
asdf: int = ""
> mypy c:\Users\user\project\sandpit\foo.py
c:\Users\user\project\sandpit\bar.py:1: error: Incompatible types in assignment (expression has type "str", variable has type "int")  [assignment]
Found 1 error in 1 file (checked 1 source file)
> mypy C:\Users\user\project\sandpit\foo.py
Success: no issues found in 1 source file
@DetachHead DetachHead added the bug mypy got something wrong label Feb 3, 2025
@A5rocks
Copy link
Collaborator

A5rocks commented Feb 3, 2025

In general mypy fails at case sensitivity on Windows (#12880, #18445, both have information for if someone wants to solve this) but since this is a specific case I won't close as duplicate.

(If I had to guess, the import is resolved to an upper case drive letter which passes some case-sensitive filter based on input files)

@DetachHead
Copy link
Contributor Author

this causes issues with the mypy vscode plugin which always passes files with a lowercase drive letter. if there are too many errors in other files it won't show any of the errors on the current file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug mypy got something wrong
Projects
None yet
Development

No branches or pull requests

2 participants