mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
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:
parent
91951481b8
commit
853474194f
3 changed files with 233 additions and 3 deletions
|
@ -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]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue