From a66eed62fd232bc276e9f8169f9d9025937f8899 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Thu, 9 Nov 2000 18:05:24 +0000 Subject: Implement the suggestion of bug_id=122070: surround tell() call with try/except. --- Lib/rfc822.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'Lib/rfc822.py') 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' -- cgit v1.2.1