Skip to content

Dict unpacking within a context manager triggers missing-kwoa #8100

Closed
@pR0Ps

Description

@pR0Ps

Bug description

Reproduction:

import contextlib

@contextlib.contextmanager
def f(*, a):
    yield
    
def g(**kw):
    f(**kw)  # doesn't trigger missing-kwoa
    with f(**kw):  # triggers missing-kwoa
        pass
        
g(a=1)

Seems related to #1111

Configuration

No response

Command used

pylint repro.py

Pylint output

$ pylint repro.py
************* Module repro
repro.py:6:0: C0303: Trailing whitespace (trailing-whitespace)
repro.py:11:0: C0303: Trailing whitespace (trailing-whitespace)
repro.py:1:0: C0114: Missing module docstring (missing-module-docstring)
repro.py:4:0: C0116: Missing function or method docstring (missing-function-docstring)
repro.py:4:0: C0103: Function name "f" doesn't conform to snake_case naming style (invalid-name)
repro.py:4:9: W0613: Unused argument 'a' (unused-argument)
repro.py:7:0: C0116: Missing function or method docstring (missing-function-docstring)
repro.py:7:0: C0103: Function name "g" doesn't conform to snake_case naming style (invalid-name)
repro.py:9:9: E1125: Missing mandatory keyword argument 'a' in function call (missing-kwoa)

------------------------------------------------------------------
Your code has been rated at 0.00/10 (previous run: 0.00/10, +0.00)

Expected behavior

missing-kwoa shouldn't be triggered

Pylint version

pylint 2.15.10
astroid 2.13.3
Python 3.10.9 (tags/v3.10.9:1dd9be6, Dec  6 2022, 20:01:21) [MSC v.1934 64 bit (AMD64)]

OS / Environment

No response

Additional dependencies

No response

Metadata

Metadata

Assignees

Labels

False Positive 🦟A message is emitted but nothing 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