Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash Building error when trying to create ast representation of module 'multiprocessing.process' #10014

Open
acidghost opened this issue Oct 9, 2024 · 0 comments

Comments

@acidghost
Copy link

Bug description

How to reproduce:

  • create a venv and install 'pylint==3.3.1'
  • create a folder named multiprocessing
  • create file multiprocessing/__init__.py
  • create file multiprocessing/process.py with contents import multiprocessing
  • inside the venv, inside the multiprocessing folder, run pylint .

Pylint output

Traceback (most recent call last):
  File "/Users/xxxxxx/.local/share/virtualenvs/multiprocessing-15V88n9e/lib/python3.12/site-packages/pylint/lint/pylinter.py", line 976, in get_ast
    return MANAGER.ast_from_file(filepath, modname, source=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/xxxxxx/.local/share/virtualenvs/multiprocessing-15V88n9e/lib/python3.12/site-packages/astroid/manager.py", line 166, in ast_from_file
    return AstroidBuilder(self).file_build(filepath, modname)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/xxxxxx/.local/share/virtualenvs/multiprocessing-15V88n9e/lib/python3.12/site-packages/astroid/builder.py", line 145, in file_build
    return self._post_build(module, builder, encoding)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/xxxxxx/.local/share/virtualenvs/multiprocessing-15V88n9e/lib/python3.12/site-packages/astroid/builder.py", line 173, in _post_build
    module = self._manager.visit_transforms(module)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/xxxxxx/.local/share/virtualenvs/multiprocessing-15V88n9e/lib/python3.12/site-packages/astroid/manager.py", line 127, in visit_transforms
    return self._transform.visit(node)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/xxxxxx/.local/share/virtualenvs/multiprocessing-15V88n9e/lib/python3.12/site-packages/astroid/transforms.py", line 158, in visit
    return self._visit(node)
           ^^^^^^^^^^^^^^^^^
  File "/Users/xxxxxx/.local/share/virtualenvs/multiprocessing-15V88n9e/lib/python3.12/site-packages/astroid/transforms.py", line 85, in _visit
    return self._transform(node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/xxxxxx/.local/share/virtualenvs/multiprocessing-15V88n9e/lib/python3.12/site-packages/astroid/transforms.py", line 67, in _transform
    ret = transform_func(node)
          ^^^^^^^^^^^^^^^^^^^^
  File "/Users/xxxxxx/.local/share/virtualenvs/multiprocessing-15V88n9e/lib/python3.12/site-packages/astroid/brain/helpers.py", line 17, in transform
    extension_module = get_extension_mod()
                       ^^^^^^^^^^^^^^^^^^^
  File "/Users/xxxxxx/.local/share/virtualenvs/multiprocessing-15V88n9e/lib/python3.12/site-packages/astroid/brain/brain_multiprocessing.py", line 38, in _multiprocessing_transform
    for key, value in node.locals.items():
                      ^^^^^^^^^^^^^^^^^^^
TypeError: 'UninferableBase' object is not iterable
************* Module multiprocessing
__init__.py:1:0: F0002: __init__.py: Fatal error while checking '__init__.py'. Please open an issue in our bug tracker so we address this. There is a pre-filled template that you can use in '/Users/xxxxxx/Library/Caches/pylint/pylint-crash-2024-10-09-14-12-48.txt'. (astroid-error)
************* Module multiprocessing.process
process.py:4:0: W0611: Unused import multiprocessing (unused-import)

------------------------------------------------------------------
Your code has been rated at 0.00/10 (previous run: 0.00/10, +0.00)

Expected behavior

No crash.

Pylint version

pylint 3.3.1
astroid 3.3.5
Python 3.12.6 (main, Sep 19 2024, 18:42:10) [Clang 15.0.0 (clang-1500.3.9.4)]

OS / Environment

darwin (Darwin)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant