crash due to unrecognized mime type

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

Bug Description

Cron sent me a message with this stack trace. The
problem is due to the fact that I'm using Python 2.3b1
with its version of guess_all_extensions which can
return None. The replacement version in Scrubber.py
never returns None. A simple patch is attached.

Traceback (most recent call last):
  File "/var/mailman/cron/senddigests", line 94, in ?
    main()
  File "/var/mailman/cron/senddigests", line 86, in main
    mlist.send_digest_now()
  File "/var/mailman/Mailman/Digester.py", line 60, in
send_digest_now
    ToDigest.send_digests(self, mboxfp)
  File "/var/mailman/Mailman/Handlers/ToDigest.py",
line 130, in send_digests
    send_i18n_digests(mlist, mboxfp)
  File "/var/mailman/Mailman/Handlers/ToDigest.py",
line 303, in send_i18n_digests
    msg = scrubber(mlist, msg)
  File "/var/mailman/Mailman/Handlers/Scrubber.py",
line 257, in process
    url = save_attachment(mlist, part, dir)
  File "/var/mailman/Mailman/Handlers/Scrubber.py",
line 349, in save_attachment
    ext = guess_extension(ctype, fnext)
  File "/var/mailman/Mailman/Handlers/Scrubber.py",
line 80, in guess_extension
    if ext in all:
TypeError: iterable argument required

Revision history for this message
sjoerd (sjoerd-users-sf) wrote :

The file Scrubber.diff was added: patch for crash in Scrubber.py

Revision history for this message
bwarsaw (bwarsaw) wrote :

Logged In: YES
user_id=12800

I wonder if the interface for guess_all_extensions() isn't
broken in Python 2.3? I mean, why not just return an empty
list if there are no extensions found? What advantage does
returning None buy you?

I'd opt for changing (read: fixing :) Python 2.3's
guess_all_extensions().

Revision history for this message
bwarsaw (bwarsaw) wrote :

Logged In: YES
user_id=12800

See my message on python-dev. I have BDFL agreement that
the fix belongs in mimetypes. :)

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.