[Piuparts-devel] Bug#523950: Patch + Additional Warnings

Scott Schaefer saschaefer at neurodiverse.org
Thu Jun 2 09:07:52 UTC 2011


pychecker reports cases where a variable is declared with name identical
to a builtin. It will report: (varname) shadows builtin.

I have attached patches for all programs affected.

They should apply cleanly against svn r889.

In nearly all cases, I simply prepended varname with single char ('v',
'r', 's').

I cobbled together a quick-and-dirty regression test, and executed with
both SVN rev and patches applied.  However, I don't know enough about
piuparts yet to be entirely confident that I know HOW to adequately test
it.  If you have a regression test suite that I could execute locally, I
will try to do so.

My Python skills are not exactly top-notch ...  If anyone has input (or
a patch) concerning the remaining items reported by pychecker below, I
would appreciate it.

Executing:
pychecker --limit 5000 ./piupartslib/dependencyparser.py>   chk.out
pychecker --limit 5000 ./piupartslib/__init__.py>>   chk.out
pychecker --limit 5000 ./piupartslib/packagesdb.py>>   chk.out
pychecker --limit 5000 ./piupartslib/conf.py>>   chk.out
pychecker --limit 5000 ./piuparts-analyze.py>>   chk.out
pychecker --limit 5000 ./piuparts-slave.py>>   chk.out
pychecker --limit 5000 ./piuparts-master.py>>   chk.out
pychecker --limit 5000 ./piuparts-report.py>>   chk.out
pychecker --limit 5000 ./unittests.py>>   chk.out
pychecker --limit 5000 ./piuparts.py>>   chk.out

cat chk.out

Warnings...

piupartslib/__init__.py:23: Imported module (conf) not used
piupartslib/__init__.py:24: Imported module (dependencyparser) not used
piupartslib/__init__.py:25: Imported module (packagesdb) not used

Warnings...

piupartslib/packagesdb.py:62: (u) cannot be used after being deleted on
line 60
piupartslib/packagesdb.py:71: (t) cannot be used after being deleted on
line 68
piupartslib/packagesdb.py:74: (t) cannot be used after being deleted on
line 68
piupartslib/packagesdb.py:75: (t) cannot be used after being deleted on
line 68
piupartslib/packagesdb.py:78: (t) cannot be used after being deleted on
line 68
piupartslib/packagesdb.py:205: Local variable (detail) not used

Warnings...

piuparts-analyze.py:34: Imported module (sys) not used
piuparts-analyze.py:135: Using the return value from (find_logs) which
is always None
piuparts-analyze.py:147: Using the return value from (find_bugged_logs)
which is always None

Warnings...

piuparts-slave.py:31: Imported module (urllib) not used
piuparts-slave.py:59: Base class (piupartslib.conf.Config) __init__()
not called

Warnings...

piuparts-master.py:28: Imported module (urllib) not used
piuparts-master.py:31: Imported module (tempfile) not used
piuparts-master.py:52: Base class (piupartslib.conf.Config) __init__()
not called
piuparts-master.py:131: Using method (_untestable) as an attribute (not
invoked)

Warnings...

piuparts-report.py:32: Imported module (urllib) not used
piuparts-report.py:394: Base class (piupartslib.conf.Config) __init__()
not called
piuparts-report.py:876: No global (r) found
piuparts-report.py:1036: Format string argument count (1) doesn't match
arguments (2)

Warnings...

unittests.py:69: Parameter (mode) not used

Warnings...

piuparts.py:40: Imported module (commands) not used
piuparts.py:44: Imported module (tarfile) not used
piuparts.py:121: Function return types are inconsistent
piuparts.py:304: Parameter (datefmt) not used
piuparts.py:304: Parameter (record) not used
piuparts.py:1153: Base class (piuparts.Chroot) __init__() not called
piuparts.py:1300: Parameter (data) not used
piuparts.py:1338: Invalid arguments to (_fail), got 2, expected 1
piuparts.py:1487: Setting meta_infos to itself has no effect
piuparts.py:1890: Parameter (args) not used
piuparts.py:1890: Parameter (kwargs) not used
piuparts.py:1890: Parameter (opt) not used
piuparts.py:1890: Parameter (option) not used
piuparts.py:1890: Parameter (value) not used
piuparts.py:1898: Parameter (args) not used
piuparts.py:1898: Parameter (kwargs) not used
piuparts.py:1898: Parameter (opt) not used
piuparts.py:1898: Parameter (option) not used
piuparts.py:1898: Parameter (value) not used
piuparts.py:1901: Function (parse_command_line) has too many lines (288)



-------------- next part --------------
A non-text attachment was scrubbed...
Name: diff.lib.dependencyparser.py
Type: text/x-python
Size: 1910 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/piuparts-devel/attachments/20110602/2b22eaa9/attachment-0007.py>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: diff.lib.__init__.py
Type: text/x-python
Size: 612 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/piuparts-devel/attachments/20110602/2b22eaa9/attachment-0008.py>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: diff.lib.packagesdb.py
Type: text/x-python
Size: 2712 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/piuparts-devel/attachments/20110602/2b22eaa9/attachment-0009.py>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: diff.piuparts.py
Type: text/x-python
Size: 15404 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/piuparts-devel/attachments/20110602/2b22eaa9/attachment-0010.py>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: diff.piuparts-report.py
Type: text/x-python
Size: 7363 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/piuparts-devel/attachments/20110602/2b22eaa9/attachment-0011.py>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: diff.piuparts-slave.py
Type: text/x-python
Size: 2284 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/piuparts-devel/attachments/20110602/2b22eaa9/attachment-0012.py>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: diff.unittests.py
Type: text/x-python
Size: 977 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/piuparts-devel/attachments/20110602/2b22eaa9/attachment-0013.py>


More information about the Piuparts-devel mailing list