pylint icon indicating copy to clipboard operation
pylint copied to clipboard

False positive E1120 for static method call on GI object in Python 3.14

Open KKoukiou opened this issue 5 months ago • 0 comments

Bug description

Pylint reports a false positive E1120: no-value-for-parameter on a valid static method call on a GI object (e.g., NM.SimpleConnection.new()) when running under Python 3.14.

This does not occur in previous Python versions (≤ 3.12 or 3.13), and seems to be a regression tied to internal changes in Python’s method binding or introspection behavior.

Minimal reproducer:


import gi
gi.require_version("NM", "1.0")
from gi.repository import NM

def _create_new_connection():
    return NM.SimpleConnection.new()

def wrapper():
    return _create_new_connection()

Our CI cought this when running it against this file: https://github.com/rhinstaller/anaconda/blob/05c12ef916065e43917b1fa0b73a9f2948aea2c3/pyanaconda/modules/network/nm_client.py

Configuration

https://github.com/rhinstaller/anaconda/blob/main/tests/pylint/pylintrc

Command used

pylint pyanaconda/modules/network/nm_client.py --disable=all --enable=E1120

Pylint output

$ pylint repro.py --disable=all --enable=E1120
repro.py:7:12: E1120: No value for argument 'self' in unbound method call (no-value-for-parameter)

Expected behavior

Pylint should not raise E1120 here, since _create_new_connection() is a plain function, not a method.

Pylint version

# pylint --version 
pylint 3.3.7
astroid 3.3.10
Python 3.14.0b2 (main, Jun  2 2025, 00:00:00) [GCC 15.1.1 20250521 (Red Hat 15.1.1-2)]

OS / Environment

Fedora

Additional dependencies


KKoukiou avatar Jun 17 '25 15:06 KKoukiou