Skip to content

sys.argv is inferred wrongly as pylint's own values for sys.argv instead of Uninferrable #7710

@MarcoGorelli

Description

@MarcoGorelli

Bug description

Make file t.py

import sys

a, b, c = sys.argv

print(a, b, c)

and run python t.py 1 2

Configuration

No response

Command used

pylint t.py

Pylint output

$ pylint t.py
************* Module t
t.py:1:0: C0114: Missing module docstring (missing-module-docstring)
t.py:3:0: W0632: Possible unbalanced tuple unpacking with sequence: left side has 3 label(s), right side has 2 value(s) (unbalanced-tuple-unpacking)

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

Expected behavior

The W0632 on line 3 looks like a bug, as in this case sys.argv is ['t.py', '1', '2']

Pylint version

$ pylint --version
pylint 2.15.5
astroid 2.12.12
Python 3.10.6 | packaged by conda-forge | (main, Aug 22 2022, 20:35:26) [GCC 10.4.0]

OS / Environment

$ uname -a
Linux DESKTOP-U8OKFP3 5.10.102.1-microsoft-standard-WSL2 #1 SMP Wed Mar 2 00:30:59 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

Additional dependencies

No response

Metadata

Metadata

Labels

AstroidRelated to astroidFalse Positive 🦟A message is emitted but nothing is wrong with the codeNeeds astroid updateNeeds an astroid update (probably a release too) before being mergable

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions