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

Cannot run pylint with multiple processes (Termux) #5216

Closed
harshil21 opened this issue Oct 26, 2021 · 1 comment · Fixed by #5238
Closed

Cannot run pylint with multiple processes (Termux) #5216

harshil21 opened this issue Oct 26, 2021 · 1 comment · Fixed by #5238
Labels
Bug 🪲 Crash 💥 A bug that makes pylint crash

Comments

@harshil21
Copy link
Contributor

harshil21 commented Oct 26, 2021

Bug description

I cannot run pylint with the argument -j 0 since my platform (Android - Termux) says that it cannot import SemLock.

Configuration

No response

Command used

pylint test.py -j 0

Pylint output

Traceback (most recent call last):
  File "/data/data/com.termux/files/usr/lib/python3.9/multiprocessing/synchronize.py", line 28, in <module>
    from _multiprocessing import SemLock, sem_unlink
ImportError: cannot import name 'SemLock' from '_multiprocessing' (/data/data/com.termux/files/usr/lib/python3.9/lib-dynload/_multiprocessing.cpython-39.so)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/data/data/com.termux/files/usr/bin/pylint", line 8, in <module>
    sys.exit(run_pylint())
  File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/pylint/__init__.py", line 24, in run_pylint
    PylintRun(sys.argv[1:])
  File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/pylint/lint/run.py", line 374, in init
    linter.check(args)
  File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/pylint/lint/pylinter.py", line 974, in check
    check_parallel(
  File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/pylint/lint/parallel.py", line 132, in check_parallel
    pool = multiprocessing.Pool(  # pylint: disable=consider-using-with
  File "/data/data/com.termux/files/usr/lib/python3.9/multiprocessing/context.py", line 119, in Pool
    return Pool(processes, initializer, initargs, maxtasksperchild,
  File "/data/data/com.termux/files/usr/lib/python3.9/multiprocessing/pool.py", line 191, in init
    self._setup_queues()
  File "/data/data/com.termux/files/usr/lib/python3.9/multiprocessing/pool.py", line 343, in _setup_queues
    self._inqueue = self._ctx.SimpleQueue()
  File "/data/data/com.termux/files/usr/lib/python3.9/multiprocessing/context.py", line 113, in SimpleQueue
    return SimpleQueue(ctx=self.get_context())
  File "/data/data/com.termux/files/usr/lib/python3.9/multiprocessing/queues.py", line 342, in init
    self._rlock = ctx.Lock()
  File "/data/data/com.termux/files/usr/lib/python3.9/multiprocessing/context.py", line 67, in Lock
    from .synchronize import Lock
  File "/data/data/com.termux/files/usr/lib/python3.9/multiprocessing/synchronize.py", line 30, in <module>
    raise ImportError("This platform lacks a functioning sem_open" +
ImportError: This platform lacks a functioning sem_open implementation, therefore, the required synchronization primitives needed will not function, see issue 3770.

Expected behavior

Pylint should gracefully ignore the -j option if there is an error importing the above.

Pylint version

pylint 2.11.1
astroid 2.8.4
Python 3.9.6 (default, Aug  1 2021, 15:58:14)
[Clang 9.0.8 (https://android.googlesource.com/toolchain/llvm-project 98c855489

OS / Environment

Android 10, Termux

Additional dependencies

No response

@harshil21 harshil21 added Bug 🪲 Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling labels Oct 26, 2021
@Pierre-Sassoulas Pierre-Sassoulas added Crash 💥 A bug that makes pylint crash and removed Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling labels Oct 26, 2021
@Pierre-Sassoulas
Copy link
Member

Thank you for opening the issue, indeed you're right.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug 🪲 Crash 💥 A bug that makes pylint crash
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants