Skip to content

pylint incorrectly warns about multiprocessing.Manager.Lock #3313

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
tedivm opened this issue Dec 18, 2019 · 2 comments · Fixed by pylint-dev/astroid#1976
Closed

pylint incorrectly warns about multiprocessing.Manager.Lock #3313

tedivm opened this issue Dec 18, 2019 · 2 comments · Fixed by pylint-dev/astroid#1976
Labels
Bug 🪲 False Positive 🦟 A message is emitted but nothing is wrong with the code Needs astroid Brain 🧠 Needs a brain tip in astroid (then an astroid upgrade)

Comments

@tedivm
Copy link

tedivm commented Dec 18, 2019

Steps to reproduce

pylint this file:

from multiprocessing import Manager

with Manager() as m:
    m.Lock()

Current behavior

testing.py:4: [E1101(no-member), ] Instance of 'SyncManager' has no 'Lock' member; maybe 'RLock'?

Expected behavior

It shouldn't give an error.

pylint --version output

pylint --version
pylint 2.4.4
astroid 2.3.3
Python 3.7.4 (default, Jul  9 2019, 18:15:00)
[Clang 10.0.0 (clang-1000.11.45.5)]
@AWhetter AWhetter added Needs astroid Brain 🧠 Needs a brain tip in astroid (then an astroid upgrade) Bug 🪲 labels Dec 31, 2019
@AWhetter
Copy link
Contributor

Most of the attributes on a SyncManager are added via a register() method (https://github.com/python/cpython/blob/v3.8.0/Lib/multiprocessing/managers.py#L1222-L1241). We'll have to add something to the astroid brain to make it understand these.

@michaelfortunato
Copy link

Hi, I am another user and still receiving these errors

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug 🪲 False Positive 🦟 A message is emitted but nothing is wrong with the code Needs astroid Brain 🧠 Needs a brain tip in astroid (then an astroid upgrade)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants