From: Barry Warsaw Date: Tue, 13 Nov 2001 18:00:40 +0000 (+0000) Subject: parsedate_tz(): If data is false, return None. Fixes bug #478115, X-Git-Tag: v2.2.1c1~783 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4a106ee9e1551fc12c9a767b660c6cdf7b5d9823;p=python parsedate_tz(): If data is false, return None. Fixes bug #478115, IndexError when a Date: field exists with an empty value. --- diff --git a/Lib/rfc822.py b/Lib/rfc822.py index 430e6372f0..0019949588 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