summaryrefslogtreecommitdiffstats
path: root/Lib/email/test
diff options
context:
space:
mode:
authorR David Murray <rdmurray@bitdance.com>2011-03-14 00:06:23 (GMT)
committerR David Murray <rdmurray@bitdance.com>2011-03-14 00:06:23 (GMT)
commitaccd1c040f472f613cdac8fbf78e75794819acfc (patch)
tree8830397de5d56f37dd1413f1ef4c2bb686ee3d80 /Lib/email/test
parent0cfc23762fb3cc5467d50de020a3b69710884aa5 (diff)
downloadcpython-accd1c040f472f613cdac8fbf78e75794819acfc.zip
cpython-accd1c040f472f613cdac8fbf78e75794819acfc.tar.gz
cpython-accd1c040f472f613cdac8fbf78e75794819acfc.tar.bz2
#1162477: accept '.' in addition to ':' when parsing time in date header.
Some non-compliant MUAs use '.'s, so by the Postel Principle we should accept them. Patch by Thomas Herve.
Diffstat (limited to 'Lib/email/test')
-rw-r--r--Lib/email/test/test_email.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/email/test/test_email.py b/Lib/email/test/test_email.py
index 16772b1..5aaf526 100644
--- a/Lib/email/test/test_email.py
+++ b/Lib/email/test/test_email.py
@@ -2328,6 +2328,13 @@ class TestMiscellaneous(TestEmailBase):
(2002, 4, 3, 14, 58, 26, 0, 1, -1, -28800))
+ def test_parsedate_accepts_time_with_dots(self):
+ eq = self.assertEqual
+ eq(utils.parsedate_tz('5 Feb 2003 13.47.26 -0800'),
+ (2003, 2, 5, 13, 47, 26, 0, 1, -1, -28800))
+ eq(utils.parsedate_tz('5 Feb 2003 13.47 -0800'),
+ (2003, 2, 5, 13, 47, 0, 0, 1, -1, -28800))
+
def test_parsedate_acceptable_to_time_functions(self):
eq = self.assertEqual
timetup = utils.parsedate('5 Feb 2003 13:47:26 -0800')