Your message dated Sun, 26 Jun 2011 10:45:19 +0000
with message-id <[email protected]>
and subject line Bug#523950: fixed in piuparts 0.40
has caused the Debian Bug report #523950,
regarding piuparts: Piuparts uses Python built-in functions as common variables
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
523950: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=523950
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: piuparts
Version: 0.35
Severity: minor
Tags: patch

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Piuparts uses Python built-in functions names as variables. This could
lead to serious unexpected errors while trying to use this function
after it has been redefined.
I can illustrate the problem with the following examples : 

>>> list('foo')
['f', 'o', 'o']
>>> list = 0
>>> list
0
>>> list('foo')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: 'int' object is not callable
>>> 

This patch tries to clean this situation for list, dict and file
built-in functions, which should not be used as common variables.

Regards,
Carl Chenet


- -- System Information:
Debian Release: lenny/sid
  APT prefers hardy-updates
  APT policy: (500, 'hardy-updates'), (500, 'hardy-security'), (500, 'hardy')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.24-23-generic (SMP w/4 CPU cores)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFJ46Uz8lge+lYYJUgRArUhAJ9ufNxawqoHq+QZWi6TBzE7cC535gCfR8to
I0k2byUV4+L1jlhjI+JSFDc=
=rnYj
-----END PGP SIGNATURE-----
Les sous-répertoires piuparts-0.35/debian et piuparts-new/debian sont 
identiques.
Les sous-répertoires piuparts-0.35/piupartslib et piuparts-new/piupartslib sont 
identiques.
diff -u piuparts-0.35/piuparts.py piuparts-new/piuparts.py
--- piuparts-0.35/piuparts.py   2009-03-10 00:30:28.000000000 +0100
+++ piuparts-new/piuparts.py    2009-04-13 22:25:35.000000000 +0200
@@ -747,11 +747,11 @@
     def get_selections(self):
         """Get current package selections in a chroot."""
         (status, output) = self.run(["dpkg", "--get-selections", "*"])
-        list = [line.split() for line in output.split("\n") if line.strip()]
-        dict = {}
-        for name, status in list:
-            dict[name] = status
-        return dict
+        sellist = [line.split() for line in output.split("\n") if line.strip()]
+        seldict = {}
+        for name, status in sellist:
+            seldict[name] = status
+        return seldict
 
     def remove_or_purge(self, operation, packages):
         """Remove or purge packages in a chroot."""
@@ -811,7 +811,7 @@
     def save_meta_data(self):
         """Return the filesystem meta data for all objects in the chroot."""
         root = os.path.join(self.name, ".")
-        dict = {}
+        metadict = {}
         proc = os.path.join(root, "proc")
         for dirpath, dirnames, filenames in os.walk(root):
             assert dirpath[:len(root)] == root
@@ -824,8 +824,8 @@
                     target = os.readlink(name)
                 else:
                     target = None
-                dict[name[len(root):]] = (st, target)
-        return dict
+                metadict[name[len(root):]] = (st, target)
+        return metadict
 
     def relative(self, pathname):
         if pathname.startswith('/'):
@@ -835,19 +835,19 @@
     def get_files_owned_by_packages(self):
         """Return dict[filename] = [packagenamelist]."""
         dir = self.relative("var/lib/dpkg/info")
-        dict = {}
+        metadict = {}
         for basename in os.listdir(dir):
             if basename.endswith(".list"):
                 pkg = basename[:-len(".list")]
                 f = file(os.path.join(dir, basename), "r")
                 for line in f:
                     pathname = line.strip()
-                    if pathname in dict:
-                        dict[pathname].append(pkg)
+                    if pathname in metadict:
+                        metadict[pathname].append(pkg)
                     else:
-                        dict[pathname] = [pkg]
+                        metadict[pathname] = [pkg]
                 f.close()
-        return dict
+        return metadict
 
     def install_packages_by_name(self, packages):
         if packages:
