[Mailman-Users] Uncaught runner exception: 'ascii' codec can'tencode character u'\u201c'

Mark Sapiro mark at msapiro.net
Sun Feb 5 20:37:56 CET 2012

Sahil Tandon wrote:

>I am seeing this error with all mail sent to just one (of several)
>mailman mailing lists that are operating without problems.  I found some
>related discussions in the archives, but nothing that (as far as I could
>tell) corresponds to what I am seeing.
>Sorry for my MUA's line wrapping:
>Feb 04 20:31:51 2012 (1176) Uncaught runner exception: 'ascii' codec
>can't encode character u'\u201c' in position 0: ordinal not in
>Feb 04 20:31:51 2012 (1176) Traceback (most recent call last):
>  File "/usr/local/mailman/Mailman/Queue/Runner.py", line 111, in
>    self._onefile(msg, msgdata)
>  File "/usr/local/mailman/Mailman/Queue/Runner.py", line 167, in
>    keepqueued = self._dispose(mlist, msg, msgdata)
>  File "/usr/local/mailman/Mailman/Queue/IncomingRunner.py", line 130,
>in _dispose
>    more = self._dopipeline(mlist, msg, msgdata, pipeline)
>  File "/usr/local/mailman/Mailman/Queue/IncomingRunner.py", line 153,
>in _dopipeline
>    sys.modules[modname].process(mlist, msg, msgdata)
>  File "/usr/local/mailman/Mailman/Handlers/ToDigest.py", line 91, in
>    send_digests(mlist, mboxfp)
>  File "/usr/local/mailman/Mailman/Handlers/ToDigest.py", line 132, in
>    send_i18n_digests(mlist, mboxfp)
>  File "/usr/local/mailman/Mailman/Handlers/ToDigest.py", line 306, in
>    msg = scrubber(mlist, msg)
>  File "/usr/local/mailman/Mailman/Handlers/Scrubber.py", line 182, in
>    charset = part.get_content_charset(lcset)
>  File "/usr/local/mailman/pythonlib/email/Message.py", line 817, in
>    charset = unicode(charset[2], pcharset).encode('us-ascii')
>UnicodeEncodeError: 'ascii' codec can't encode character u'\u201c' in
>position 0: ordinal not in range(128)
>Feb 04 20:31:51 2012 (1176) SHUNTING:
>If I understand the exception correctly, 'position 0' is the first
>character in the shunted pickle file?

No. In fact, the problem has nothing to do with any of the messages
being shunted.

The situation is that the list's lists/LISTNAME/digest.mbox file is
larger than digest_size_threshold, so every post causes an attempt to
produce a digest as it is processed by Mailman/Handlers/ToDigest.py.

The actual error occurs because somewhere in the earlier messages in
digest.mbox there is a message with a Content-Type: message or
sub-part header with a charset="... parameter and the " is not an
ascii quote; it is a unicode 201c left double quotation mark (position
0 in this case is the first character of the value of the charset=

Also see
and perhaps other hits from
and the last content paragraph of the FAQ at

You can edit the digest.mbox and fix the defect, or you can just move
it aside. Either action will allow the list to start working again.

You will want to unshunt the shunted messages because they haven't been
archived or delivered, but I think you will need to remove them from
the digest.mbox if you intend to repair it or they will be duplicated
in the digest.

Note that you must have an old Mailman version. Beginning with Mailman
2.1.7, this issue would not stop the list. It would prevent the digest
from being produced, but the list posts would be processed normally.

Mark Sapiro <mark at msapiro.net>        The highway is for gamblers,
San Francisco Bay Area, California    better use your sense - B. Dylan

More information about the Mailman-Users mailing list