diff options
author | Barry Warsaw <barry@python.org> | 2001-11-13 18:00:40 (GMT) |
---|---|---|
committer | Barry Warsaw <barry@python.org> | 2001-11-13 18:00:40 (GMT) |
commit | 4a106ee9e1551fc12c9a767b660c6cdf7b5d9823 (patch) | |
tree | a8387a0016b7972950594bab029458ffb6eceaa3 /Lib/rfc822.py | |
parent | bf5ca65c2d34046dd8f2dfb89164f3e55f6a3396 (diff) | |
download | cpython-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.
Diffstat (limited to 'Lib/rfc822.py')
-rw-r--r-- | Lib/rfc822.py | 2 |
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 |