[issue23511] Broken code example in email module documentation

2015-02-25 Thread Berker Peksag
Berker Peksag added the comment: Thanks for the patch, Baptiste. -- resolution: -> fixed stage: commit review -> resolved status: open -> closed type: -> enhancement ___ Python tracker ___

[issue23511] Broken code example in email module documentation

2015-02-25 Thread Roundup Robot
Roundup Robot added the comment: New changeset 89c6a6c2dd1f by Berker Peksag in branch '3.4': Issue #23511: Port email-simple.py to Python 3. https://hg.python.org/cpython/rev/89c6a6c2dd1f New changeset cb911e1fb3dc by Berker Peksag in branch 'default': Issue #23511: Port email-simple.py to Pyth

[issue23511] Broken code example in email module documentation

2015-02-25 Thread Baptiste Mispelon
Baptiste Mispelon added the comment: I wasn't sure if that was going to be out of scope or not. Here's an attached patch that fixes the remaining usages of `open` inside `Doc/includes` to always use a context manager. -- Added file: http://bugs.python.org/file38233/issue23511_open_cm.d

[issue23511] Broken code example in email module documentation

2015-02-25 Thread R. David Murray
R. David Murray added the comment: Looks like the example wasn't updated during the python3 transition. As long as we are changing it, we might as well make it use the file as a context manager. -- ___ Python tracker

[issue23511] Broken code example in email module documentation

2015-02-24 Thread Berker Peksag
Berker Peksag added the comment: LGTM. -- nosy: +berker.peksag, r.david.murray stage: -> commit review versions: +Python 3.4, Python 3.5 ___ Python tracker ___ _

[issue23511] Broken code example in email module documentation

2015-02-24 Thread Baptiste Mispelon
Baptiste Mispelon added the comment: Patch attached. -- keywords: +patch Added file: http://bugs.python.org/file38228/issue23511.diff ___ Python tracker ___ _

[issue23511] Broken code example in email module documentation

2015-02-24 Thread Baptiste Mispelon
New submission from Baptiste Mispelon: The first code example at https://docs.python.org/3.5/library/email-examples.html throws an `AttributeError` because `MIMEText`'s constructor expects a `str` object, not a `bytes` one: >>> # Import smtplib for the actual sending function ... import smtpl