summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2009-09-03 15:01:01 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2009-09-03 15:01:01 +0200
commit2ca7c7acd3f47dc7da07fd8ad77df8c0c6c84735 (patch)
treea1f37bfc5374d51cf54536099f7c8f5f021a1fc3
parent0d4a8172a7bceac5bdca37cc199d9bfba889cc4f (diff)
downloadpython-apt-2ca7c7acd3f47dc7da07fd8ad77df8c0c6c84735.tar.gz
* apt/progress/__init__.py:
- catch exceptions in pm.DoInstall()
-rw-r--r--apt/progress/__init__.py11
-rw-r--r--debian/changelog2
2 files changed, 11 insertions, 2 deletions
diff --git a/apt/progress/__init__.py b/apt/progress/__init__.py
index 3a6b3f91..97090643 100644
--- a/apt/progress/__init__.py
+++ b/apt/progress/__init__.py
@@ -311,8 +311,15 @@ class InstallProgress(DumbInstallProgress):
"""Start installing."""
pid = self.fork()
if pid == 0:
- # child
- res = pm.DoInstall(self.writefd)
+ # pm.DoInstall might raise a exception,
+ # when this happens, we need to catch
+ # it, otherwise os._exit() is not run
+ # and the execution continues in the
+ # parent code leading to very confusing bugs
+ try:
+ res = pm.DoInstall(self.writefd)
+ except Exception, e:
+ os._exit(pm.ResultFailed)
os._exit(res)
self.child_pid = pid
res = self.waitChild()
diff --git a/debian/changelog b/debian/changelog
index ada400bb..3f23a368 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -5,6 +5,8 @@ python-apt (0.7.13.3) UNRELEASED; urgency=low
- add actiongroup() method (backport from 0.7.92)
- re-work the logic in commit() to fail if installArchives() returns
a unexpected result
+ * apt/progress/__init__.py:
+ - catch exceptions in pm.DoInstall()
[ Sebastian Heinlein ]
* apt/package.py: