summaryrefslogtreecommitdiffstats
path: root/Lib/rfc822.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1994-09-09 11:10:15 (GMT)
committerGuido van Rossum <guido@python.org>1994-09-09 11:10:15 (GMT)
commit853474194fa799ab96a135f900332eaca52a07e7 (patch)
tree85f3129f76bd427327cc8a55d00e8561b5631a49 /Lib/rfc822.py
parent91951481b8b7bf134ed5c662373164d205ab8046 (diff)
downloadcpython-853474194fa799ab96a135f900332eaca52a07e7.zip
cpython-853474194fa799ab96a135f900332eaca52a07e7.tar.gz
cpython-853474194fa799ab96a135f900332eaca52a07e7.tar.bz2
mhlib.py: delay opening of sequences file so we don't overwrite it when
putsequences is called with a bad argument rfc822.py: better handling of dates with no or bad timezones uu.py: contributed by Lance -- uu{en,de}code
Diffstat (limited to 'Lib/rfc822.py')
-rw-r--r--Lib/rfc822.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/Lib/rfc822.py b/Lib/rfc822.py
index 886098c..fcf31fb 100644
--- a/Lib/rfc822.py
+++ b/Lib/rfc822.py
@@ -329,11 +329,18 @@ _monthnames = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul',
'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
def parsedate(data):
- # XXX This completely ignores timezone matters at the moment...
+ # XXX This still mostly ignores timezone matters at the moment...
data = string.split(data)
if data[0][-1] == ',':
# There's a dayname here. Skip it
del data[0]
+ if len(data) == 4:
+ s = data[3]
+ i = string.find(s, '+')
+ if i > 0:
+ data[3:] = [s[:i], s[i+1:]]
+ else:
+ data.append('') # Dummy tz
if len(data) < 5:
return None
data = data[:5]