From 4a106ee9e1551fc12c9a767b660c6cdf7b5d9823 Mon Sep 17 00:00:00 2001 From: Barry Warsaw Date: Tue, 13 Nov 2001 18:00:40 +0000 Subject: [PATCH] parsedate_tz(): If data is false, return None. Fixes bug #478115, IndexError when a Date: field exists with an empty value. --- Lib/rfc822.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Lib/rfc822.py b/Lib/rfc822.py index 430e6372f0f..00199495885 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