Skip to content

-j0 option broken in pylint 2.5.0 - ImportError: Unable to find module .... in sys.path #3543

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

Closed
crisbal opened this issue Apr 29, 2020 · 1 comment

Comments

@crisbal
Copy link

crisbal commented Apr 29, 2020

Hello, the -j0 option is broken in pylint 2.5.0
This also breaks with any j > 1, thus when multiprocessing is enabled.

Steps to reproduce

# setup venv
cd /tmp
python -m venv venv
source venv/bin/activate
# install
pip install 'pylint==2.5.0'
# create some files
mkdir package
touch package/__init__.py
touch package/file.py
mkdir package/subpackage
touch package/subpackage/__init__.py

Current behavior

pylint --version
# pylint 2.5.0
# astroid 2.4.0
pylint -j0 ./package

Outputs the following:

Traceback (most recent call last):
  File "/tmp/venv/bin/pylint", line 10, in <module>
    sys.exit(run_pylint())
  File "/tmp/venv/lib/python3.8/site-packages/pylint/__init__.py", line 22, in run_pylint
    PylintRun(sys.argv[1:])
  File "/tmp/venv/lib/python3.8/site-packages/pylint/lint/run.py", line 338, in __init__
    linter.check(args)
  File "/tmp/venv/lib/python3.8/site-packages/pylint/lint/pylinter.py", line 874, in check
    check_parallel(
  File "/tmp/venv/lib/python3.8/site-packages/pylint/lint/check_parallel.py", line 100, in check_parallel
    for module, messages, stats, msg_status in pool.imap_unordered(
  File "/usr/lib/python3.8/multiprocessing/pool.py", line 865, in next
    raise value
ImportError: Unable to find module for package/file.py in /tmp/venv/bin, 
/usr/lib/python38.zip, 
/usr/lib/python3.8, 
/usr/lib/python3.8/lib-dynload, 
/tmp/venv/lib/python3.8/site-packages, 
/tmp/venv/lib/python3.8/site-packages/astroid/brain

Running:

pylint  ./package
# no output, it works

Expected behavior

In version pylint-2.4.4/astroid-2.3.3 it was working fine.

pip install 'pylint==2.4.4'
pylint --version
# pylint 2.4.4
# astroid 2.3.3
pylint -j0 ./package
# no output, it works

pylint --version output

pylint 2.5.0
astroid 2.4.0
Python 3.8.2 (default, Apr  8 2020, 14:31:25) 
[GCC 9.3.0]
@crisbal crisbal changed the title -j0 option broken in pylint 2.5.0 -j0 option broken in pylint 2.5.0 - ImportError: Unable to find module .... in sys.path Apr 29, 2020
@crisbal
Copy link
Author

crisbal commented Apr 29, 2020

Duplicate of #3524

@crisbal crisbal closed this as completed Apr 29, 2020
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