Skip to content

get_argument_from_call doesn't account for **kwargs #7761

@jacobtylerwalls

Description

@jacobtylerwalls

Bug description

get_argument_from_call doesn't account for keyword arguments provided by unpacked kwargs. This is causing both false positives and false negatives

False negative

kw={'mode': 'garbage'}
open(fp, **kw)

False positive

kw={'maxsplit', 1}
'asdf'.split('s', **kw)[-1]

Configuration

No response

Command used

pylint c.py

Pylint output

first example: nothing

Expected behavior

first example: Expected a warning for bad-open-mode

Pylint version

pylint 2.16.0-dev
astroid 2.13.0-dev0
Python 3.11.0 (v3.11.0:deaf509e8f, Oct 24 2022, 14:43:23) [Clang 13.0.0 (clang-1300.0.29.30)]

OS / Environment

No response

Additional dependencies

No response

Metadata

Metadata

Labels

False Negative 🦋No message is emitted but something is wrong with the codeNeeds PRThis issue is accepted, sufficiently specified and now needs an implementation

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions