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

(🐞) dmypy recheck --update crashes #15795

Open
KotlinIsland opened this issue Aug 1, 2023 · 2 comments · May be fixed by #18330
Open

(🐞) dmypy recheck --update crashes #15795

KotlinIsland opened this issue Aug 1, 2023 · 2 comments · May be fixed by #18330

Comments

@KotlinIsland
Copy link
Contributor

👉 dmypy start
Daemon started
👉 dmypy check test1.py
Success: no issues found in 42 source files
👉 dmypy recheck --update test2.py
Daemon crashed!
Traceback (most recent call last):
  File "mypy\dmypy_server.py", line 234, in serve
  File "mypy\dmypy_server.py", line 281, in run_command
  File "mypy\dmypy_server.py", line 396, in cmd_recheck
AssertionError

mypy 1.4.1
no config files

@KotlinIsland KotlinIsland added the bug mypy got something wrong label Aug 1, 2023
@AlexWaygood AlexWaygood added crash topic-daemon dmypy and removed bug mypy got something wrong labels Aug 1, 2023
@benbuckman
Copy link

benbuckman commented Jul 16, 2024

I am encountering this too, and it seems sort of by-design, if you have --follow-imports=normal:

https://github.com/python/mypy/blob/v1.10.0/mypy/dmypy_server.py#L403
https://github.com/python/mypy/blob/v1.10.0/mypy/dmypy_server.py#L450-L453

but perhaps not documented.

kcornw added a commit to kcornw/mypy that referenced this issue Dec 23, 2024
@kcornw kcornw linked a pull request Dec 23, 2024 that will close this issue
@kcornw
Copy link

kcornw commented Dec 23, 2024

Hello!

It seems that if remove or update is given, this part updates the sources list, but without setting remove or update to None (nor should be). In other words, the assertion error will be triggered as long as either remove or update is given (and following imports, which is a default behavior).

Thus, in my opinion, the assertion looks unnecessary?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants