From: Georg Brandl Date: Mon, 22 Jan 2007 21:10:43 +0000 (+0000) Subject: Bug #1249573: fix rfc822.parsedate not accepting a certain date format X-Git-Tag: v2.5.1c1~147 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=742e39296a80a72cba06fdfd3b25abbb6e723885;p=thirdparty%2FPython%2Fcpython.git Bug #1249573: fix rfc822.parsedate not accepting a certain date format (backport from rev. 53522) --- diff --git a/Lib/rfc822.py b/Lib/rfc822.py index d6d5e4712972..14cc7297f1dc 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: