crash running archiver: StringIO: expected read buffer, list
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/
#00000 <email address hidden>
Pickling archive state into
/var/mailman/
Traceback (most recent call last):
File "/usr/local/
main()
File "/usr/local/
archiver.
File
"/usr/local/
line 558, in processUnixMailbox
a = self._makeArtic
File
"/usr/local/
line 626, in _makeArticle
mlist=
File
"/usr/local/
line 255, in __init__ self.__
sequence, keepHeaders)
File
"/usr/local/
line 216, in __init__ s =
StringIO(
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/
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://
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 Message. Message.
2-element list where the elements are instances of
Mailman.
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.