@@ -931,7 +931,7 @@
         it returns the list of files. """
 
         dir = self.relative("var/lib/dpkg/info")
-        list = []
+        pathlist = []
         has_cronfiles  = False
         for p in packages:
             basename = p + ".list"
@@ -950,25 +950,25 @@
                         if (mode & stat.S_IEXEC): 
                             if not has_cronfiles:
                                 has_cronfiles = True
-                            list.append(pathname)
+                            pathlist.append(pathname)
                             logging.info("Package " + p + " contains cron 
file: " + pathname)
             f.close()
 
-        return has_cronfiles, list
+        return has_cronfiles, pathlist
 
-    def check_output_cronfiles (self, list):
+    def check_output_cronfiles (self, filelist):
         """Check if a given list of cronfiles has any output. Executes 
        cron file as cron would do (except for SHELL)"""
         failed = False
-        for file in list:
+        for cronfile in filelist:
 
-            if not os.path.exists(self.relative(file.strip("/"))):
+            if not os.path.exists(self.relative(cronfile.strip("/"))):
                 continue 
 
-            (retval, output) = self.run([file])
+            (retval, output) = self.run([cronfile])
             if output:
                 failed = True
-                logging.error("Cron file %s has output with package removed" % 
file)
+                logging.error("Cron file %s has output with package removed" % 
cronfile)
 
         if failed:
             panic()
@@ -980,9 +980,9 @@
         basepath = self.relative("tmp/scripts/")
         list_scripts = os.listdir(basepath)
         list_scripts.sort()
-        for file in list_scripts:
-            if file.startswith(step):
-                script = os.path.join("tmp/scripts", file)
+        for script in list_scripts:
+            if script.startswith(step):
+                script = os.path.join("tmp/scripts", script)
                 self.run([script]) 
 
 
@@ -1162,7 +1162,7 @@
             'p': stat.S_IFIFO,
         }
 
-        dict = {}
+        metadict = {}
 
         tf = self._execute_getoutput(['find','/','-xdev','-printf',
                 "%y %m %U %G %s %p %l \\n".replace(' ','\\0')])
@@ -1189,13 +1189,13 @@
                 st.st_mode = mode_map[splut[0]] | int(splut[1],8)
                 (st.st_uid, st.st_gid, st.st_size) = map(int, splut[2:5])
 
-                dict[splut[5]] = (st, splut[6])
+                metadict[splut[5]] = (st, splut[6])
 
             f.close()
         finally:
             os.remove(tf)
 
-        return dict     
+        return metadict     
 
     def get_files_owned_by_packages(self):
         tf = self._execute_getoutput(['bash','-ec','''
@@ -1204,22 +1204,22 @@
                     xargs -r0 egrep . /dev/null
                 test "${PIPESTATUS[*]}" = "0 0"
             '''])
-        dict = {}
+        filedict = {}
         try:
             f = file(tf)
             for l in f:
                 (lf,pathname) = l.rstrip('\n').split(':',1)
                 assert lf.endswith('.list')
                 pkg = lf[:-5]
-                if pathname in dict:
-                    dict[pathname].append(pkg)
+                if pathname in filedict:
+                    filedict[pathname].append(pkg)
                 else:
-                    dict[pathname] = [pkg]
+                    filedict[pathname] = [pkg]
 
             f.close()
         finally:
             os.remove(tf)
-        return dict
+        return filedict
 
     def check_for_broken_symlinks(self):
         if not settings.check_broken_symlinks:
@@ -1309,15 +1309,15 @@
     """Return list of indented filenames."""
     meta_infos = meta_infos[:]
     meta_infos.sort()
-    list = []
+    metalist = []
     for name, data in meta_infos:
-        list.append("  %s\t" % name)
+        metalist.append("  %s\t" % name)
         if name in file_owners:
-            list.append(" owned by: %s\n" % ", ".join(file_owners[name]))
+            metalist.append(" owned by: %s\n" % ", ".join(file_owners[name]))
        else:
-            list.append(" not owned\n")        
+            metalist.append(" not owned\n")    
 
-    return "".join(list)
+    return "".join(metalist)
 
 
 def offending_packages(meta_infos, file_owners):
@@ -1335,10 +1335,10 @@
     list of removed elements.
     """
     warn = []
-    for file in depsfiles:
-        if file in files:
-            files.remove(file)
-            warn.append(file)
+    for depsfile in depsfiles:
+        if depsfile in files:
+            files.remove(depsfile)
+            warn.append(depsfile)
     return warn
 
 
@@ -1360,13 +1360,13 @@
 
 def get_package_names_from_package_files(filenames):
     """Return list of package names given list of package file names."""
-    list = []
+    filelist = []
     for filename in filenames:
         (status, output) = run(["dpkg", "--info", filename])
         for line in [line.lstrip() for line in output.split("\n")]:
             if line[:len("Package:")] == "Package:":
-                list.append(line.split(":", 1)[1].strip())
-    return list
+                filelist.append(line.split(":", 1)[1].strip())
+    return filelist
 
 
 def check_results(chroot, root_info, file_owners, deps_info=None):
@@ -1895,9 +1895,9 @@
         if settings.scriptsdir is not None:
             dest = chroot.relative("tmp/scripts/")
             os.mkdir(dest)
