Commit 93f5b934 authored by Anthony Baxter's avatar Anthony Baxter

The email module's parsedate_tz function now sets the daylight savings

flag to -1 (unknown) since it can't tell from the date whether it should
be set.
patch from Aldo Cortesi
parent 9e5eb4ff
...@@ -124,7 +124,8 @@ def parsedate_tz(data): ...@@ -124,7 +124,8 @@ def parsedate_tz(data):
else: else:
tzsign = 1 tzsign = 1
tzoffset = tzsign * ( (tzoffset//100)*3600 + (tzoffset % 100)*60) tzoffset = tzsign * ( (tzoffset//100)*3600 + (tzoffset % 100)*60)
return yy, mm, dd, thh, tmm, tss, 0, 1, 0, tzoffset # Daylight Saving Time flag is set to -1, since DST is unknown.
return yy, mm, dd, thh, tmm, tss, 0, 1, -1, tzoffset
def parsedate(data): def parsedate(data):
......
...@@ -2113,12 +2113,12 @@ class TestMiscellaneous(TestEmailBase): ...@@ -2113,12 +2113,12 @@ class TestMiscellaneous(TestEmailBase):
def test_parsedate_no_dayofweek(self): def test_parsedate_no_dayofweek(self):
eq = self.assertEqual eq = self.assertEqual
eq(Utils.parsedate_tz('25 Feb 2003 13:47:26 -0800'), eq(Utils.parsedate_tz('25 Feb 2003 13:47:26 -0800'),
(2003, 2, 25, 13, 47, 26, 0, 1, 0, -28800)) (2003, 2, 25, 13, 47, 26, 0, 1, -1, -28800))
def test_parsedate_compact_no_dayofweek(self): def test_parsedate_compact_no_dayofweek(self):
eq = self.assertEqual eq = self.assertEqual
eq(Utils.parsedate_tz('5 Feb 2003 13:47:26 -0800'), eq(Utils.parsedate_tz('5 Feb 2003 13:47:26 -0800'),
(2003, 2, 5, 13, 47, 26, 0, 1, 0, -28800)) (2003, 2, 5, 13, 47, 26, 0, 1, -1, -28800))
def test_parsedate_acceptable_to_time_functions(self): def test_parsedate_acceptable_to_time_functions(self):
eq = self.assertEqual eq = self.assertEqual
......
...@@ -2119,12 +2119,12 @@ class TestMiscellaneous(TestEmailBase): ...@@ -2119,12 +2119,12 @@ class TestMiscellaneous(TestEmailBase):
def test_parsedate_no_dayofweek(self): def test_parsedate_no_dayofweek(self):
eq = self.assertEqual eq = self.assertEqual
eq(utils.parsedate_tz('25 Feb 2003 13:47:26 -0800'), eq(utils.parsedate_tz('25 Feb 2003 13:47:26 -0800'),
(2003, 2, 25, 13, 47, 26, 0, 1, 0, -28800)) (2003, 2, 25, 13, 47, 26, 0, 1, -1, -28800))
def test_parsedate_compact_no_dayofweek(self): def test_parsedate_compact_no_dayofweek(self):
eq = self.assertEqual eq = self.assertEqual
eq(utils.parsedate_tz('5 Feb 2003 13:47:26 -0800'), eq(utils.parsedate_tz('5 Feb 2003 13:47:26 -0800'),
(2003, 2, 5, 13, 47, 26, 0, 1, 0, -28800)) (2003, 2, 5, 13, 47, 26, 0, 1, -1, -28800))
def test_parsedate_acceptable_to_time_functions(self): def test_parsedate_acceptable_to_time_functions(self):
eq = self.assertEqual eq = self.assertEqual
......
...@@ -132,6 +132,7 @@ Jeffery Collins ...@@ -132,6 +132,7 @@ Jeffery Collins
Matt Conway Matt Conway
David M. Cooke David M. Cooke
Greg Copeland Greg Copeland
Aldo Cortesi
David Costanzo David Costanzo
Scott Cotton Scott Cotton
Greg Couch Greg Couch
......
...@@ -491,6 +491,10 @@ Extension Modules ...@@ -491,6 +491,10 @@ Extension Modules
Library Library
------- -------
- The email module's parsedate_tz function now sets the daylight savings
flag to -1 (unknown) since it can't tell from the date whether it should
be set.
- Patch #624325: urlparse.urlparse() and urlparse.urlsplit() results - Patch #624325: urlparse.urlparse() and urlparse.urlsplit() results
now sport attributes that provide access to the parts of the result. now sport attributes that provide access to the parts of the result.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment