summaryrefslogtreecommitdiffstats
path: root/Lib/rfc822.py
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 /Lib/rfc822.py
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.
Diffstat (limited to 'Lib/rfc822.py')
-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'