Bugs item #1162477, was opened at 2005-03-13 16:11
Message generated for change (Comment added) made by therve
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1162477&group_id=5470
Category: Python Library
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: TH (therve)
Assigned to: Nobody/Anonymous (nobody)
Summary: Parsing failures in parsedate_tz
Initial Comment:
Some email clients send bad-formed datetimes, not
parsed by parsedate_tz (both rfc822.py and
email._parseaddr.py).
The format not recognized is "HH.MM.SS".
I don't know if it's worth taking in account but in
doubt I give a small patch for email._parseaddr :
----------------------------------------------------------------
@@ -90,6 +100,14 @@ def parsedate_tz(data):
tss = '0'
elif len(tm) == 3:
[thh, tmm, tss] = tm
+ elif len(tm) == 1:
+ # Small hack to get HH.MM.ss
+ tm = tm[0].split(".")
+ if len(tm) == 2:
+ [thh, tmm] = tm
+ tss = '0'
+ elif len(tm) == 3:
+ [thh, tmm, tss] = tm
else:
return None
----------------------------------------------------------------
----------------------------------------------------------------------
>Comment By: TH (therve)
Date: 2005-03-20 12:29
Message:
Logged In: YES
user_id=1038797
Of course, here's and example of malformed Date header :
"Wed, 02 Mar 2005 09.26.53 +0800".
----------------------------------------------------------------------
Comment By: Christos Georgiou (tzot)
Date: 2005-03-20 10:36
Message:
Logged In: YES
user_id=539787
It would be helpful if you could provide some of these
malformed Date headers, so that test cases can be generated.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1162477&group_id=5470
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com