summaryrefslogtreecommitdiffstats
path: root/Lib/rfc822.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2007-01-22 21:10:43 (GMT)
committerGeorg Brandl <georg@python.org>2007-01-22 21:10:43 (GMT)
commit742e39296a80a72cba06fdfd3b25abbb6e723885 (patch)
tree8b03d08425b6f8afe7a62e4936238492d095041b /Lib/rfc822.py
parentf446a9b00a50ffe6041447cb2b8b252cc315ac69 (diff)
downloadcpython-742e39296a80a72cba06fdfd3b25abbb6e723885.zip
cpython-742e39296a80a72cba06fdfd3b25abbb6e723885.tar.gz
cpython-742e39296a80a72cba06fdfd3b25abbb6e723885.tar.bz2
Bug #1249573: fix rfc822.parsedate not accepting a certain date format
(backport from rev. 53522)
Diffstat (limited to 'Lib/rfc822.py')
-rw-r--r--Lib/rfc822.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/rfc822.py b/Lib/rfc822.py
index d6d5e47..14cc729 100644
--- a/Lib/rfc822.py
+++ b/Lib/rfc822.py
@@ -854,6 +854,11 @@ def parsedate_tz(data):
if data[0][-1] in (',', '.') or data[0].lower() in _daynames:
# There's a dayname here. Skip it
del data[0]
+ else:
+ # no space after the "weekday,"?
+ i = data[0].rfind(',')
+ if i >= 0:
+ data[0] = data[0][i+1:]
if len(data) == 3: # RFC 850 date, deprecated
stuff = data[0].split('-')
if len(stuff) == 3: