Bug 2323166
Summary: | python-astroid fails to build with Python 3.14: astroid.exceptions.InferenceError: StopIteration raised without any error information. | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Karolina Surma <ksurma> |
Component: | python-astroid | Assignee: | Gwyn Ciesla <gwync> |
Status: | CLOSED RAWHIDE | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | rawhide | CC: | gwync, ksurma, mhroncok, orion |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | If docs needed, set a value | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2025-06-15 18:30:32 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: | |||
Bug Depends On: | |||
Bug Blocks: | 2322407 |
Description
Karolina Surma
2024-11-01 14:49:12 UTC
I know upstream is not interested in alpha releases, but noting three new failures with Python 3.14.0a5 related to Path objects: =================================== FAILURES =================================== ____________________________ test_inference_parents ____________________________ def test_inference_parents() -> None: """Test inference of ``pathlib.Path.parents``.""" name_node = astroid.extract_node( """ from pathlib import Path current_path = Path().resolve() path_parents = current_path.parents path_parents """ ) inferred = name_node.inferred() assert len(inferred) == 1 > assert isinstance(inferred[0], bases.Instance) E AssertionError: assert False E + where False = isinstance(Uninferable, <class 'astroid.bases.Instance'>) E + where <class 'astroid.bases.Instance'> = bases.Instance tests/brain/test_pathlib.py:25: AssertionError ____________________ test_inference_parents_subscript_index ____________________ def test_inference_parents_subscript_index() -> None: """Test inference of ``pathlib.Path.parents``, accessed by index.""" path = astroid.extract_node( """ from pathlib import Path current_path = Path().resolve() current_path.parents[2] #@ """ ) inferred = path.inferred() assert len(inferred) == 1 > assert isinstance(inferred[0], bases.Instance) E AssertionError: assert False E + where False = isinstance(Uninferable, <class 'astroid.bases.Instance'>) E + where <class 'astroid.bases.Instance'> = bases.Instance tests/brain/test_pathlib.py:45: AssertionError ____________________ test_inference_parents_subscript_slice ____________________ def test_inference_parents_subscript_slice() -> None: """Test inference of ``pathlib.Path.parents``, accessed by slice.""" name_node = astroid.extract_node( """ from pathlib import Path current_path = Path().resolve() parent_path = current_path.parents[:2] parent_path """ ) inferred = name_node.inferred() assert len(inferred) == 1 if PY310_PLUS: > assert isinstance(inferred[0], bases.Instance) E AssertionError: assert False E + where False = isinstance(Uninferable, <class 'astroid.bases.Instance'>) E + where <class 'astroid.bases.Instance'> = bases.Instance tests/brain/test_pathlib.py:66: AssertionError This bug appears to have been reported against 'rawhide' during the Fedora Linux 42 development cycle. Changing version to 42. With b1 there is 185 failures with _____________________ ClassNodeTest.test_without_docstring _____________________ self = <astroid.builder.AstroidBuilder object at 0x7fece59dc360> data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' modname = 'data.module' path = '/builddir/build/BUILD/python-astroid-3.3.8-build/astroid-3.3.8/tests/testdata/python3/data/module.py' def _data_build( self, data: str, modname: str, path: str | None ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: """Build tree node from data and add some informations.""" try: > node, parser_module = _parse_string( data, type_comments=True, modname=modname ) astroid/builder.py:181: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ astroid/builder.py:477: in _parse_string parsed = parser_module.parse( astroid/_ast.py:29: in parse return ast.parse(string, filename=filename, type_comments=type_comments) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' filename = 'data.module', mode = 'exec' def parse(source, filename='<unknown>', mode='exec', *, type_comments=False, feature_version=None, optimize=-1): """ Parse the source into an AST node. Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). Pass type_comments=True to get back type comments where the syntax allows. """ flags = PyCF_ONLY_AST if optimize > 0: flags |= PyCF_OPTIMIZED_AST if type_comments: flags |= PyCF_TYPE_COMMENTS if feature_version is None: feature_version = -1 elif isinstance(feature_version, tuple): major, minor = feature_version # Should be a 2-tuple. if major != 3: raise ValueError(f"Unsupported major version: {major}") feature_version = minor # Else it should be an int giving the minor version for 3.x. > return compile(source, filename, mode, flags, _feature_version=feature_version, optimize=optimize) E File "data.module", line 62 E SyntaxError: 'return' in a 'finally' block /usr/lib64/python3.14/ast.py:46: SyntaxError The above exception was the direct cause of the following exception: self = <tests.test_scoped_nodes.ClassNodeTest testMethod=test_without_docstring> def setUp(self) -> None: super().setUp() > self.module = resources.build_file("data/module.py", "data.module") tests/test_scoped_nodes.py:73: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/resources.py:23: in build_file return builder.AstroidBuilder().file_build(find(path), modname) astroid/builder.py:144: in file_build module, builder = self._data_build(data, modname, path) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <astroid.builder.AstroidBuilder object at 0x7fece59dc360> data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' modname = 'data.module' path = '/builddir/build/BUILD/python-astroid-3.3.8-build/astroid-3.3.8/tests/testdata/python3/data/module.py' def _data_build( self, data: str, modname: str, path: str | None ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: """Build tree node from data and add some informations.""" try: node, parser_module = _parse_string( data, type_comments=True, modname=modname ) except (TypeError, ValueError, SyntaxError) as exc: > raise AstroidSyntaxError( "Parsing Python code failed:\n{error}", source=data, modname=modname, path=path, error=exc, ) from exc E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: E 'return' in a 'finally' block (data.module, line 62) |