[ mailman-Bugs-851970 ] crash running archiver: StringIO: expected read buffer, list
![](https://secure.gravatar.com/avatar/954bc49aec1a4e4ce9b032903707ca1e.jpg?s=120&d=mm&r=g)
Bugs item #851970, was opened at 2003-12-01 20:32 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100103&aid=851970&group_id=103 Category: Pipermail Group: 2.1 (stable) Status: Open Resolution: None Priority: 5 Submitted By: Martin Pool (mbp) Assigned to: Nobody/Anonymous (nobody) Summary: crash running archiver: StringIO: expected read buffer, list Initial Comment: 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 <1066876904.6827.10.camel@lisa.thedoh.com> 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. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100103&aid=851970&group_id=103
participants (1)
-
SourceForge.net