crash running archiver: StringIO: expected read buffer, list

Bug #265992 reported by Mbp-users
2
Affects Status Importance Assigned to Milestone
GNU Mailman
Invalid
Medium
Unassigned

Bug Description

Hi,

I'm trying to import some messages into an archive
using the arch command in 2.1.3. This mostly works,
except that a few messages that seem otherwise
well-formed are causing an exception:

mailman@dp:private$ python -i
/usr/local/mailman/bin/arch distcc /tmp/crash2
#00000 <email address hidden>
Pickling archive state into
/var/mailman/archives/private/distcc/pipermail.pck
Traceback (most recent call last):
  File "/usr/local/mailman/bin/arch", line 187, in ?
    main()
  File "/usr/local/mailman/bin/arch", line 175, in main
    archiver.processUnixMailbox(fp, start, end)
  File
"/usr/local/mailman/Mailman/Archiver/pipermail.py",
line 558, in processUnixMailbox
    a = self._makeArticle(m, self.sequence)
  File
"/usr/local/mailman/Mailman/Archiver/HyperArch.py",
line 626, in _makeArticle
    mlist=self.maillist)
  File
"/usr/local/mailman/Mailman/Archiver/HyperArch.py",
line 255, in __init__ self.__super_init(message,
sequence, keepHeaders)
  File
"/usr/local/mailman/Mailman/Archiver/pipermail.py",
line 216, in __init__ s =
StringIO(message.get_payload())
TypeError: expected read buffer, list found

The problem seems to be that cStringIO (unlike plain
StringIO) cannot take a list as a read buffer. It will
only accept a string.

I'm using
Python 2.2.2 (#1, Jan 30 2003, 21:26:22)
[GCC 2.96 20000731 (Red Hat Linux 7.3 2.96-112)] on linux2

But cStringIO's behaviour seems to be the same even on
Python 2.3.2.

The doc string for pythonlib/email/Message.py's
get_payload() function says

        """Return a reference to the payload.

        The payload will either be a list object or a
string. If you mutate
        the list object, you modify the message's
payload in place. Optional
        i returns that index into the payload.

I think this has to be a bug, because if it returns a
list it will certainly break cStringIO.

[http://sourceforge.net/tracker/index.php?func=detail&aid=851970&group_id=103&atid=100103]

Tags: pipermail
Revision history for this message
Mbp-users (mbp-users) wrote :
Revision history for this message
Mbp-users (mbp-users) wrote :

Not only is get_payload() returning a list, but it's not
even a list of strings. So it's no wonder that StringIO is
having trouble.

For the sample message I quoted, get_payload() returns a
2-element list where the elements are instances of
Mailman.Message.Message.

I wonder if I have an old/buggy pythonlib/email library for
some reason, or if some old cruft on redhat is causing the
problem? All of the relevant code seems reasonably close to
python 2.3. And anyhow, the mailman docs say that only
python 2.1 is required.

Revision history for this message
Mbp-users (mbp-users) wrote :

I think this was my error. We had ARCHIVE_SCRUBBER=0 while
we were using MHonArc, but I see that has to be left on the
default for Pipermail to work.

Revision history for this message
Mbp-users (mbp-users) wrote :

My mistake, turning the Scrubber back on fixed it.

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.