[issue1690608] email.utils.formataddr() should be rfc2047 aware

Torsten Becker report at bugs.python.org
Mon Mar 28 11:56:57 CEST 2011


Torsten Becker <torsten.becker at gmail.com> added the comment:

I incorporated that change as well.  My rationale behind the previous version was to be consistent with how Lib/email/header.py handled this, unfortunately I did not look around in the other classes and didn't think about that kind of compatibility.

When formataddr() is called with a object which is not a string and which does not have a header_encode it will raise the following exception now:

> AttributeError: 'CharsetMock' object has no attribute 'header_encode'

Thank you for your patience, sorry that it took probably more of your time by taking 4 iterations for this patch than if you had just implemented it yourself.

----------
Added file: http://bugs.python.org/file21436/issue-1690608-v4.patch

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


More information about the Python-bugs-list mailing list