Skip to content

Internal error #3415

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

Closed
sharmaeklavya2 opened this issue May 23, 2017 · 6 comments · Fixed by #3422
Closed

Internal error #3415

sharmaeklavya2 opened this issue May 23, 2017 · 6 comments · Fixed by #3422
Labels

Comments

@sharmaeklavya2
Copy link

I ran the latest mypy from master (commit 13b7573) and I got an internal error. I didn't get this error with mypy version 0.511.

File which caused the traceback: https://github.com/zulip/zulip/blob/master/api/integrations/perforce/git_p4.py
This was the only file I ran mypy on.

I didn't use any extra flags with mypy (except --tb to generate the traceback once I got the internal error).

Here's the traceback:

api/integrations/perforce/git_p4.py: error: INTERNAL ERROR -- please report a bug at https://github.com/python/mypy/issues version: 0.520-dev-13b75737bb41d62ae4e7714704dcda3b446fa9f4
Traceback (most recent call last):
  File "/mnt/code/venvs/mypy_venv/bin/mypy", line 6, in <module>
    main(__file__)
  File "/mnt/code/venvs/mypy_venv/lib/python3.5/site-packages/mypy/main.py", line 46, in main
    res = type_check_only(sources, bin_dir, options)
  File "/mnt/code/venvs/mypy_venv/lib/python3.5/site-packages/mypy/main.py", line 93, in type_check_only
    options=options)
  File "/mnt/code/venvs/mypy_venv/lib/python3.5/site-packages/mypy/build.py", line 188, in build
    graph = dispatch(sources, manager)
  File "/mnt/code/venvs/mypy_venv/lib/python3.5/site-packages/mypy/build.py", line 1587, in dispatch
    graph = load_graph(sources, manager)
  File "/mnt/code/venvs/mypy_venv/lib/python3.5/site-packages/mypy/build.py", line 1670, in load_graph
    root_source=True)
  File "/mnt/code/venvs/mypy_venv/lib/python3.5/site-packages/mypy/build.py", line 1259, in __init__
    self.parse_file()
  File "/mnt/code/venvs/mypy_venv/lib/python3.5/site-packages/mypy/build.py", line 1442, in parse_file
    first.visit_file(self.tree, self.xpath, self.id, self.options)
  File "/usr/lib/python3.5/contextlib.py", line 77, in __exit__
    self.gen.throw(type, value, traceback)
  File "/mnt/code/venvs/mypy_venv/lib/python3.5/site-packages/mypy/build.py", line 1347, in wrap_context
    yield
  File "/mnt/code/venvs/mypy_venv/lib/python3.5/site-packages/mypy/build.py", line 1442, in parse_file
    first.visit_file(self.tree, self.xpath, self.id, self.options)
  File "/mnt/code/venvs/mypy_venv/lib/python3.5/site-packages/mypy/semanal.py", line 3423, in visit_file
    d.accept(self)
  File "/mnt/code/venvs/mypy_venv/lib/python3.5/site-packages/mypy/nodes.py", line 1007, in accept
    return visitor.visit_try_stmt(self)
  File "/mnt/code/venvs/mypy_venv/lib/python3.5/site-packages/mypy/semanal.py", line 3614, in visit_try_stmt
    self.sem.analyze_try_stmt(s, self, add_global=self.sem.is_module_scope())
  File "/mnt/code/venvs/mypy_venv/lib/python3.5/site-packages/mypy/semanal.py", line 2632, in analyze_try_stmt
    handler.accept(visitor)
  File "/mnt/code/venvs/mypy_venv/lib/python3.5/site-packages/mypy/nodes.py", line 811, in accept
    return visitor.visit_block(self)
  File "/mnt/code/venvs/mypy_venv/lib/python3.5/site-packages/mypy/semanal.py", line 3458, in visit_block
    node.accept(self)
  File "/mnt/code/venvs/mypy_venv/lib/python3.5/site-packages/mypy/nodes.py", line 750, in accept
    return visitor.visit_class_def(self)
  File "/mnt/code/venvs/mypy_venv/lib/python3.5/site-packages/mypy/semanal.py", line 3526, in visit_class_def
    self.sem.check_no_global(cdef.name, cdef)
  File "/mnt/code/venvs/mypy_venv/lib/python3.5/site-packages/mypy/semanal.py", line 3318, in check_no_global
    self.name_already_defined(n, ctx, self.globals[n])
  File "/mnt/code/venvs/mypy_venv/lib/python3.5/site-packages/mypy/semanal.py", line 3330, in name_already_defined
    extra_msg = ' on line {}'.format(original_ctx.node.get_line())
AttributeError: 'NoneType' object has no attribute 'get_line'
api/integrations/perforce/git_p4.py: note: use --pdb to drop into pdb
@sharmaeklavya2
Copy link
Author

I found a smaller reproducer:

try:
    from subprocess import CalledProcessError
except ImportError:
    class CalledProcessError(object):
        pass

@gvanrossum
Copy link
Member

Could you bisect it?

@ilevkivskyi
Copy link
Member

I think #3396 is to blame. @pkch could you please take a look?

@pkch
Copy link
Contributor

pkch commented May 23, 2017

Yeah, it's my mistake. Please check the PR.

@gvanrossum
Copy link
Member

So since you withdrew the fix we need to merge the revert, right?

JukkaL pushed a commit that referenced this issue May 23, 2017
Reverts #3396

This caused a new crash, the rollback fixes #3415.
@pkch
Copy link
Contributor

pkch commented May 23, 2017

Yup, resubmitting the fix now.

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

Successfully merging a pull request may close this issue.

4 participants