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.

作者 r.david.murray
收信人 barry, r.david.murray, terry.reedy, torsten.becker
日期 2011-03-27.14:28:54
SpamBayes Score 4.0388616e-07
Marked as misclassified
Message-id <1301236135.4.0.0841833738806.issue1690608@psf.upfronthosting.co.za>
In-reply-to
内容
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.
历史
日期 用户 动作 参数
2011-03-27 14:28:55r.david.murray修改recipients: + r.david.murray, barry, terry.reedy, torsten.becker
2011-03-27 14:28:55r.david.murray修改messageid: <1301236135.4.0.0841833738806.issue1690608@psf.upfronthosting.co.za>
2011-03-27 14:28:54r.david.murray链接issue1690608 messages
2011-03-27 14:28:54r.david.murray创建