]> err.no Git - dak/commitdiff
Reap zombie children in scan_contents().
authorTorsten Werner <twerner@debian.org>
Wed, 2 Mar 2011 12:17:12 +0000 (13:17 +0100)
committerTorsten Werner <twerner@debian.org>
Wed, 2 Mar 2011 12:17:12 +0000 (13:17 +0100)
Signed-off-by: Torsten Werner <twerner@debian.org>
daklib/dbconn.py

index 24f8fb17d9620f99570db40e203ac21381ec142c..04823061814912e5da33d084acaeb5cc1ecdf45f 100755 (executable)
@@ -512,9 +512,8 @@ class DBBinary(ORMObject):
         iso8859-1 encoding.
         '''
         fullpath = self.poolfile.fullpath
-        debdata = Popen(['dpkg-deb', '--fsys-tarfile', fullpath],
-            stdout = PIPE).stdout
-        tar = TarFile.open(fileobj = debdata, mode = 'r|')
+        dpkg = Popen(['dpkg-deb', '--fsys-tarfile', fullpath], stdout = PIPE)
+        tar = TarFile.open(fileobj = dpkg.stdout, mode = 'r|')
         for member in tar.getmembers():
             if member.isfile():
                 try:
@@ -523,7 +522,8 @@ class DBBinary(ORMObject):
                     name = member.name.decode('iso8859-1')
                 yield normpath(name)
         tar.close()
-        debdata.close()
+        dpkg.stdout.close()
+        dpkg.wait()
 
 __all__.append('DBBinary')