[ mailman-Bugs-1430236 ] bin/arch fails with TypeError

SourceForge.net noreply at sourceforge.net
Sun Feb 19 22:50:11 CET 2006

Bugs item #1430236, was opened at 2006-02-12 11:02
Message generated for change (Comment added) made by msapiro
You can respond by visiting: 

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: command line scripts
Group: 2.1 (stable)
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Andreas Thienemann (ixsnet)
Assigned to: Nobody/Anonymous (nobody)
Summary: bin/arch fails with TypeError

Initial Comment:
[root at bender mailman]# bin/arch -s 15965 -e 15965
Pickling archive state into
Traceback (most recent call last):
  File "bin/arch", line 200, in ?
  File "bin/arch", line 188, in main
    archiver.processUnixMailbox(fp, start, end)
line 569, in processUnixMailbox
    m = mbox.next()
  File "/usr/lib/python2.2/mailbox.py", line 34, in next
    return self.factory(_Subfile(self.fp, start, stop))
  File "/opt/mailman-2.1.7/Mailman/Mailbox.py", line
89, in scrubber
    return mailbox.scrub(msg)
  File "/opt/mailman-2.1.7/Mailman/Mailbox.py", line
109, in scrub
    return self._scrubber(self._mlist, msg)
"/opt/mailman-2.1.7/Mailman/Handlers/Scrubber.py", line
352, in process
    t = part.get_payload(decode=decode)
  File "/opt/mailman-2.1.7/pythonlib/email/Message.py",
line 213, in get_payload
    return Utils._qdecode(payload)
  File "/usr/lib/python2.2/quopri.py", line 161, in
    return a2b_qp(s, header = header)
TypeError: argument 1 must be string or read-only
buffer, not None


>Comment By: Mark Sapiro (msapiro)
Date: 2006-02-19 13:50

Logged In: YES 

Patch is commited to CVS.


Comment By: Andreas Thienemann (ixsnet)
Date: 2006-02-19 07:16

Logged In: YES 

Thanks a lot.
The patch works so far as arch does not traceback anymore.

The attachment gets handled as follows:

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: /
Size: 0 bytes
Desc: not available
Url : blabla

So yes, it's satisfactory.


Comment By: Mark Sapiro (msapiro)
Date: 2006-02-16 21:19

Logged In: YES 

The underlying cause of this problem is the fact that the
original message contains a subpart of type
message/delivery-status which in turn contains a text/plain
'returned message'. The reason this is a problem is that the
Python email library parses message/delivery-status parts
differently from other MIME parts. It considers groups of
lines separated from each other by empty lines to each be
the headers of a sub-part of the message/delivery-status
part, and these sub-parts all have only headers and no bodies.

One of these sub-parts in this case has headers with
content-type text/plain which causes scrubber to try to
include the decoded body of this part in the flattened
text/plain message which causes the error.

The attached patch will catch the exception in this case and
allow the message to be added to the archive, but the entire
message/delivery-status part will not be in the archived
message because the parser treats it as all headers and no body.

Please try the patch and report whether you think this is


You can respond by visiting: 

More information about the Mailman-coders mailing list