mirror of https://github.com/python/cpython
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:
parent
bf5ca65c2d
commit
4a106ee9e1
|
@ -858,6 +858,8 @@ def parsedate_tz(data):
|
||||||
|
|
||||||
Accounts for military timezones.
|
Accounts for military timezones.
|
||||||
"""
|
"""
|
||||||
|
if not data:
|
||||||
|
return None
|
||||||
data = data.split()
|
data = data.split()
|
||||||
if data[0][-1] in (',', '.') or data[0].lower() in _daynames:
|
if data[0][-1] in (',', '.') or data[0].lower() in _daynames:
|
||||||
# There's a dayname here. Skip it
|
# There's a dayname here. Skip it
|
||||||
|
|
Loading…
Reference in New Issue