Steffen Daode Nurpmeso <sdao...@googlemail.com> added the comment: You're indeed right, i've overseen a try..catch! I'll even be able to give you some fast code hints now (and i'll be offline the next few hours - the mails are simply mails with illegal charsets, say):
Traceback (most recent call last): File "/Users/steffen/tmp/y/s-postman.py", line 1098, in <module> sys.exit(main()) File "/Users/steffen/tmp/y/s-postman.py", line 1088, in main xclass = xclass() # Impl. class chosen upon commline args File "/Users/steffen/tmp/y/s-postman.py", line 951, in __init__ self._walk() def _walk(self): verb("--dispatch: starting iteration over input boxes") for b, t in _Dispatch_Boxes: box = open_mailbox(b, type=t, create=False) try: self._do_box(box) except Exception as e: raise File "/Users/steffen/tmp/y/s-postman.py", line 958, in _walk self._do_box(box) def _do_box(self, box): cnt = len(box) log("* Box contains ", cnt, " messages") for nr in range(cnt): log(" * Dispatching message ", nr+1) msg = box.get_message(nr) Ticket.process_msg(msg) log(" @ Dispatched ", cnt, " messages, finished box") File "/Users/steffen/tmp/y/s-postman.py", line 982, in _do_box Ticket.process_msg(msg) @staticmethod def process_msg(msg): ticket = Ticket(msg) (match, ruleset, to_box) = Ruleset.dispatch_ticket(ticket) if not match: to_box.add_ticket(ticket) return splitter = to_box.get_archive_splitter() if not splitter or config.get_keep_archives(): to_box.add_ticket(ticket) return log(" @ Treating ticket ", ticket._id, " as archive, splitting") for msg in splitter(msg): ticket = Ticket(msg) to_box.add_ticket(ticket) File "/Users/steffen/tmp/y/s-postman.py", line 898, in process_msg to_box.add_ticket(ticket) def add_ticket(self, ticket, ignore_errors=False): efun = panic if ignore_errors: efun = error log(" @ Saving ticket ", ticket.get_id(), " in \"", self._ident, "\"") mbox = self._mailbox if not mbox: mbox = os.path.join(config.get_folder(), self._path) mbox = open_mailbox(mbox, type=self._type, create=True) self._mailbox = mbox try: mbox.lock() except Exception as e: efun("Could not gain mailbox lock!") try: mbox.add(ticket.get_msg()) mbox.flush() except Exception as e: #efun("Box ", self._ident, # ": message-add failed, ", # "mails may be lost: ", str(e)) raise File "/Users/steffen/tmp/y/s-postman.py", line 680, in add_ticket mbox.add(ticket.get_msg()) File "/Users/steffen/usr/lib/python3.2/mailbox.py", line 259, in add self._dump_message(message, tmp_file) File "/Users/steffen/usr/lib/python3.2/mailbox.py", line 205, in _dump_message gen.flatten(message) File "/Users/steffen/usr/lib/python3.2/email/generator.py", line 88, in flatten self._write(msg) File "/Users/steffen/usr/lib/python3.2/email/generator.py", line 141, in _write self._write_headers(msg) File "/Users/steffen/usr/lib/python3.2/email/generator.py", line 372, in _write_headers header_name=h) File "/Users/steffen/usr/lib/python3.2/email/header.py", line 197, in __init__ self.append(s, charset, errors) File "/Users/steffen/usr/lib/python3.2/email/header.py", line 275, in append s.encode(output_charset, errors) UnicodeEncodeError: 'ascii' codec can't encode character '\ufffd' in position 8: ordinal not in range(128) ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue9124> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com