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
This commit is contained in:
Guido van Rossum 1994-09-09 11:10:15 +00:00
parent 91951481b8
commit 853474194f
3 changed files with 233 additions and 3 deletions

View file

@ -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]