]> granicus.if.org Git - python/commitdiff
Implement the suggestion of bug_id=122070: surround tell() call with
authorGuido van Rossum <guido@python.org>
Thu, 9 Nov 2000 18:05:24 +0000 (18:05 +0000)
committerGuido van Rossum <guido@python.org>
Thu, 9 Nov 2000 18:05:24 +0000 (18:05 +0000)
try/except.

Lib/rfc822.py

index 200452455851a9d6b9a22361f17a27d1acc16cbe..2f1a268a42ddfdd598f737bae6b0e9129e6551c5 100644 (file)
@@ -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'