R. David Murray added the comment:

Thanks for the suggestion.

Once the issue 11783 patch is committed, smtplib can be changed to use 
formataddr in quoteaddr, which will result in the domain being punycoded 
automatically.  (It's too bad I forgot about that issue, since the 3.4 beta 
deadline has already passed :(

The input to the commands is string, not bytes, so you can already pre-encode 
yourself, as you noted.  The commands don't accept bytes, and should not, since 
the data they cause to be sent on the wire may not contain non-ASCII 
characters; there is thus no need to generate binary.  SMTPUTF8 will of course 
require generating binary data in these contexts, but in that case the correct 
way to generate the binary is by utf-8 encoding the unicode input, so there 
will again be no reason for the commands to accept binary input, and it will be 
better if they don't.  (If you need to generate invalid data, say for a test 
scenario, you can drop down to executing 'send' calls manually.)

(Note: using the 'u' prefix in python3, while supported for backward 
compatibility, is only confusing when used outside of that context...I thought 
you were talking about 2.7 until I read carefully.)

----------
components: +email
dependencies: +email parseaddr and formataddr should be IDNA aware
nosy: +barry, r.david.murray
versions: +Python 3.5

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

Reply via email to