summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2000-11-09 18:05:24 (GMT)
committerGuido van Rossum <guido@python.org>2000-11-09 18:05:24 (GMT)
commita66eed62fd232bc276e9f8169f9d9025937f8899 (patch)
treed6d56793fed461d40105bba4e54764d4a318467a
parent17bfef5860493a0195c999ab44d4c849660cac30 (diff)
downloadcpython-a66eed62fd232bc276e9f8169f9d9025937f8899.zip
cpython-a66eed62fd232bc276e9f8169f9d9025937f8899.tar.gz
cpython-a66eed62fd232bc276e9f8169f9d9025937f8899.tar.bz2
Implement the suggestion of bug_id=122070: surround tell() call with
try/except.
-rw-r--r--Lib/rfc822.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/rfc822.py b/Lib/rfc822.py
index 2004524..2f1a268 100644
--- a/Lib/rfc822.py
+++ b/Lib/rfc822.py
@@ -132,7 +132,11 @@ class Message:
tell = self.fp.tell
while 1:
if tell:
- startofline = tell()
+ try:
+ startofline = tell()
+ except IOError:
+ startofline = tell = None
+ self.seekable = 0
line = self.fp.readline()
if not line:
self.status = 'EOF in headers'