Skip to content

Crash when using incremental mode #1482

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
JukkaL opened this issue May 5, 2016 · 1 comment
Closed

Crash when using incremental mode #1482

JukkaL opened this issue May 5, 2016 · 1 comment
Assignees
Labels
bug mypy got something wrong

Comments

@JukkaL
Copy link
Collaborator

JukkaL commented May 5, 2016

mypy -i crashed when type checking this program for the second time:

from os import path
1 + ''

Here's the traceback:

Traceback (most recent call last):
  File "scripts/mypy", line 6, in <module>
    main(__file__)
  File "/home/jukka/src/mypy/mypy/main.py", line 54, in main
    res = type_check_only(sources, bin_dir, options)
  File "/home/jukka/src/mypy/mypy/main.py", line 102, in type_check_only
    python_path=options.python_path)
  File "/home/jukka/src/mypy/mypy/build.py", line 209, in build
    dispatch(sources, manager)
  File "/home/jukka/src/mypy/mypy/build.py", line 1255, in dispatch
    process_graph(graph, manager)
  File "/home/jukka/src/mypy/mypy/build.py", line 1386, in process_graph
    process_stale_scc(graph, scc)
  File "/home/jukka/src/mypy/mypy/build.py", line 1414, in process_stale_scc
    graph[id].semantic_analysis_pass_three()
  File "/home/jukka/src/mypy/mypy/build.py", line 1226, in semantic_analysis_pass_three
    self.manager.semantic_analyzer_pass3.visit_file(self.tree, self.xpath)
  File "/home/jukka/src/mypy/mypy/semanal.py", line 2428, in visit_file
    self.accept(file_node)
  File "/home/jukka/src/mypy/mypy/semanal.py", line 2433, in accept
    node.accept(self)
  File "/home/jukka/src/mypy/mypy/nodes.py", line 194, in accept
    return visitor.visit_mypy_file(self)
  File "/home/jukka/src/mypy/mypy/traverser.py", line 34, in visit_mypy_file
    d.accept(self)
  File "/home/jukka/src/mypy/mypy/nodes.py", line 650, in accept
    return visitor.visit_class_def(self)
  File "/home/jukka/src/mypy/mypy/semanal.py", line 2450, in visit_class_def
    self.analyze(type)
  File "/home/jukka/src/mypy/mypy/semanal.py", line 2527, in analyze
    type.accept(analyzer)
  File "/home/jukka/src/mypy/mypy/types.py", line 290, in accept
    return visitor.visit_instance(self)
  File "/home/jukka/src/mypy/mypy/typeanal.py", line 327, in visit_instance
    if not satisfies_upper_bound(arg, TypeVar.upper_bound):
  File "/home/jukka/src/mypy/mypy/subtypes.py", line 73, in satisfies_upper_bound
    return isinstance(a, Void) or is_subtype(a, upper_bound)
  File "/home/jukka/src/mypy/mypy/subtypes.py", line 49, in is_subtype
    return left.accept(SubtypeVisitor(right, type_parameter_checker))
  File "/home/jukka/src/mypy/mypy/types.py", line 340, in accept
    return visitor.visit_type_var(self)
  File "/home/jukka/src/mypy/mypy/subtypes.py", line 137, in visit_type_var
    return is_subtype(left.upper_bound, self.right)
  File "/home/jukka/src/mypy/mypy/subtypes.py", line 49, in is_subtype
    return left.accept(SubtypeVisitor(right, type_parameter_checker))
  File "/home/jukka/src/mypy/mypy/types.py", line 290, in accept
    return visitor.visit_instance(self)
  File "/home/jukka/src/mypy/mypy/subtypes.py", line 111, in visit_instance
    if left.type.fallback_to_any:
AttributeError: 'NoneType' object has no attribute 'fallback_to_any'

*** INTERNAL ERROR ***

typeshed/stdlib/3/os/__init__.pyi:1: 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.
@JukkaL JukkaL added the bug mypy got something wrong label May 5, 2016
@gvanrossum gvanrossum added this to the 0.4.x milestone May 5, 2016
@gvanrossum gvanrossum self-assigned this May 5, 2016
@gvanrossum
Copy link
Member

The cause is 1c9b3b9

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

No branches or pull requests

2 participants