[Mailman-Users] What causes "decoding Unicode is not supported"?

Mark Sapiro mark at msapiro.net
Thu Sep 3 02:55:14 CEST 2009

Rosenbaum, Larry M. wrote:
>Thank you for the excellent instructions.  Here is the output:
>ornl71# cron/senddigestsx -l dcaplusplus
>List: dcaplusplus: problem processing /usr/local/mailman/lists/dcaplusplus/digest.mbox:
>decoding Unicode is not supported
>Traceback (most recent call last):
>  File "cron/senddigestsx", line 89, in main
>    mlist.send_digest_now()
>  File "/usr/local/mailman/Mailman/Digester.py", line 60, in send_digest_now
>    ToDigest.send_digests(self, mboxfp)
>  File "/usr/local/mailman/Mailman/Handlers/ToDigest.py", line 142, in send_digests
>    send_i18n_digests(mlist, mboxfp)
>  File "/usr/local/mailman/Mailman/Handlers/ToDigest.py", line 339, in send_i18n_digests
>    mcset = msg.get_content_charset('')
>  File "/usr/local/lib/python2.5/email/message.py", line 759, in get_content_charset
>    charset = unicode(charset, 'us-ascii').encode('us-ascii')
>TypeError: decoding Unicode is not supported

Now I'm a bit confused. That line 759 in
/usr/local/lib/python2.5/email/message.py doesn't correlate with any
of the email/message.py modules I have. Instead of the line

    charset = unicode(charset, 'us-ascii').encode('us-ascii')

all the email 4.0.x packages I have have

            if isinstance(charset, str):
                charset = unicode(charset, 'us-ascii')
            charset = charset.encode('us-ascii')
        except UnicodeError:
            return failobj

This should work in your case. What do you get if you invoke python,
import email and display email.__version__? e.g.,

[msapiro at msapiro ~]$ python
Python 2.5.2 (r252:60911, Dec  2 2008, 09:26:14)
[GCC 3.4.4 (cygming special, gdc 0.12, using dmd 0.125)] on cygwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import email
>>> email.__version__

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