This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Use print(file=sys.stderr) instead of sys.stderr.write() in IDLE
Type: Stage: resolved
Components: IDLE Versions: Python 3.4, Python 3.5, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: kbk, orsenthil, python-dev, roger.serwy, serhiy.storchaka, terry.reedy
Priority: normal Keywords: patch

Created on 2014-09-15 19:15 by serhiy.storchaka, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
idle_print_stderr.patch serhiy.storchaka, 2014-09-15 19:15 review
Messages (4)
msg226934 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2014-09-15 19:15
Proposed patch replaces print(file=sys.stderr) by sys.stderr.write() in IDLE for same reason as in issue22384. May be this will eliminate some "crashes" when IDLE run with pythonw.exe.
msg226937 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2014-09-15 20:05
You meant it the other way around 'replace sys.stderr.write() by print(file=sys.stderr)'.  In the two cases where Idle exits anyway, this will not make any difference (except possible in the return code).  In the other cases where Idle tries to continue, this will.  The real fix needed is to replace stderr, at least when None, so that the messages are displayed in a gui widget.  However, if I cannot do that this week, before 3.4.2, I will apply this. Thanks for the patch.
msg226984 - (view) Author: Senthil Kumaran (orsenthil) * (Python committer) Date: 2014-09-17 07:19
Reviewed the patch. Looks good to go.
msg227140 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2014-09-20 02:39
New changeset 90a2a12fa34d by Terry Jan Reedy in branch '2.7':
Issue #22420: Avoid 'write to None' crashes by using print instead.
https://hg.python.org/cpython/rev/90a2a12fa34d

New changeset 42b03d5b1cbb by Terry Jan Reedy in branch '3.4':
Issue #22420: Avoid 'write to None' crashes by using print instead.
https://hg.python.org/cpython/rev/42b03d5b1cbb

New changeset ab050bd7e51c by Terry Jan Reedy in branch 'default':
Issue #22420: Merge with 3.4
https://hg.python.org/cpython/rev/ab050bd7e51c
History
Date User Action Args
2022-04-11 14:58:08adminsetgithub: 66610
2014-09-20 02:41:02terry.reedysetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2014-09-20 02:39:50python-devsetnosy: + python-dev
messages: + msg227140
2014-09-17 07:19:48orsenthilsetnosy: + orsenthil
messages: + msg226984
2014-09-15 20:05:04terry.reedysetmessages: + msg226937
2014-09-15 19:15:48serhiy.storchakasetnosy: + terry.reedy, kbk, roger.serwy
2014-09-15 19:15:20serhiy.storchakacreate