You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(I am replicating how my editor calls mypy to perform linting.)
This gives an internal error:
src/lib/python/cds/querier/query.py:8: error: Function is missing a type annotation
/absolute/path/to/src/lib/python/cds/querier/query.py:7: error: INTERNAL ERROR -- Please try using mypy master on Github:
https://mypy.rtfd.io/en/latest/common_issues.html#using-a-development-mypy-build
Please report a bug at https://github.com/python/mypy/issues
version: 0.770
Traceback (most recent call last):
File "mypy/checker.py", line 401, in accept
File "mypy/nodes.py", line 766, in accept
File "mypy/checker.py", line 3516, in visit_decorator
File "mypy/checker.py", line 792, in check_func_item
File "mypy/checker.py", line 835, in check_func_def
File "mypy/checker.py", line 1060, in check_for_missing_annotations
File "mypy/checker.py", line 4767, in fail
File "mypy/messages.py", line 180, in fail
File "mypy/messages.py", line 165, in report
File "mypy/errors.py", line 319, in report
File "mypy/errors.py", line 350, in add_error_info
File "mypy/errors.py", line 322, in _add_error_info
AssertionError:
/absolute/path/to/src/lib/python/cds/querier/query.py:7: : note: use --pdb to drop into pdb
If I replace in the mypy command the absolute path to the file with the relative path, then mypy works ok:
The issue is probably that your MYPYPATH overlaps with the files you are passing to the command line, which triggers a crash. The issue is #4881, so I'm closing this as a dupe of that.
There was a PR to fix that (#7567) that stalled out for no particularly good reason. I'll try to get that merged since it is pretty bad.
Uh oh!
There was an error while loading. Please reload this page.
BUG
In my project, I have
lib
folder where I have placed some custom modules. The directory looks like this:I have set
PYTHONPATH
to:Similarly, I have set
MYPYPATH
to:Without setting
MYPYPATH
, I do not get proper warnings for type mismatches for my custom modules.The file
cds/querier/query.py
contains:Then, I copy this file to
/tmp/shadow.py
and run:(I am replicating how my editor calls
mypy
to perform linting.)This gives an internal error:
If I replace in the mypy command the absolute path to the file with the relative path, then mypy works ok:
I have tried with the latest development version and I get the same behavior.
The text was updated successfully, but these errors were encountered: