-
-
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
Crash on older versions of Python for a slice in a type subscript #17679
Comments
I'm struggling to reproduce this on mypy-playground or locally. Do you have any configuration files lying around, e.g. |
I can reproduce it with Python 3.8.10, but not with a more recent version, like Python 3.11.0. |
Thanks, I can reproduce this too on 3.8:
@VictorSizov the bug in your code is that you have However, of course this is still a bug in mypy; mypy should report an error here instead of crashing. |
mypy has dropped support for running with Python 3.8 and this isn't an issue when running mypy with Python 3.9 or newer |
Crash Report
Validating of my python module causes "INTERNAL ERROR"
Traceback
version: 1.11.1
Traceback (most recent call last):
File "/home/sizov/Documents/root/venv/bin/mypy", line 8, in
sys.exit(console_entry())
File "mypy/build.py", line 2069, in wrap_context
File "mypy/build.py", line 2176, in parse_file
File "mypy/build.py", line 841, in parse_file
File "mypy/parse.py", line 27, in parse
File "mypy/fastparse.py", line 234, in parse
File "mypy/fastparse.py", line 401, in visit
File "mypy/fastparse.py", line 860, in visit_Module
File "mypy/fastparse.py", line 475, in translate_stmt_list
File "mypy/fastparse.py", line 401, in visit
File "mypy/fastparse.py", line 873, in visit_FunctionDef
File "mypy/fastparse.py", line 890, in do_func_def
File "mypy/fastparse.py", line 1072, in transform_args
File "mypy/fastparse.py", line 1115, in make_argument
File "mypy/fastparse.py", line 1877, in visit
File "mypy/fastparse.py", line 2086, in visit_Subscript
File "mypy/fastparse.py", line 1877, in visit
File "mypy/fastparse.py", line 2065, in visit_Subscript
AttributeError: 'NoneType' object has no attribute 'col_offset'
parser.py: : note: use --pdb to drop into pdb
To Reproduce
write stand-alone example to disk as python file:
and call "mypy <stand-alone example>"
My Environment
The text was updated successfully, but these errors were encountered: