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.

Author therve
Recipients
Date 2005-03-02.21:03:14
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
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]
----------------------------------------------------------------
History
Date User Action Args
2007-08-23 14:29:52adminlinkissue1155362 messages
2007-08-23 14:29:52admincreate