diff options
| author | twouters | 2003-03-20 01:54:19 +0000 |
|---|---|---|
| committer | twouters | 2003-03-20 01:54:19 +0000 |
| commit | 65ad4bf04571b96e6dc64663f2745d30f8b8e5e0 (patch) | |
| tree | 8001360667d09139d6aaebada3d08700c858f712 | |
| parent | 1eb1b5717afed1b9068c6213f6e92d9a763e64f0 (diff) | |
| download | mailman-65ad4bf04571b96e6dc64663f2745d30f8b8e5e0.tar.gz mailman-65ad4bf04571b96e6dc64663f2745d30f8b8e5e0.tar.zst mailman-65ad4bf04571b96e6dc64663f2745d30f8b8e5e0.zip | |
| -rw-r--r-- | Mailman/Queue/CommandRunner.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/Mailman/Queue/CommandRunner.py b/Mailman/Queue/CommandRunner.py index 27ecb621e..7d91cca67 100644 --- a/Mailman/Queue/CommandRunner.py +++ b/Mailman/Queue/CommandRunner.py @@ -150,9 +150,15 @@ To obtain instructions, send a message containing just the word "help". resp.append(_('\n- Ignored:')) resp.extend(indent(self.ignored)) resp.append(_('\n- Done.\n\n')) - results = MIMEText( - NL.join(resp), - _charset=Utils.GetCharSet(self.mlist.preferred_language)) + # Encode any unicode strings into the list characterset, + # 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) # Safety valve for mail loops with misconfigured email 'bots. We # don't respond to commands sent with "Precedence: bulk|junk|list" # unless they explicitly "X-Ack: yes", but not all mail 'bots are |
