cope with garbage Date

Bug #558036 reported by donnc
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
GNU Mailman
Fix Released
Undecided
Unassigned

Bug Description

rfc822.parsedate(garbage) -> None

This patch allows archive generation to survive a garbage Date
value. It recognizes the None return and does what it would
have done if Date had been missing.

*** Mailman/Archiver/pipermail.py.dist Sat Dec 7 18:21:58
2002
--- Mailman/Archiver/pipermail.py Wed Jan 15 15:58:31
2003
***************
*** 223,228 ****
--- 223,230 ----
              if datestr is missing:
                  return None
              date = parsedate_tz(datestr)
+ if date is None:
+ return None
              try:
                  return time.mktime(date[:9])
              except (ValueError, OverflowError):
*** Mailman/Handlers/Scrubber.py.dist Fri Dec 20 11:55:43
2002
--- Mailman/Handlers/Scrubber.py Wed Jan 15 16:00:31
2003
***************
*** 73,78 ****
--- 73,80 ----

  def safe_strftime(fmt, floatsecs):
+ if floatsecs is None:
+ return None
      try:
          return time.strftime(fmt, floatsecs)
      except ValueError:

Revision history for this message
twouters (twouters) wrote :

Logged In: YES
user_id=34209

This has already been fixed by making the except block
following the offending pieces of code also catch
'TypeError'. But thanks for the patch :-)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.