R. David Murray <rdmur...@bitdance.com> added the comment:

The general approach of the patch looks good to me.  Since formataddr is 
designed to be called from user code that is constructing a message, having it 
raise for non-ascii in the address is probably OK.  However, there should be a 
test for that, and I'm curious to know what happens if you use such an address 
in an address field in the unmodified email package.

Instead of directly calling bencode, you should use the charset module and its 
header_encode method.  Note that you need to turn the charset into a Charset 
instance first.  The advantage of doing this is that it will choose the "best" 
encoding to use based on the charset and the contents of the string.

Your choice of location for the new tests is fine; TestMiscelaneous really 
should be split up a bit, but that will wait until I do a general refactoring 
of the tests.

Thanks for working on this.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue1690608>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to