[Python-bugs-list] [ python-Bugs-727719 ] email parsedate still wrong (PATCH)
SourceForge.net
noreply@sourceforge.net
Fri, 25 Apr 2003 13:04:05 -0700
Bugs item #727719, was opened at 2003-04-25 15:40
Message generated for change (Settings changed) made by bwarsaw
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=727719&group_id=5470
Category: Python Library
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Bob Miller (kbob)
>Assigned to: Barry A. Warsaw (bwarsaw)
Summary: email parsedate still wrong (PATCH)
Initial Comment:
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:
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=727719&group_id=5470