Bugs item #1155362, was opened at 2005-03-02 16:03
Message generated for change (Settings changed) made by bwarsaw
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1155362&group_id=5470

Category: Python Library
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: TH (therve)
>Assigned to: Barry A. Warsaw (bwarsaw)
Summary: Bugs in parsedate_tz

Initial Comment:
The parsing in emails is incomplete in both rfc822.py
and _parseaddr.py.

For example, "Wed, 02 Mar 2005 09:26:53+0800" is parsed
but "Wed, 02 Mar 2005 09:26:53-0800" is not.

The problem is clear by watching the code : only "+"
timezones are corrected.
Following a patch :

Index : _parseaddr.py
----------------------------------------------------------------
@@ -60,7 +66,11 @@ def parsedate_tz(data):
         if i > 0:
             data[3:] = [s[:i], s[i+1:]]
         else:
-            data.append('') # Dummy tz
+           i = s.find('-')
+           if i > 0:
+               data[3:] = [s[:i], s[i:]]
+           else:
+               data.append('') # Dummy tz
     if len(data) < 5:
         return None
     data = data[:5]
----------------------------------------------------------------

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1155362&group_id=5470
_______________________________________________
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to