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:
|