bin/arch fails with TypeError
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
GNU Mailman |
Fix Released
|
Medium
|
Unassigned |
Bug Description
[root@bender mailman]# bin/arch -s 15965 -e 15965
bawue-net-admin
archives/
Pickling archive state into
/opt/mailman-
Traceback (most recent call last):
File "bin/arch", line 200, in ?
main()
File "bin/arch", line 188, in main
archiver.
File
"/opt/mailman-
line 569, in processUnixMailbox
m = mbox.next()
File "/usr/lib/
return self.factory(
File "/opt/mailman-
89, in scrubber
return mailbox.scrub(msg)
File "/opt/mailman-
109, in scrub
return self._scrubber(
File
"/opt/mailman-
352, in process
t = part.get_
File "/opt/mailman-
line 213, in get_payload
return Utils._
File "/usr/lib/
decodestring
return a2b_qp(s, header = header)
TypeError: argument 1 must be string or read-only
buffer, not None
[http://
The underlying cause of this problem is the fact that the delivery- status which in turn contains a text/plain delivery- status parts delivery- status
original message contains a subpart of type
message/
'returned message'. The reason this is a problem is that the
Python email library parses message/
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/
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 delivery- status part will not be in the archived
allow the message to be added to the archive, but the entire
message/
message because the parser treats it as all headers and no body.
Please try the patch and report whether you think this is
satisfactory.