Error on unicode surrogates in mypyc - #21936
Open
ilevkivskyi wants to merge 1 commit into
Open
Conversation
Contributor
|
Diff from mypy_primer, showing the effect of this PR on open source code: packaging (https://github.com/pypa/packaging)
+ src/packaging/__init__.py: error: INTERNAL ERROR -- Please try using mypy master on GitHub:
+ https://mypy.readthedocs.io/en/stable/common_issues.html#using-a-development-mypy-build
+ Please report a bug at https://github.com/python/mypy/issues
+ version: 2.4.0+dev.4afbdec6456574fcc4f3ec75245d870c9f8dfcf3
+ src/packaging/__init__.py: note: use --pdb to drop into pdb
+ Traceback (most recent call last):
+ File "", line 6, in <module>
+ sys.exit(console_entry())
+ File "/__main__.py", line 16, in console_entry
+ main()
+ File "/main.py", line 154, in main
+ res, messages, blockers = run_build(sources, options, fscache, t0, stdout, stderr)
+ File "/main.py", line 244, in run_build
+ res = build.build(sources, options, None, flush_errors, fscache, stdout, stderr)
+ File "/build.py", line 422, in build
+ result = build_inner(
+ File "/build.py", line 537, in build_inner
+ graph = dispatch(sources, manager, stdout, connect_threads)
+ File "/build.py", line 4078, in dispatch
+ graph = load_graph(sources, manager)
+ File "/build.py", line 4311, in load_graph
+ manager.parse_all([state for state in new if state.needs_parse])
+ File "/build.py", line 1054, in parse_all
+ with state.wrap_context():
+ File "/opt/hostedtoolcache/Python/3.14.7/x64/lib/python3.14/contextlib.py", line 162, in __exit__
+ self.gen.throw(value)
+ File "/build.py", line 3075, in wrap_context
+ yield
+ File "/build.py", line 1063, in parse_all
+ state.tree = load_from_raw(
+ ~~~~~~~~~~~~~^
+ state.xpath,
+ ^^^^^^^^^^^^
+ ...<4 lines>...
+ imports_only=bool(self.workers),
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ )
+ ^
+ File "/parse.py", line 80, in load_from_raw
+ defs = read_statements(state, data, n)
+ File "/nativeparse.py", line 269, in read_statements
+ stmt = read_statement(state, data)
+ File "/nativeparse.py", line 318, in read_statement
+ rvalue = read_expression(state, data)
+ File "/nativeparse.py", line 1351, in read_expression
+ se.has_surrogates = read_bool(data)
+ ~~~~~~~~~^^^^^^
+ ValueError: invalid bool value
+
nox (https://github.com/wntrblm/nox)
- nox/virtualenv.py:52: error: Cannot find implementation or library stub for module named "python_discovery" [import-not-found]
- nox/virtualenv.py:147: error: Cannot find implementation or library stub for module named "platformdirs" [import-not-found]
- nox/virtualenv.py:367: error: Cannot find implementation or library stub for module named "pbs_installer" [import-not-found]
- nox/_cli.py:195: error: Cannot find implementation or library stub for module named "python_discovery" [import-not-found]
- nox/_cli.py:195: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
+ nox/__init__.py: error: INTERNAL ERROR -- Please try using mypy master on GitHub:
+ https://mypy.readthedocs.io/en/stable/common_issues.html#using-a-development-mypy-build
+ Please report a bug at https://github.com/python/mypy/issues
+ version: 2.4.0+dev.4afbdec6456574fcc4f3ec75245d870c9f8dfcf3
+ nox/__init__.py: note: use --pdb to drop into pdb
+ Traceback (most recent call last):
+ File "", line 6, in <module>
+ sys.exit(console_entry())
+ File "/__main__.py", line 16, in console_entry
+ main()
+ File "/main.py", line 154, in main
+ res, messages, blockers = run_build(sources, options, fscache, t0, stdout, stderr)
+ File "/main.py", line 244, in run_build
+ res = build.build(sources, options, None, flush_errors, fscache, stdout, stderr)
+ File "/build.py", line 422, in build
+ result = build_inner(
+ File "/build.py", line 537, in build_inner
+ graph = dispatch(sources, manager, stdout, connect_threads)
+ File "/build.py", line 4078, in dispatch
+ graph = load_graph(sources, manager)
+ File "/build.py", line 4311, in load_graph
+ manager.parse_all([state for state in new if state.needs_parse])
+ File "/build.py", line 1054, in parse_all
+ with state.wrap_context():
+ File "/opt/hostedtoolcache/Python/3.14.7/x64/lib/python3.14/contextlib.py", line 162, in __exit__
+ self.gen.throw(value)
+ File "/build.py", line 3075, in wrap_context
+ yield
+ File "/build.py", line 1063, in parse_all
+ state.tree = load_from_raw(
+ ~~~~~~~~~~~~~^
+ state.xpath,
+ ^^^^^^^^^^^^
+ ...<4 lines>...
+ imports_only=bool(self.workers),
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ )
+ ^
+ File "/parse.py", line 80, in load_from_raw
+ defs = read_statements(state, data, n)
+ File "/nativeparse.py", line 269, in read_statements
+ stmt = read_statement(state, data)
+ File "/nativeparse.py", line 318, in read_statement
+ rvalue = read_expression(state, data)
+ File "/nativeparse.py", line 1506, in read_expression
+ items = read_expression_list(state, data)
+ File "/nativeparse.py", line 1761, in read_expression_list
+ return [read_expression(state, data) for i in range(n)]
+ ~~~~~~~~~~~~~~~^^^^^^^^^^^^^
+ File "/nativeparse.py", line 1351, in read_expression
+ se.has_surrogates = read_bool(data)
+ ~~~~~~~~~^^^^^^
+ ValueError: invalid bool value
+
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is expected to fail until mypyc/ast_serialize#82 is merged and released.
cc @JukkaL