Skip to content

Improve native parser version mismatch errors#21438

Open
cyphercodes wants to merge 1 commit intopython:masterfrom
cyphercodes:fix-21412-native-parser-version-error
Open

Improve native parser version mismatch errors#21438
cyphercodes wants to merge 1 commit intopython:masterfrom
cyphercodes:fix-21412-native-parser-version-error

Conversation

@cyphercodes
Copy link
Copy Markdown

Summary

Fixes #21412.

When parallel checking is used with an incompatible ast-serialize version, mypy now reports a clear blocking error instead of surfacing an internal error from the native parser worker path.

Test Plan

  • pytest -n0 -q mypy/test/test_nativeparse.py::TestNativeParserBinaryFormat
  • pytest -n0 -q mypy/test/test_nativeparse.py
  • python -m mypy --config-file mypy_self_check.ini mypy/parse.py mypy/nativeparse.py mypy/test/test_nativeparse.py
  • pre-commit run --files mypy/nativeparse.py mypy/parse.py mypy/test/test_nativeparse.py
  • git diff --check

Also smoke-tested ast-serialize==0.2.0 with python -m mypy -n2 --no-incremental ... and confirmed it now reports an incompatible-version error instead of an INTERNAL ERROR, then restored ast-serialize==0.3.0 and reran the parallel smoke successfully.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 8, 2026

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

@hauntsaninja hauntsaninja added the pending Issues that may be closed label May 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pending Issues that may be closed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Provide better error for wrong ast_serialize version with parallel checking

2 participants