This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author r.david.murray
Recipients barry, r.david.murray, terry.reedy, torsten.becker
Date 2011-03-27.14:28:54
SpamBayes Score 4.0388616e-07
Marked as misclassified No
Message-id <1301236135.4.0.0841833738806.issue1690608@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2011-03-27 14:28:55r.david.murraysetrecipients: + r.david.murray, barry, terry.reedy, torsten.becker
2011-03-27 14:28:55r.david.murraysetmessageid: <1301236135.4.0.0841833738806.issue1690608@psf.upfronthosting.co.za>
2011-03-27 14:28:54r.david.murraylinkissue1690608 messages
2011-03-27 14:28:54r.david.murraycreate