Skip to content

Crashes when running with xmlschema #11105

@gaborbernat

Description

@gaborbernat

Crash Report

(Tell us what happened.)

Traceback

version: 0.920+dev.05f38571f1b7af46dbadaeba0f74626d3a9e07c9
/Users/git/prj/.tox/4/type/lib/python3.9/site-packages/xmlschema/xpath.py:211: : note: use --pdb to drop into pdb
Traceback (most recent call last):
  File "/Users/git/prj/.tox/4/type/bin/mypy", line 8, in <module>
    sys.exit(console_entry())
  File "/Users/git/prj/.tox/4/type/lib/python3.9/site-packages/mypy/__main__.py", line 11, in console_entry
    main(None, sys.stdout, sys.stderr)
  File "/Users/git/prj/.tox/4/type/lib/python3.9/site-packages/mypy/main.py", line 87, in main
    res, messages, blockers = run_build(sources, options, fscache, t0, stdout, stderr)
  File "/Users/git/prj/.tox/4/type/lib/python3.9/site-packages/mypy/main.py", line 165, in run_build
    res = build.build(sources, options, None, flush_errors, fscache, stdout, stderr)
  File "/Users/git/prj/.tox/4/type/lib/python3.9/site-packages/mypy/build.py", line 179, in build
    result = _build(
  File "/Users/git/prj/.tox/4/type/lib/python3.9/site-packages/mypy/build.py", line 254, in _build
    graph = dispatch(sources, manager, stdout)
  File "/Users/git/prj/.tox/4/type/lib/python3.9/site-packages/mypy/build.py", line 2707, in dispatch
    process_graph(graph, manager)
  File "/Users/git/prj/.tox/4/type/lib/python3.9/site-packages/mypy/build.py", line 3031, in process_graph
    process_stale_scc(graph, scc, manager)
  File "/Users/git/prj/.tox/4/type/lib/python3.9/site-packages/mypy/build.py", line 3129, in process_stale_scc
    graph[id].type_check_first_pass()
  File "/Users/git/prj/.tox/4/type/lib/python3.9/site-packages/mypy/build.py", line 2175, in type_check_first_pass
    self.type_checker().check_first_pass()
  File "/Users/git/prj/.tox/4/type/lib/python3.9/site-packages/mypy/checker.py", line 303, in check_first_pass
    self.accept(d)
  File "/Users/git/prj/.tox/4/type/lib/python3.9/site-packages/mypy/checker.py", line 409, in accept
    stmt.accept(self)
  File "/Users/git/prj/.tox/4/type/lib/python3.9/site-packages/mypy/nodes.py", line 959, in accept
    return visitor.visit_class_def(self)
  File "/Users/git/prj/.tox/4/type/lib/python3.9/site-packages/mypy/checker.py", line 1741, in visit_class_def
    self.accept(defn.defs)
  File "/Users/git/prj/.tox/4/type/lib/python3.9/site-packages/mypy/checker.py", line 409, in accept
    stmt.accept(self)
  File "/Users/git/prj/.tox/4/type/lib/python3.9/site-packages/mypy/nodes.py", line 1024, in accept
    return visitor.visit_block(self)
  File "/Users/git/prj/.tox/4/type/lib/python3.9/site-packages/mypy/checker.py", line 2003, in visit_block
    self.accept(s)
  File "/Users/git/prj/.tox/4/type/lib/python3.9/site-packages/mypy/checker.py", line 409, in accept
    stmt.accept(self)
  File "/Users/git/prj/.tox/4/type/lib/python3.9/site-packages/mypy/nodes.py", line 696, in accept
    return visitor.visit_func_def(self)
  File "/Users/git/prj/.tox/4/type/lib/python3.9/site-packages/mypy/checker.py", line 741, in visit_func_def
    self._visit_func_def(defn)
  File "/Users/git/prj/.tox/4/type/lib/python3.9/site-packages/mypy/checker.py", line 745, in _visit_func_def
    self.check_func_item(defn, name=defn.name)
  File "/Users/git/prj/.tox/4/type/lib/python3.9/site-packages/mypy/checker.py", line 807, in check_func_item
    self.check_func_def(defn, typ, name)
  File "/Users/git/prj/.tox/4/type/lib/python3.9/site-packages/mypy/checker.py", line 990, in check_func_def
    self.accept(item.body)
  File "/Users/git/prj/.tox/4/type/lib/python3.9/site-packages/mypy/checker.py", line 409, in accept
    stmt.accept(self)
  File "/Users/git/prj/.tox/4/type/lib/python3.9/site-packages/mypy/nodes.py", line 1024, in accept
    return visitor.visit_block(self)
  File "/Users/git/prj/.tox/4/type/lib/python3.9/site-packages/mypy/checker.py", line 2003, in visit_block
    self.accept(s)
  File "/Users/git/prj/.tox/4/type/lib/python3.9/site-packages/mypy/checker.py", line 409, in accept
    stmt.accept(self)
  File "/Users/git/prj/.tox/4/type/lib/python3.9/site-packages/mypy/nodes.py", line 1083, in accept
    return visitor.visit_assignment_stmt(self)
  File "/Users/git/prj/.tox/4/type/lib/python3.9/site-packages/mypy/checker.py", line 2045, in visit_assignment_stmt
    self.check_assignment(s.lvalues[-1], s.rvalue, s.type is None, s.new_syntax)
  File "/Users/git/prj/.tox/4/type/lib/python3.9/site-packages/mypy/checker.py", line 2227, in check_assignment
    rvalue_type = self.expr_checker.accept(rvalue)
  File "/Users/git/prj/.tox/4/type/lib/python3.9/site-packages/mypy/checkexpr.py", line 3912, in accept
    typ = node.accept(self)
  File "/Users/git/prj/.tox/4/type/lib/python3.9/site-packages/mypy/nodes.py", line 1600, in accept
    return visitor.visit_call_expr(self)
  File "/Users/git/prj/.tox/4/type/lib/python3.9/site-packages/mypy/checkexpr.py", line 277, in visit_call_expr
    return self.visit_call_expr_inner(e, allow_none_return=allow_none_return)
  File "/Users/git/prj/.tox/4/type/lib/python3.9/site-packages/mypy/checkexpr.py", line 366, in visit_call_expr_inner
    ret_type = self.check_call_expr_with_callee_type(callee_type, e, fullname,
  File "/Users/git/prj/.tox/4/type/lib/python3.9/site-packages/mypy/checkexpr.py", line 873, in check_call_expr_with_callee_type
    return self.check_call(callee_type, e.args, e.arg_kinds, e,
  File "/Users/git/prj/.tox/4/type/lib/python3.9/site-packages/mypy/checkexpr.py", line 933, in check_call
    return self.check_callable_call(callee, args, arg_kinds, context, arg_names,
  File "/Users/git/prj/.tox/4/type/lib/python3.9/site-packages/mypy/checkexpr.py", line 1030, in check_callable_call
    self.check_argument_types(arg_types, arg_kinds, args, callee, formal_to_actual, context,
  File "/Users/git/prj/.tox/4/type/lib/python3.9/site-packages/mypy/checkexpr.py", line 1495, in check_argument_types
    check_arg(expanded_actual, actual_type, arg_kinds[actual],
  File "/Users/git/prj/.tox/4/type/lib/python3.9/site-packages/mypy/checkexpr.py", line 1536, in check_arg
    messages.incompatible_argument_note(original_caller_type, callee_type, context,
  File "/Users/git/prj/.tox/4/type/lib/python3.9/site-packages/mypy/messages.py", line 599, in incompatible_argument_note
    self.report_protocol_problems(original_caller_type, item,
  File "/Users/git/prj/.tox/4/type/lib/python3.9/site-packages/mypy/messages.py", line 1448, in report_protocol_problems
    conflict_types = get_conflict_protocol_types(subtype, supertype)
  File "/Users/git/prj/.tox/4/type/lib/python3.9/site-packages/mypy/messages.py", line 2027, in get_conflict_protocol_types
    is_compat = is_subtype(subtype, supertype, ignore_pos_arg_names=True)
  File "/Users/git/prj/.tox/4/type/lib/python3.9/site-packages/mypy/subtypes.py", line 93, in is_subtype
    return _is_subtype(left, right,
  File "/Users/git/prj/.tox/4/type/lib/python3.9/site-packages/mypy/subtypes.py", line 118, in _is_subtype
    is_subtype_of_item = any(is_subtype(orig_left, item,
  File "/Users/git/prj/.tox/4/type/lib/python3.9/site-packages/mypy/subtypes.py", line 118, in <genexpr>
    is_subtype_of_item = any(is_subtype(orig_left, item,
  File "/Users/git/prj/.tox/4/type/lib/python3.9/site-packages/mypy/subtypes.py", line 93, in is_subtype
    return _is_subtype(left, right,
  File "/Users/git/prj/.tox/4/type/lib/python3.9/site-packages/mypy/subtypes.py", line 147, in _is_subtype
    return left.accept(SubtypeVisitor(orig_right,
  File "/Users/git/prj/.tox/4/type/lib/python3.9/site-packages/mypy/types.py", line 1809, in accept
    return visitor.visit_partial_type(self)
  File "/Users/git/prj/.tox/4/type/lib/python3.9/site-packages/mypy/subtypes.py", line 480, in visit_partial_type
    raise RuntimeError
RuntimeError:

To Reproduce

I am running into this in a complex private code, and haven't managed to make a small reproducible yet.

Your Environment

  • Mypy version used: master
  • Mypy command-line flags: mypy --python-version 3.8 --namespace-packages --strict --config-file tox.ini --package pkg --show-traceback
  • Mypy configuration options from mypy.ini (and other config files): none.
  • Python version used: 3.9.7
  • Operating system and version: macOS Catalina
❯ .tox/4/type/bin/pip list
Package                        Version
------------------------------ --------------------------------------------------
elementpath                    2.3.1
mypy                           0.920+dev.05f38571f1b7af46dbadaeba0f74626d3a9e07c9
mypy-extensions                0.4.3
pip                            21.2.4
setuptools                     57.4.0
toml                           0.10.2
tomli                          1.1.0
typing-extensions              3.10.0.2
wheel                          0.37.0
xmlschema                      1.7.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions