What's new in Pylint 4.0.9?
Release date: 2026-09-23
Security Fixes
- Someone without access to the configuration or linted code, but with access
to the cache directory (predictablePYLINT_HOMEon a multi-user host) can no
longer write a crafted pickle that will runs arbitrary code when pylint access its
stat cache. The result cache is now stored as JSON instead of pickle,
preventing code-execution. The workaround is upgrading or not pointingPYLINT_HOME
to an untrusted, shared, or group-writable directory. The default value,~/.cache/pylint,
is writable only by the user running pylint. (CVE with the same information pending)
False Positives Fixed
-
Fixed a false positive for
no-self-useon a method that only uses
selfbefore a locally defined class (or other nested method), because
the checker's could-be-a-function tracking state was not restored after
visiting the nested method.Closes #3705
-
Fix a false positive for :ref:
not-callablewhen calling functions constructed with
types.FunctionTypeortypes.LambdaType.Closes #7500
-
Fix a false positive for
unnecessary-direct-lambda-callwhen a directly called
lambda in a class body wraps a comprehension containing an assignment expression.
PEP 572 makes that aSyntaxErrorwithout the lambda's scope, so following the
message produced code that would not compile.Closes #9294
-
Fix a false positive for :ref:
unnecessary-ellipsiswhen an ellipsis is the
sole body statement of a method defined on aProtocol.Closes #9319
-
Fix a false positive for :ref:
bad-exception-causewhen the bases of the class
being raised from cannot be inferred, such as an exception deriving from a
C extension class. :ref:raising-non-exceptionand
:ref:catching-non-exceptionalready guard the sameinherit_from_std_ex
helper withhas_known_bases.Refs #11399
False Negatives Fixed
-
method-hiddenis no longer silenced when the hidden method shares its name with
a builtin function or with a function defined at module level. Only members of the
ancestor classes themselves can excuse the method now.Refs #11361
Other Bug Fixes
-
Fix a block-scoped
# pylint: disable=directive placed inside anif
body leaking into siblingelif/elseblocks for messages such as
stop-iteration-return, which default to a line-based (rather than
node-based) message scope.Closes #3136
-
Fix a false positive for
declare-non-slotwhen a class variable is
annotated withClassVarwithout an initial value.Closes #9950
-
Fix a crash in the
no-memberchecker when attribute lookup raises an
InferenceError.Closes #11356
-
Fix a crash in the
unnecessary-default-type-argscheck when aGenerator
orAsyncGeneratorsubscript holds an empty tuple, such asGenerator[()].Closes #11357
-
Fix a crash in
method-hiddenwhen a method shadows a name thatbuiltins
binds to a node without a statement, such ashelporlicense. Every class
inherits fromobject, which lives in thebuiltinsmodule, so no base class
was needed to trigger it.