commit | 4a106ee9e1551fc12c9a767b660c6cdf7b5d9823 | [log] [tgz] |
---|---|---|
author | Barry Warsaw <barry@python.org> | Tue Nov 13 18:00:40 2001 +0000 |
committer | Barry Warsaw <barry@python.org> | Tue Nov 13 18:00:40 2001 +0000 |
tree | a8387a0016b7972950594bab029458ffb6eceaa3 | |
parent | bf5ca65c2d34046dd8f2dfb89164f3e55f6a3396 [diff] [blame] |
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 430e637..0019949 100644 --- a/Lib/rfc822.py +++ b/Lib/rfc822.py
@@ -858,6 +858,8 @@ 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