[issue26176] EmailMessage example doesn't work
New submission from Srujan Chaitanya: Example provided in 19.1.14.1. Examples using the Provisional API at https://docs.python.org/3.4/library/email-examples.html?highlight=email%20ex... Doesn't work. This could be a EmailMessage class issue also? ---------- assignee: docs@python components: Documentation messages: 258781 nosy: Srujan Chaitanya, docs@python priority: normal severity: normal status: open title: EmailMessage example doesn't work type: behavior versions: Python 3.4 _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue26176> _______________________________________
Changes by Barry A. Warsaw <barry@python.org>: ---------- nosy: +barry _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue26176> _______________________________________
Changes by Maciej Szulik <soltysh@gmail.com>: ---------- nosy: +maciej.szulik _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue26176> _______________________________________
HyeSoo Park added the comment: Could you please specify which example of the Provisional API among 2 examples of the documentation and how does it not work? Thank you ---------- nosy: +flyjwayur _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue26176> _______________________________________
Julien added the comment: Is this your bug: Traceback (most recent call last): File "/tmp/email_example.py", line 9, in <module> with open(textfile) as fp: NameError: name 'textfile' is not defined ? If not, can you please provide us the full traceback ? ---------- nosy: +sizeof _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue26176> _______________________________________
Ezio Melotti added the comment: #26426 has been marked as duplicate of this, and contains more information about the error. ---------- nosy: +ezio.melotti stage: -> needs patch versions: +Python 3.5, Python 3.6 -Python 3.4 _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue26176> _______________________________________
Nathan Harold added the comment: emailexample.patch fixes the specific issue mentioned in #26426: the Address constructor is now used as documented. It changes the final output of the two combined examples (as presented in the documentation) accordingly. In general it seems as though these examples (the two in in 19.1.14.1) were meant to be read, not run. To run them, the user would have to supply (1) their own roasted-asparagus.jpg, (2) their own local SMTP server, and (3) their own implementation of imaginary.magic_html_parser. However, the Address constructor usage issue was real, and I was able to generate the relevant output without (2) and (3). ---------- keywords: +patch nosy: +nharold Added file: http://bugs.python.org/file43070/emailexample.patch _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue26176> _______________________________________
R. David Murray added the comment: Thank you for the patch. I blame the mistake on too great a familiarity with the old API :) ---------- nosy: +r.david.murray _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue26176> _______________________________________
Changes by R. David Murray <rdmurray@bitdance.com>: ---------- stage: needs patch -> commit review _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue26176> _______________________________________
Roundup Robot added the comment: New changeset 1530fd9a7089 by R David Murray in branch '3.5': #26176: fix usage of Address constructor in email examples. https://hg.python.org/cpython/rev/1530fd9a7089 New changeset a9c11fecd83b by R David Murray in branch 'default': Merge: #26176: fix usage of Address constructor in email examples. https://hg.python.org/cpython/rev/a9c11fecd83b ---------- nosy: +python-dev _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue26176> _______________________________________
R. David Murray added the comment: Thanks, Nathan. ---------- resolution: -> fixed stage: commit review -> resolved status: open -> closed _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue26176> _______________________________________
participants (9)
-
Barry A. Warsaw
-
Ezio Melotti
-
HyeSoo Park
-
Julien
-
Maciej Szulik
-
Nathan Harold
-
R. David Murray
-
Roundup Robot
-
Srujan Chaitanya