[Python-checkins] r43578 - in python/trunk: Lib/email/_parseaddr.py Lib/email/test/test_email.py Lib/email/test/test_email_renamed.py Misc/ACKS Misc/NEWS

anthony.baxter python-checkins at python.org
Mon Apr 3 10:05:09 CEST 2006


Author: anthony.baxter
Date: Mon Apr  3 10:05:07 2006
New Revision: 43578

Modified:
   python/trunk/Lib/email/_parseaddr.py
   python/trunk/Lib/email/test/test_email.py
   python/trunk/Lib/email/test/test_email_renamed.py
   python/trunk/Misc/ACKS
   python/trunk/Misc/NEWS
Log:
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


Modified: python/trunk/Lib/email/_parseaddr.py
==============================================================================
--- python/trunk/Lib/email/_parseaddr.py	(original)
+++ python/trunk/Lib/email/_parseaddr.py	Mon Apr  3 10:05:07 2006
@@ -124,7 +124,8 @@
         else:
             tzsign = 1
         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):

Modified: python/trunk/Lib/email/test/test_email.py
==============================================================================
--- python/trunk/Lib/email/test/test_email.py	(original)
+++ python/trunk/Lib/email/test/test_email.py	Mon Apr  3 10:05:07 2006
@@ -2113,12 +2113,12 @@
     def test_parsedate_no_dayofweek(self):
         eq = self.assertEqual
         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):
         eq = self.assertEqual
         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):
         eq = self.assertEqual

Modified: python/trunk/Lib/email/test/test_email_renamed.py
==============================================================================
--- python/trunk/Lib/email/test/test_email_renamed.py	(original)
+++ python/trunk/Lib/email/test/test_email_renamed.py	Mon Apr  3 10:05:07 2006
@@ -2119,12 +2119,12 @@
     def test_parsedate_no_dayofweek(self):
         eq = self.assertEqual
         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):
         eq = self.assertEqual
         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):
         eq = self.assertEqual

Modified: python/trunk/Misc/ACKS
==============================================================================
--- python/trunk/Misc/ACKS	(original)
+++ python/trunk/Misc/ACKS	Mon Apr  3 10:05:07 2006
@@ -132,6 +132,7 @@
 Matt Conway
 David M. Cooke
 Greg Copeland
+Aldo Cortesi
 David Costanzo
 Scott Cotton
 Greg Couch

Modified: python/trunk/Misc/NEWS
==============================================================================
--- python/trunk/Misc/NEWS	(original)
+++ python/trunk/Misc/NEWS	Mon Apr  3 10:05:07 2006
@@ -491,6 +491,10 @@
 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
   now sport attributes that provide access to the parts of the result.
 


More information about the Python-checkins mailing list