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

The new policies *make* the email library that higher level library, that was 
pretty much the whole point :)  I don't know how to make getting the fully 
decoded subject more intuitive than:

  msg['subject']

The fact that you have to specify a policy is due to backward compatibility 
concerns, and there's not really any way around that.  That's the only 
difference between your two examples (other than the fact that the second one 
does what you want :).

Note that you *really* want to be using message_from_bytes, and for email 
either policy.default or policy.SMTP.  This *is* documented in the python3 
docs.  If you don't find them clear, then an issue to improve the docs would be 
welcome.

Since python2 is approaching EOL, we could also start transitioning to 
policy.default actually being the *default*.  That will take two release cycles 
(one that will generate a deprecation notice that the default is going to 
change, and another that will actually make the change).

----------
status: open -> closed

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

Reply via email to