mirror of https://github.com/python/cpython
Skip old-style 'From name time' lines at beginning of message.
This commit is contained in:
parent
fbe6d33ffd
commit
3a15dca1a0
|
@ -86,11 +86,17 @@ class Message:
|
||||||
self.headers = list = []
|
self.headers = list = []
|
||||||
self.status = ''
|
self.status = ''
|
||||||
headerseen = 0
|
headerseen = 0
|
||||||
|
firstline = 1
|
||||||
while 1:
|
while 1:
|
||||||
line = self.fp.readline()
|
line = self.fp.readline()
|
||||||
if not line:
|
if not line:
|
||||||
self.status = 'EOF in headers'
|
self.status = 'EOF in headers'
|
||||||
break
|
break
|
||||||
|
# Skip unix From name time lines
|
||||||
|
if firstline and (line[:5] == 'From '
|
||||||
|
or line[:6] == '>From '):
|
||||||
|
continue
|
||||||
|
firstline = 0
|
||||||
if self.islast(line):
|
if self.islast(line):
|
||||||
break
|
break
|
||||||
elif headerseen and line[0] in ' \t':
|
elif headerseen and line[0] in ' \t':
|
||||||
|
|
Loading…
Reference in New Issue