Issue 12448: smtplib's main doesn't flush when prompting (original) (raw)

Created on 2011-06-30 06:20 by anacrolix, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
smtplib_main_prompt.patch petri.lehtinen,2011-07-03 20:05
Messages (6)
msg139461 - (view) Author: Matt Joiner (anacrolix) Date: 2011-06-30 06:20
The smptlib module's __main__ doesn't flush stdout when prompting: sys.stdout.write(prompt + ": ") return sys.stdin.readline().strip() stdout is usually line buffered, and so running python3 smptlib.py doesn't actually prompt the user. The line `sys.stdout.flush()` needs to be added.
msg139699 - (view) Author: Petri Lehtinen (petri.lehtinen) * (Python committer) Date: 2011-07-03 20:05
Behaves incorrectly for me, too. Attached a patch with the suggested fix.
msg141063 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2011-07-24 23:24
Looks good. Thx.
msg145787 - (view) Author: Petri Lehtinen (petri.lehtinen) * (Python committer) Date: 2011-10-18 08:54
Raymond: Would you also like to commit the patch? :)
msg145793 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2011-10-18 10:27
New changeset 2c50343d0500 by Ezio Melotti in branch '3.2': #12448: smtplib now flushes stdout while running ``python -m smtplib`` http://hg.python.org/cpython/rev/2c50343d0500 New changeset e08397a5537a by Ezio Melotti in branch 'default': #12448: merge with 3.2. http://hg.python.org/cpython/rev/e08397a5537a
msg145794 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2011-10-18 10:29
Fixed, thanks for the patch!
History
Date User Action Args
2022-04-11 14:57:19 admin set github: 56657
2011-10-18 10:29:29 ezio.melotti set status: open -> closedassignee: rhettinger -> ezio.melottiversions: + Python 3.3nosy: + ezio.melottimessages: + resolution: fixedstage: patch review -> resolved
2011-10-18 10:27:02 python-dev set nosy: + python-devmessages: +
2011-10-18 08:54:36 petri.lehtinen set keywords: - needs reviewmessages: +
2011-07-24 23:24:32 rhettinger set assignee: rhettingermessages: + nosy: + rhettinger
2011-07-24 19:44:25 petri.lehtinen set stage: patch review
2011-07-03 20:05:25 petri.lehtinen set files: + smtplib_main_prompt.patchnosy: + petri.lehtinenmessages: + keywords: + patch, needs review
2011-06-30 14:10:35 r.david.murray set nosy: + r.david.murray
2011-06-30 06:20:26 anacrolix create