diff options
author | Guido van Rossum <guido@python.org> | 1996-12-27 15:42:35 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1996-12-27 15:42:35 (GMT) |
commit | c17a268398da1ea85af8649e5c35ef2c4b768451 (patch) | |
tree | 5ee7258a21bd83fa17196aa1cf26076c566b43d4 /Lib/rfc822.py | |
parent | 178ff353e88c41f6f3d26f3f6e4d9772a5dc7713 (diff) | |
download | cpython-c17a268398da1ea85af8649e5c35ef2c4b768451.zip cpython-c17a268398da1ea85af8649e5c35ef2c4b768451.tar.gz cpython-c17a268398da1ea85af8649e5c35ef2c4b768451.tar.bz2 |
Added support for RFC 850 style dates, as used by some HTTP servers
(such as Netscape-Commerce and CERN).
An example of a RFC 850 date: 'Wednesday, 18-Dec-96 21:00:00 GMT'
From: Chris Lawrence <quango@themall.net>
Diffstat (limited to 'Lib/rfc822.py')
-rw-r--r-- | Lib/rfc822.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/rfc822.py b/Lib/rfc822.py index 1ea2f5f..f34f0b6 100644 --- a/Lib/rfc822.py +++ b/Lib/rfc822.py @@ -417,6 +417,10 @@ def parsedate_tz(data): if data[0][-1] == ',': # There's a dayname here. Skip it del data[0] + if len(data) == 3: # RFC 850 date, deprecated + stuff = string.split(data[0], '-') + if len(stuff) == 3: + data = stuff + data[1:] if len(data) == 4: s = data[3] i = string.find(s, '+') |