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:
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 rep...@bugs.python.org
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
Berker Peksag added the comment:
Thanks for the patch, Baptiste.
--
resolution: - fixed
stage: commit review - resolved
status: open - closed
type: - enhancement
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23511
Berker Peksag added the comment:
LGTM.
--
nosy: +berker.peksag, r.david.murray
stage: - commit review
versions: +Python 3.4, Python 3.5
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23511
Baptiste Mispelon added the comment:
Patch attached.
--
keywords: +patch
Added file: http://bugs.python.org/file38228/issue23511.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23511
___
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 smtplib