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 unexpected-keyword-arg (E1123) #9922

Open
Gollam opened this issue Sep 10, 2024 · 3 comments
Open

False positive unexpected-keyword-arg (E1123) #9922

Gollam opened this issue Sep 10, 2024 · 3 comments
Labels
Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling

Comments

@Gollam
Copy link

Gollam commented Sep 10, 2024

Bug description

# pylint: disable=missing-module-docstring
from pyroute2 import IPRoute

a = IPRoute()
b = a.get_addr(index=0)

Configuration

No response

Command used

pylint a.py

Pylint output

************* Module a
a.py:5:4: E1123: Unexpected keyword argument 'index' in method call (unexpected-keyword-arg)

-----------------------------------
Your code has been rated at 0.00/10

Expected behavior

I checked pyroute2 source code, and the get_addr function has a **kwarg parameter: https://github.com/svinota/pyroute2/blob/01f92c84977c20f591cfa02452ff588ad0cc73d5/pyroute2/iproute/linux.py#L538

So it accepts 'index' (and the function works correctly, it filters by index), so that's why I think this is a false positive.

Pylint version

pylint 3.2.7
astroid 3.2.4
Python 3.10.12 (main, Jul 29 2024, 16:56:48) [GCC 11.4.0]

OS / Environment

Ubuntu 22.04.4 LTS

Additional dependencies

pyroute2==0.7.12
@Gollam Gollam added the Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling label Sep 10, 2024
@akamat10
Copy link
Contributor

I wonder if it has to do with the fact that there are four flavors of IPRoute and one of the flavors (IPMock one) doesn't accept kwarg. The different flavors are picked based on the sys.platform output here.

@Gollam
Copy link
Author

Gollam commented Sep 20, 2024

@akamat10 good catch! If I have time, I'll try to put an extra kwarg there, to verify. In that case, this is not a pylint bug, right?

@akamat10
Copy link
Contributor

Right. This wouldn't be a bug in that case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling
Projects
None yet
Development

No branches or pull requests

2 participants