From: Guido van Rossum Date: Thu, 9 Nov 2000 18:05:24 +0000 (+0000) Subject: Implement the suggestion of bug_id=122070: surround tell() call with X-Git-Tag: v2.1a1~751 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a66eed62fd232bc276e9f8169f9d9025937f8899;p=python Implement the suggestion of bug_id=122070: surround tell() call with try/except. --- diff --git a/Lib/rfc822.py b/Lib/rfc822.py index 2004524558..2f1a268a42 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'