-
-
Notifications
You must be signed in to change notification settings - Fork 3k
assert file not in self.flushed_files (without MYPY_PATH) #7510
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
I was able to reproduce the crash. If I comment out the assert, everything seems to work okay. |
Isn't this a duplicate of #4881? |
Based on a quick investigation it wasn't clear to me whether the same fix would work for both issues. They are closely related at least. In this issue the key seems to be The root cause seems to be the same -- mypy assigns multiple module names to a file, based on different package root paths. |
Thanks, glad the repro worked. Given that this assert is the cause of a few issues, is it worth removing it (or maybe converting to a warning instead)? |
Yeah, maybe it should be turned into an error message. When we hit it something has gone wrong, but the crash is really unhelpful. |
OK, are you going to do that, or should I try it out? |
@chriselion I'm going to be busy with other things for the next week and a half, so if you'd like to try it out, please go ahead! |
@JukkaL Were you ever able to look into this further? My PR to disable the assert got some pushback, and I'm still not sure how to diagnose and resolve what's causing a file to get processed multiple times. I'm currently running mypy without |
We added a check for "Source file found twice under different module names" a long time back that means this no longer reproes |
Bug
mypy_repro.tar.gz
This is taken from https://github.com/Unity-Technologies/ml-agents/tree/develop - there are a lot of other large files in there, so this is only the relevant python files.
No assert (I still expect errors from my code though).
This also happens using mypy==0.7.2
--ignore-missing-imports --disallow-incomplete-defs --namespace-packages --show-traceback --cache-dir=/dev/null
--cache-dir was just to simplify the repro
See above
This seems similar to some other issues where this assert was hit (e.g. #4881, #6717) but in those, MYPY_PATH was set and here it's not.
The text was updated successfully, but these errors were encountered: