Bug#499296: [python-apt] Incorrect use of select
Package: python-apt
Version: 0.7.7.1
Severity: normal
Tags: patch
--- Please enter the report below this line. ---
apt/progress.py is using select to check the status of dpkg, but it will fail
if there is an interruption not directly related with dpkg (such as child
process exiting or something else related to the main program). From the
select man page:
[EINTR] A signal was delivered before the time limit expired
and before any of the selected events occurred.
The normal course of action is to just retry the select call.
diff -wruN python-apt-0.7.7.1-old/apt/progress.py
python-apt-0.7.7.1/apt/progress.py
--- python-apt-0.7.7.1-old/apt/progress.py 2008-07-25 14:52:16.000000000 -0400
+++ python-apt-0.7.7.1/apt/progress.py 2008-09-17 10:07:08.000000000 -0400
@@ -203,7 +203,9 @@
return os.fork()
def waitChild(self):
while True:
- select.select([self.statusfd],[],[], self.selectTimeout)
+ try: select.select([self.statusfd],[],[], self.selectTimeout)
+ except select.error, e:
+ if e[0] != EINTR: raise
self.updateInterface()
(pid, res) = os.waitpid(self.child_pid,os.WNOHANG)
if pid == self.child_pid:
--- System information. ---
Architecture: amd64
Kernel: Linux 2.6.26
Debian Release: lenny/sid
500 unstable www.emdebian.org
500 unstable gulus.usherbrooke.ca
500 testing gulus.usherbrooke.ca
1 experimental gulus.usherbrooke.ca
--- Package information. ---
Depends (Version) | Installed
==========================================-+-=============
python (<< 2.6) | 2.5.2-2
python (>= 2.4) | 2.5.2-2
python-central (>= 0.6.7) | 0.6.8
libapt-inst-libc6.7-6-1.1 |
libapt-pkg-libc6.7-6-4.6 |
libc6 (>= 2.7-1) | 2.7-13
libgcc1 (>= 1:4.1.1) | 1:4.3.2-1
libstdc++6 (>= 4.2.1) | 4.3.2-1
lsb-release | 3.2-20
Reply to: