email/Message.py set_charset() barfs on unicode, breaks mailman digesting

Bug #224182 reported by James Troup
2
Affects Status Importance Assigned to Milestone
python2.4 (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: python2.4

mailman digests breaks with python2.4's email module, e.g.

Apr 29 13:44:22 2008 (31878) Traceback (most recent call last):
  File "/usr/lib/mailman/Mailman/Queue/Runner.py", line 111, in _oneloop
    self._onefile(msg, msgdata)
  File "/usr/lib/mailman/Mailman/Queue/Runner.py", line 167, in _onefile
    keepqueued = self._dispose(mlist, msg, msgdata)
  File "/usr/lib/mailman/Mailman/Queue/ArchRunner.py", line 73, in _dispose
    mlist.ArchiveMail(msg)
  File "/var/lib/mailman/Mailman/Archiver/Archiver.py", line 214, in ArchiveMail
    h.processUnixMailbox(f)
  File "/usr/lib/mailman/Mailman/Archiver/pipermail.py", line 564, in processUnixMailbox
    m = mbox.next()
  File "/usr/lib/python2.4/mailbox.py", line 35, in next
    return self.factory(_Subfile(self.fp, start, stop))
  File "/var/lib/mailman/Mailman/Mailbox.py", line 89, in scrubber
    return mailbox.scrub(msg)
  File "/var/lib/mailman/Mailman/Mailbox.py", line 109, in scrub
    return self._scrubber(self._mlist, msg)
  File "/var/lib/mailman/Mailman/Handlers/Scrubber.py", line 397, in process
    replace_payload_by_text(msg, sep.join(text), charset)
  File "/var/lib/mailman/Mailman/Handlers/Scrubber.py", line 175, in replace_payload_by_text
    msg.set_payload(text, charset)
  File "/usr/lib/python2.4/email/Message.py", line 218, in set_payload
    self.set_charset(charset)
  File "/usr/lib/python2.4/email/Message.py", line 242, in set_charset
    raise TypeError(charset)
TypeError: windows-1252

The attached patch fixes the problem for us. From a brief glance, it appears this has been fixed in python2.5.

CVE References

Revision history for this message
James Troup (elmo) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package python2.4 - 2.4.5-3ubuntu1

---------------
python2.4 (2.4.5-3ubuntu1) intrepid; urgency=low

  * Merge with Debian; remaining changes:
    - Include pregenerated documentation.
    - Build the -doc package from this source.

python2.4 (2.4.5-3) unstable; urgency=low

  * Backport new function signal.set_wakeup_fd from the trunk.
    Background: http://bugzilla.gnome.org/show_bug.cgi?id=481569
  * Fix some lintian warnings.
  * Do not add /usr/lib/pythonXY.zip on sys.path. Closes: #474338.
  * Install the plistlib.py module in sys.path (as done on the trunk).
    Closes: #386738.
  * Fix email/Message.py set_charset() barfing on unicode. LP: #224182.
  * Add debian/README.source.

python2.4 (2.4.5-2) unstable; urgency=low

  * Fix CVE-2008-1679, integer overflows in the imageop module.
  * Fix CVE-2008-1721, integer signedness error in the zlib extension module.
  * Fix CVE-2008-1887, issue2587, PyString_FromStringAndSize() to be
    considered unsafe.
  * Patches prepared by Moritz Muehlenhoff.

 -- Matthias Klose <email address hidden> Wed, 25 Jun 2008 13:43:30 +0200

Changed in python2.4:
status: New → Fix Released
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.