* Mark Sapiro <[EMAIL PROTECTED]> wrote: > Stefan F�rster wrote: >> # Now join the text and set the payload >> sep = _('-------------- next part --------------\n') >> replace_payload_by_text(msg, sep.join(text), charset) > > The above problem is a bug fixed in 2.1.10. The fixed code is: > > # Now join the text and set the payload > sep = _('-------------- next part --------------\n') > # The i18n separator is in the list's charset. Coerce it to the > # message charset. > try: > s = unicode(sep, lcset, 'replace') > sep = s.encode(charset, 'replace') > except (UnicodeError, LookupError, ValueError, > AssertionError): > pass > replace_payload_by_text(msg, sep.join(text), charset)
Works like a charm, thanks. >> Do you think there might be other occurances of wrongly encoded >> strings read in from the message catalogue or the templates? > > Not that I'm aware of. So, now that I have a temporary fix - how can I recompose a message and sort the attachments? I don't mind if I have to code this myself, I would just appreciate a hint on where to start. For now, a single algorithm like (pseudo code): ,----[ resort message parts ] | init list_of_text_parts = empty; | init list_of_NON_text_parts = empty; | init new_message = empty; | | for part in msg.walk(); | if part.get_content_type() <> 'text/plain' | list_of_NON_text_parts.add(part); | else | list_of_text_parts.add(part); | | for part in list_of_text_parts.walk(); | message.append(part); | | for part in list_of_NON_text_parts.walk() | message.append(part); `---- would absolutely be sufficient. I'm just not familiar enough with Mailman yet to know exactly where to add this code (I don't speak a single line of Python yet, either, but what I wanna do is not really rocket science). Anyways, any help you could give me on that subject would be greatly appreciated. Ciao Stefan -- Stefan F�rster http://www.incertum.net/ Public Key: 0xBBE2A9E9 Heute ist das Gestern von Morgen. Das heute ist die Geburt von Morgen. ------------------------------------------------------ Mailman-Users mailing list Mailman-Users@python.org http://mail.python.org/mailman/listinfo/mailman-users Mailman FAQ: http://www.python.org/cgi-bin/faqw-mm.py Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/ Unsubscribe: http://mail.python.org/mailman/options/mailman-users/archive%40jab.org Security Policy: http://www.python.org/cgi-bin/faqw-mm.py?req=show&file=faq01.027.htp