summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>2001-11-13 18:00:40 (GMT)
committerBarry Warsaw <barry@python.org>2001-11-13 18:00:40 (GMT)
commit4a106ee9e1551fc12c9a767b660c6cdf7b5d9823 (patch)
treea8387a0016b7972950594bab029458ffb6eceaa3
parentbf5ca65c2d34046dd8f2dfb89164f3e55f6a3396 (diff)
downloadcpython-4a106ee9e1551fc12c9a767b660c6cdf7b5d9823.zip
cpython-4a106ee9e1551fc12c9a767b660c6cdf7b5d9823.tar.gz
cpython-4a106ee9e1551fc12c9a767b660c6cdf7b5d9823.tar.bz2
parsedate_tz(): If data is false, return None. Fixes bug #478115,
IndexError when a Date: field exists with an empty value.
-rw-r--r--Lib/rfc822.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/rfc822.py b/Lib/rfc822.py
index 430e637..0019949 100644
--- a/Lib/rfc822.py
+++ b/Lib/rfc822.py
@@ -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