parsedate_tz(): If data is false, return None. Fixes bug #478115,

IndexError when a Date: field exists with an empty value.
This commit is contained in:
Barry Warsaw 2001-11-13 18:00:40 +00:00
parent bf5ca65c2d
commit 4a106ee9e1
1 changed files with 2 additions and 0 deletions

View File

@ -858,6 +858,8 @@ def parsedate_tz(data):
Accounts for military timezones.
"""
if not data:
return None
data = data.split()
if data[0][-1] in (',', '.') or data[0].lower() in _daynames:
# There's a dayname here. Skip it