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

False positive in 2.7.0: kazoo unpacking-non-sequence #4137

Open
PereBal opened this issue Feb 23, 2021 · 0 comments
Open

False positive in 2.7.0: kazoo unpacking-non-sequence #4137

PereBal opened this issue Feb 23, 2021 · 0 comments
Labels
False Positive 🦟 A message is emitted but nothing is wrong with the code Lib specific 💅 This affect the code from a particular library Needs investigation 🔬 A bug or crash where it's not immediately obvious what is happenning Regression

Comments

@PereBal
Copy link

PereBal commented Feb 23, 2021

Steps to reproduce

  1. Create the following files:

pt1.py

"Something"
from kazoo.client import KazooClient

KAZOO_CLIENT = None

def init_kazoo_client() -> KazooClient:
    "initialize"
    global KAZOO_CLIENT  # pylint: disable=global-statement
    KAZOO_CLIENT = KazooClient()
    KAZOO_CLIENT.start()
    return KAZOO_CLIENT

def get_kazoo_client() -> KazooClient:
    "get client"
    global KAZOO_CLIENT  # pylint: disable=global-statement
    assert KAZOO_CLIENT is not None, "Uh oh"
    return KAZOO_CLIENT

pt.py

"Something"
import pt1

pt1.init_kazoo_client()

ZKCONN: pt1.KazooClient = pt1.get_kazoo_client()
DATA, STAT = ZKCONN.get("/bogus-path")
  1. Run pylint pt1.py pt.py

Current behavior

Pylint errors out with

************* Module pt
pt.py:7:0: E0633: Attempting to unpack a non-sequence defined at line 28 of kazoo.handlers.utils (unpacking-non-sequence)

Expected behavior

Pylint does not error out as it was doing before v2.7.0 . kazoo.client.KazooClient.get should return a tuple or raise an exception as per their docs

pylint --version output

$ pylint --version
pylint 2.7.0
astroid 2.5
Python 3.7.9 (default, Nov 18 2020, 14:10:47) 
[GCC 8.3.0]
@PereBal PereBal changed the title False positive unpacking-non-sequence in 2.7.0 False positive in 2.7.0: kazoo unpacking-non-sequence Feb 23, 2021
@Pierre-Sassoulas Pierre-Sassoulas added False Positive 🦟 A message is emitted but nothing is wrong with the code Regression labels Feb 23, 2021
@Pierre-Sassoulas Pierre-Sassoulas added Needs investigation 🔬 A bug or crash where it's not immediately obvious what is happenning Lib specific 💅 This affect the code from a particular library labels Jul 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
False Positive 🦟 A message is emitted but nothing is wrong with the code Lib specific 💅 This affect the code from a particular library Needs investigation 🔬 A bug or crash where it's not immediately obvious what is happenning Regression
Projects
None yet
Development

No branches or pull requests

2 participants