Bugs item #1162477, was opened at 2005-03-13 16:11 Message generated for change (Tracker Item Submitted) made by Item Submitter 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 ---------------------------------------------------------------- ---------------------------------------------------------------------- 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