KEMBAR78
Daemon crash: comparing tuple and None · Issue #7834 · python/mypy · GitHub
Skip to content

Daemon crash: comparing tuple and None #7834

@JukkaL

Description

@JukkaL

In encountered a mypy daemon crash (when using dmypy suggest, not sure if it's related):

Traceback (most recent call last):
  File "mypy/suggestions.py", line 212, in restore_after
  File "mypy/suggestions.py", line 187, in suggest
  File "mypy/suggestions.py", line 355, in get_suggestion
  File "mypy/suggestions.py", line 325, in find_best
  File "mypy/suggestions.py", line 524, in try_type
  File "mypy/server/update.py", line 275, in trigger
  File "mypy/server/update.py", line 804, in propagate_changes_using_dependencies
  File "mypy/server/update.py", line 951, in reprocess_nodes
  File "mypy/server/astdiff.py", line 160, in snapshot_symbol_table
  File "mypy/server/astdiff.py", line 174, in snapshot_definition
  File "mypy/server/astdiff.py", line 231, in snapshot_type
  File "mypy/types.py", line 1061, in accept
  File "mypy/server/astdiff.py", line 302, in visit_callable_type
  File "mypy/server/astdiff.py", line 242, in snapshot_types
  File "mypy/server/astdiff.py", line 231, in snapshot_type
  File "mypy/types.py", line 1681, in accept
  File "mypy/server/astdiff.py", line 325, in visit_union_type
TypeError: '<' not supported between instances of 'tuple' and 'NoneType'

It seems possible that type snapshots contain None values, which breaks sorting.

I don't have a repro, but the traceback may contain enough hints to fix the issue.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions