From c69e1b0d6e7224f21026c2ec793140b99b93f8de Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Wed, 2 Dec 2009 15:14:22 +0000 Subject: * apt/progress/__init__.py: - Fix InstallProgress.updateInterface() to cope with read() returning 0 on non-blocking file descriptors (LP: #491027). --- apt/progress/__init__.py | 5 ++++- debian/changelog | 8 ++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/apt/progress/__init__.py b/apt/progress/__init__.py index ca60810f..c042ece7 100644 --- a/apt/progress/__init__.py +++ b/apt/progress/__init__.py @@ -246,7 +246,10 @@ class InstallProgress(DumbInstallProgress): return try: while not self.read.endswith("\n"): - self.read += os.read(self.statusfd.fileno(), 1) + r = os.read(self.statusfd.fileno(), 1) + if not r: + return + self.read += r except OSError, (errno_, errstr): # resource temporarly unavailable is ignored if errno_ != errno.EAGAIN and errno_ != errno.EWOULDBLOCK: diff --git a/debian/changelog b/debian/changelog index dbb91706..626cb9f8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +python-apt (0.7.13.2ubuntu6) UNRELEASED; urgency=low + + * apt/progress/__init__.py: + - Fix InstallProgress.updateInterface() to cope with read() returning 0 + on non-blocking file descriptors (LP: #491027). + + -- Colin Watson Wed, 02 Dec 2009 13:56:58 +0000 + python-apt (0.7.13.2ubuntu5) lucid; urgency=low * python/progress.cc: -- cgit v1.2.3