diff options
| author | Michael Vogt <michael.vogt@ubuntu.com> | 2006-11-03 22:04:04 +0100 |
|---|---|---|
| committer | Michael Vogt <michael.vogt@ubuntu.com> | 2006-11-03 22:04:04 +0100 |
| commit | 47a1e41c1786a637c2bef222d0f304c6c19a2b8d (patch) | |
| tree | d39615c986aa3976d75fee375670a18e06a2311e /apt/progress.py | |
| parent | 81195751c089c177c237fae1e7183824190a26a9 (diff) | |
| download | python-apt-47a1e41c1786a637c2bef222d0f304c6c19a2b8d.tar.gz | |
* apt/progress.py:
- protect against unparsable strings from dpkg
Diffstat (limited to 'apt/progress.py')
| -rw-r--r-- | apt/progress.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/apt/progress.py b/apt/progress.py index 8ac0e1dc..5169adf7 100644 --- a/apt/progress.py +++ b/apt/progress.py @@ -175,7 +175,12 @@ class InstallProgress(DumbInstallProgress): if self.read.endswith("\n"): s = self.read #print s - (status, pkg, percent, status_str) = string.split(s, ":") + try: + (status, pkg, percent, status_str) = string.split(s, ":",3) + except ValueError, e: + # silently ignore lines that can't be parsed + self.read = "" + return #print "percent: %s %s" % (pkg, float(percent)/100.0) if status == "pmerror": self.error(pkg,status_str) |
