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
$ mypy --fast-parser --silent-imports --py2 --check-untyped-defs --disallow-untyped-defs testcase.py
Traceback (most recent call last):
File "/srv/zulip-py3-venv/bin/mypy", line 6, in <module>
main(__file__)
File "/srv/zulip-py3-venv/lib/python3.5/site-packages/mypy/main.py", line 54, in main
res = type_check_only(sources, bin_dir, options)
File "/srv/zulip-py3-venv/lib/python3.5/site-packages/mypy/main.py", line 102, in type_check_only
python_path=options.python_path)
File "/srv/zulip-py3-venv/lib/python3.5/site-packages/mypy/build.py", line 209, in build
dispatch(sources, manager)
File "/srv/zulip-py3-venv/lib/python3.5/site-packages/mypy/build.py", line 1319, in dispatch
graph = load_graph(sources, manager)
File "/srv/zulip-py3-venv/lib/python3.5/site-packages/mypy/build.py", line 1334, in load_graph
st = State(id=bs.module, path=bs.path, source=bs.text, manager=manager)
File "/srv/zulip-py3-venv/lib/python3.5/site-packages/mypy/build.py", line 1106, in __init__
self.parse_file()
File "/srv/zulip-py3-venv/lib/python3.5/site-packages/mypy/build.py", line 1217, in parse_file
self.tree = manager.parse_file(self.id, self.xpath, source)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/contextlib.py", line 77, in __exit__
self.gen.throw(type, value, traceback)
File "/srv/zulip-py3-venv/lib/python3.5/site-packages/mypy/build.py", line 1171, in wrap_context
yield
File "/srv/zulip-py3-venv/lib/python3.5/site-packages/mypy/build.py", line 1217, in parse_file
self.tree = manager.parse_file(self.id, self.xpath, source)
File "/srv/zulip-py3-venv/lib/python3.5/site-packages/mypy/build.py", line 449, in parse_file
fast_parser=FAST_PARSER in self.flags)
File "/srv/zulip-py3-venv/lib/python3.5/site-packages/mypy/parse.py", line 88, in parse
custom_typing_module=custom_typing_module)
File "/srv/zulip-py3-venv/lib/python3.5/site-packages/mypy/fastparse.py", line 69, in parse
).visit(ast)
File "/srv/zulip-py3-venv/lib/python3.5/site-packages/typed_ast/ast35.py", line 252, in visit
return visitor(node)
File "/srv/zulip-py3-venv/lib/python3.5/site-packages/mypy/fastparse.py", line 221, in visit_Module
body = self.fix_function_overloads(self.visit_list(mod.body))
File "/srv/zulip-py3-venv/lib/python3.5/site-packages/mypy/fastparse.py", line 122, in visit_list
return [self.visit(e) for e in l]
File "/srv/zulip-py3-venv/lib/python3.5/site-packages/mypy/fastparse.py", line 122, in <listcomp>
return [self.visit(e) for e in l]
File "/srv/zulip-py3-venv/lib/python3.5/site-packages/typed_ast/ast35.py", line 252, in visit
return visitor(node)
File "/srv/zulip-py3-venv/lib/python3.5/site-packages/mypy/fastparse.py", line 90, in wrapper
node = f(self, ast)
File "/srv/zulip-py3-venv/lib/python3.5/site-packages/mypy/fastparse.py", line 242, in visit_FunctionDef
func_type_ast = ast35.parse(n.type_comment, '<func_type>', 'func_type')
File "/srv/zulip-py3-venv/lib/python3.5/site-packages/typed_ast/ast35.py", line 42, in parse
return _ast35._parse(source, filename, mode)
SyntaxError: invalid syntax (<func_type>, line 1)
*** INTERNAL ERROR ***
testcase.py: error: Internal error -- please report a bug at https://github.com/python/mypy/issues
NOTE: you can use "mypy --pdb ..." to drop into the debugger when this happens.
This should be changed to the informative message that results when the --fast-parser flag is omitted
$ mypy --silent-imports --py2 --check-untyped-defs --disallow-untyped-defs testcase.py
testcase.py: note: In function "return_a_tuple":
testcase.py:3: error: Parse error before ,
The text was updated successfully, but these errors were encountered:
To reproduce the bug, see https://github.com/medullaskyline/tuplebug
Running the test case:
Annotating a tuple incorrectly will result in an uninformative traceback when running mypy with the
--fast-parser
flag.This is the file I'm parsing: https://github.com/medullaskyline/tuplebug/blob/master/testcase.py
This should be changed to the informative message that results when the
--fast-parser
flag is omittedThe text was updated successfully, but these errors were encountered: