[tahoe-lafs-trac-stream] [tahoe-lafs] #1555: add check-miscaptures.py script to check for incorrect variable captures in for loops
tahoe-lafs
trac at tahoe-lafs.org
Thu Oct 6 19:10:00 PDT 2011
#1555: add check-miscaptures.py script to check for incorrect variable captures in
for loops
-------------------------------------+--------------------------
Reporter: davidsarah | Owner: somebody
Type: defect | Status: new
Priority: major | Milestone: 1.10.0
Component: code | Version: 1.9.0a2
Keywords: miscapture coding_tools | Launchpad Bug:
-------------------------------------+--------------------------
The attached script checks for errors in which a variable declared in a
{{{for}}} loop is captured by a lambda or function definition. If the
lambda/function is executed after the loop iteration in which it was
created, it will refer to some later value of the variable, which is
usually not what was intended.
The script currently produces false positives if a variable is declared
and used in the same lambda/function within a for loop (i.e. it is not
captured). I don't intend to fix that until after the Tahoe summit in
November, probably. However, it produces relatively few false positives
already, and found some genuine bugs (see next ticket).
--
Ticket URL: <http://tahoe-lafs.org/trac/tahoe-lafs/ticket/1555>
tahoe-lafs <http://tahoe-lafs.org>
secure decentralized storage
More information about the tahoe-lafs-trac-stream
mailing list