[Mailman-Users] inexplicable UnicodeError
Pablo Chamorro C.
pchamorro at ingeomin.gov.co
Fri Nov 7 17:30:15 CET 2003
Given my circunstances I tried including these lines from Mailman 2.1.3:
# Encode any unicode strings into the list charset, so we don't try to
# join unicode strings and invalid ASCII.
charset = Utils.GetCharSet(self.mlist.preferred_language)
encoded_resp = []
for item in resp:
if isinstance(item, UnicodeType):
item = item.encode(charset, 'replace')
encoded_resp.append(item)
results = MIMEText(NL.join(encoded_resp), _charset=charset)
and commenting these:
# results = MIMEText(
# NL.join(resp),
# _charset=Utils.GetCharSet(self.mlist.preferred_language))
and (in spite of my ignorance) it seems it works!
Pablo
On Thu, 6 Nov 2003, Pablo Chamorro C. wrote:
> As I wrote, I have in my mm_cfg.py for Spanish lists (Mailman 2.1.1):
>
> DEFAULT_CHARSET = 'iso-8859-1'
> VERBATIM_ENCODING = ['iso-8859-1']
>
> I know that there are problems with the 'who <password>' command when the
> user's names include certain characters, but right now I was playing with
> the command 'who' without adding or deleting users and suddenly (after
> some 10 who requests) I stop receiving the answers and found this in the
> error log file:
>
> Nov 06 17:10:36 2003 (9455) Uncaught runner exception: ASCII decoding
> error: ordinal not in range(128)
> Nov 06 17:10:36 2003 (9455) Traceback (most recent call last):
> File "/var/mailman/Mailman/Queue/Runner.py", line 105, in _oneloop
> self._onefile(msg, msgdata)
> File "/var/mailman/Mailman/Queue/Runner.py", line 155, in _onefile
> keepqueued = self._dispose(mlist, msg, msgdata)
> File "/var/mailman/Mailman/Queue/CommandRunner.py", line 218, in
> _dispose
> res.send_response()
> File "/var/mailman/Mailman/Queue/CommandRunner.py", line 147, in
> send_response
> results = MIMEText(
> UnicodeError: ASCII decoding error: ordinal not in range(128)
>
> Some idea to fix this? It has happened to me several times under similar
> conditions not related with the users names.
More information about the Mailman-Users
mailing list