[New-bugs-announce] [issue11584] email/header.py: missing str()ification, and bogus encode()s

Steffen Daode Nurpmeso report at bugs.python.org
Thu Mar 17 12:53:47 CET 2011


New submission from Steffen Daode Nurpmeso <sdaoden at googlemail.com>:

My minimal failing test case dragged yet another EMAIL
error to the light!!!
Man, man, man - it's really great that QNX fund money
so that you have the time to fix this broken thing!
It's got washed away, but
http://bugs.python.org/file21210/email_header.diff
can be used on top of 42cd61b96e54 to fix the following:

______
Traceback (most recent call last):
  [FOREIGN CODE]
  File "/Users/steffen/usr/bin/s-postman.py", line 1765, in _bewitch_msg
    self._msg[n] = email.header.make_header(email.header.decode_header(b))
  File "/Users/steffen/usr/opt/py3k/lib/python3.3/email/header.py", line 73, in decode_header
    if not ecre.search(header):
Exception: TypeError: expected string or buffer
______


However, if that's patched in, we end up here

______
Traceback (most recent call last):
  [FOREIGN CODE]
  File "/Users/steffen/usr/bin/s-postman.py", line 1765, in _bewitch_msg
    self._msg[n] = email.header.make_header(email.header.decode_header(b))
  File "/Users/steffen/usr/opt/py3k/lib/python3.3/email/header.py", line 154, in make_header
    h.append(s, charset)
  File "/Users/steffen/usr/opt/py3k/lib/python3.3/email/header.py", line 278, in append
    s.encode(output_charset, errors)
Exception: UnicodeEncodeError: 'ascii' codec can't encode character '\ufffd' in position 7: ordinal not in range(128)
______


Let me know if you want that '456943 17 Mar 12:51 rdm-postman.tbz'
thing, it's waiting for you.
It contains a digest mbox, a config and the patched S-Postman.
Maybe i can strip it to 420000 if i spend some more time on it.

----------
components: Library (Lib)
messages: 131242
nosy: r.david.murray, sdaoden
priority: normal
severity: normal
status: open
title: email/header.py: missing str()ification, and bogus encode()s
versions: Python 3.3

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue11584>
_______________________________________


More information about the New-bugs-announce mailing list