[code-quality] false positive undefined-variable

Claudiu Popa pcmanticore at gmail.com
Thu Oct 8 21:16:21 CEST 2015


On Thu, Oct 8, 2015 at 6:45 PM, Tom Ekberg <tekberg at uw.edu> wrote:
> Here is my 9 line python program:
>
> """
> Nothing to see here
> """
>
> def is_priority(row):
>     """
>     Priority tests
>     """
>     print row
>
> Here is the command line output, sans reports:
>
> $ pylint --report=n foobarbaz.py
> No config file found, using default configuration
> ************* Module hud.monitors.foobarbaz
> E:  9,10: Undefined variable 'row' (undefined-variable)
>
> Why is row undefined if it is a function parameter? I realize I can turn it off with a configuration file, but this is such a simple case. I must be doing something wrong to get this error.
>
> Because I'm sure you will ask, here is the pylint version detail:
>
> $ pylint --version
> No config file found, using default configuration
> pylint 1.4.4,
> astroid 1.4.0, common 1.0.2
> Python 2.7.3 (default, Feb 27 2014, 19:58:35)
> [GCC 4.6.3]
>
> Running Ubuntu 12.04.4 LTS.
>
> Tom Ekberg
> Senior Computer Specialist, Lab Medicine
> University of Washington Medical Center
> 1959 NE Pacific St, MS 357110
> Seattle WA 98195
> work: (206) 598-8544
> email: tekberg at uw.edu
>
>
> _______________________________________________
> code-quality mailing list
> code-quality at python.org
> https://mail.python.org/mailman/listinfo/code-quality


Hi,

I can't reproduce the issue. Are you sure this is the code
that triggers the problem? You could also check if this
happens again using the code from the repository.
I doubt it though, code such as this could trigger tons
of failures in our CI, so there must be something wrong
with the given sample code.


/Claudiu


More information about the code-quality mailing list