diff --git a/Lib/rfc822.py b/Lib/rfc822.py index 20045245585..2f1a268a42d 100644 --- a/Lib/rfc822.py +++ b/Lib/rfc822.py @@ -132,7 +132,11 @@ def readheaders(self): 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'