-            for file in os.listdir(settings.scriptsdir):
-                if (file.startswith("post_") or file.startswith("pre_")) and 
os.path.isfile(os.path.join((settings.scriptsdir), file)):
-                    shutil.copy(os.path.join((settings.scriptsdir), file), 
dest) 
+            for filename in os.listdir(settings.scriptsdir):
+                if (filename.startswith("post_") or 
filename.startswith("pre_")) and 
os.path.isfile(os.path.join((settings.scriptsdir), filename)):
+                    shutil.copy(os.path.join((settings.scriptsdir), filename), 
dest) 
 
         if not install_purge_test(chroot, root_info, selections,
                                  args, packages):
diff -u piuparts-0.35/piuparts-slave.py piuparts-new/piuparts-slave.py
--- piuparts-0.35/piuparts-slave.py     2007-12-22 16:05:58.000000000 +0100
+++ piuparts-new/piuparts-slave.py      2009-04-13 22:28:08.000000000 +0200
@@ -195,12 +195,12 @@
         create_file(self._reserved_filename(name, version), "")
 
     def get_reserved(self):
-        list = []
+        tmplist = []
         for basename in os.listdir("reserved"):
             if "_" in basename and basename.endswith(".log"):
                 name, version = basename[:-len(".log")].split("_", 1)
-                list.append((name, version))
-        return list
+                tmplist.append((name, version))
+        return tmplist
 
     def forget_reserved(self, name, version):
         try:

--- End Message ---
--- Begin Message ---
Source: piuparts
Source-Version: 0.40

We believe that the bug you reported is fixed in the latest version of
piuparts, which is due to be installed in the Debian FTP archive:

piuparts_0.40.dsc
  to main/p/piuparts/piuparts_0.40.dsc
piuparts_0.40.tar.gz
  to main/p/piuparts/piuparts_0.40.tar.gz
piuparts_0.40_all.deb
  to main/p/piuparts/piuparts_0.40_all.deb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Holger Levsen <[email protected]> (supplier of updated piuparts package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Sat, 25 Jun 2011 21:20:31 +0000
Source: piuparts
Binary: piuparts
Architecture: source all
Version: 0.40
Distribution: unstable
Urgency: low
Maintainer: piuparts developers team <[email protected]>
Changed-By: Holger Levsen <[email protected]>
Description: 
 piuparts   - .deb package installation, upgrading, and removal testing tool
Closes: 523950 614617
Changes: 
 piuparts (0.40) unstable; urgency=low
 .
   * piuparts.py:
     - make "natty" the default Ubuntu distribution.
     - add to self.ignored_files:
       - /var/log/bootstrap.log
   * debian/control: depend on ${python:Depends} instead of just python. Thanks
     to Jakub Wilk. (Closes: #614617)
   * *.py: do not use Python built-in function names as variable name. Thanks
     to Carl Chenet for a first patch and Scott Schaefer for the applied one.
     (Closes: #523950)
   * Bump Standards-Version to 3.9.2, no changes necessary.
   * debian/rules: add empty build-arch and build-indep to appease lintian.
   * Makefile: drop workaround for #559305 in lenny.
Checksums-Sha1: 
 42ca467a2388e84c6c7500d99241663d85be7cef 959 piuparts_0.40.dsc
 3b2bf3ad647b2a1123c287a5efb978b87e93c095 87909 piuparts_0.40.tar.gz
 5a5215c92a5d7b09149e2b52b72dab416d007c2a 95834 piuparts_0.40_all.deb
Checksums-Sha256: 
 87cccb3ade6d4eb2543c779aa22789f5611e1168b80d1f48da5763c2e44a6562 959 
piuparts_0.40.dsc
 6dba2a3da09bca092002f1215534c36ab93441b5b895e78fdcb05e1fd78beb32 87909 
piuparts_0.40.tar.gz
 968f5a733cea7f02dbcffe32918f77c028aeb05a0d9de48b33f08f6387598f55 95834 
piuparts_0.40_all.deb
Files: 
 995e23d62ceb1b3245963c9816ab2cc4 959 devel extra piuparts_0.40.dsc
 2d1cb4089c63dcc43b7f572d76b2e6f5 87909 devel extra piuparts_0.40.tar.gz
 988165f1ce25a495c8433dc30872b6ec 95834 devel extra piuparts_0.40_all.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iD8DBQFOBlKsUHLQNqxYNSARAnjjAJ9EGmsX/HBzRwBAM21NRSgVVemvYQCgtsRx
YBw+PRU3UPmjLMhOtduQ5cs=
=L3Fg
-----END PGP SIGNATURE-----



--- End Message ---

Reply via email to