This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: email parsedate still wrong (PATCH)
Type: Stage:
Components: Library (Lib) Versions: Python 2.3
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: barry Nosy List: barry, kbob
Priority: normal Keywords:

Created on 2003-04-25 19:40 by kbob, last changed 2022-04-10 16:08 by admin. This issue is now closed.

Messages (2)
msg15614 - (view) Author: Bob Miller (kbob) Date: 2003-04-25 19:40
Under python2.3a2 and current CVS, this script:

       #!/usr/bin/python2.3
        import email.Utils
        d = '25 Feb 2003 13:47:26 -0800'
        print email.Utils.parsedate_tz(d)

prints 'None'.  It should print a tuple.

Here is a patch to the bug, which was apparently
introduced by _parseaddr.py rev 1.5.

tivopc ~ mips> diff -u _parseaddr.py~ _parseaddr.py
--- _parseaddr.py~      Fri Apr 18 19:21:10 2003
+++ _parseaddr.py       Fri Apr 18 19:23:08 2003
@@ -1,4 +1,4 @@
-# Copyright (C) 2002 Python Software Foundation
+# Copyright (C) 2002, 2003 Python Software Foundation
 
 """Email address parsing code.
 
@@ -54,9 +54,9 @@
         del data[0]
     else:
         i = data[0].rfind(',')
-        if i < 0:
-            return None
-        data[0] = data[0][i+1:]
+        if i >= 0:
+            # Trim off the leading dayname.
+            data[0] = data[0][i+1:]
     if len(data) == 3: # RFC 850 date, deprecated
         stuff = data[0].split('-')
         if len(stuff) == 3:
msg15615 - (view) Author: Barry A. Warsaw (barry) * (Python committer) Date: 2003-05-08 03:31
Logged In: YES 
user_id=12800

Thanks Bob.  I like Dan Berlin's patch in SF bug # 732761
better because it doesn't cause regressions in the test
suite.   I'm applying that patch.
History
Date User Action Args
2022-04-10 16:08:20adminsetgithub: 38367
2003-04-25 19:40:36kbobcreate