From: Avery Pennarun Date: Thu, 3 Feb 2011 23:07:48 +0000 (-0800) Subject: DemuxConn.__init__: abort the loop if read() returns EOF. X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=05d79f714d987ef70d96b56de8c62e9b18e8abc0;p=packages%2Fb%2Fbup.git DemuxConn.__init__: abort the loop if read() returns EOF. Signed-off-by: Avery Pennarun --- diff --git a/lib/bup/helpers.py b/lib/bup/helpers.py index 41c5229..20339a6 100644 --- a/lib/bup/helpers.py +++ b/lib/bup/helpers.py @@ -328,7 +328,10 @@ class DemuxConn(BaseConn): # multiplexed and can be assumed to be debug/log before mux init. tail = '' while tail != 'BUPMUX': - tail += os.read(infd, 1024) + b = os.read(infd, 1024) + if not b: + raise IOError('demux: unexpected EOF during initialization') + tail += b buf = tail[:-6] tail = tail[-6:] sys.stderr.write(buf)