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

Rosenbaum, Larry M. rosenbaumlm at ornl.gov
Thu Sep 3 16:35:35 CEST 2009


> From: Mark Sapiro [mailto:mark at msapiro.net]
> 
> 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
> 
>         try:
>             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__
> '4.0.2'
> >>>

ornl71# python
Python 2.5 (r25:51908, Sep 20 2006, 06:18:53)
[GCC 3.4.6] on sunos5
Type "help", "copyright", "credits" or "license" for more information.
>>> import email
>>> email.__version__
'4.0.1'


More information about the Mailman-Users mailing list