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: IDLE: Saving Shell should not add \n
Type: behavior Stage: resolved
Components: IDLE Versions: Python 3.9, Python 3.8, Python 3.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: terry.reedy Nosy List: ZackerySpytz, miss-islington, miss-islington, terry.reedy
Priority: normal Keywords: patch

Created on 2016-02-12 22:08 by terry.reedy, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 17103 merged ZackerySpytz, 2019-11-10 06:57
PR 17118 merged miss-islington, 2019-11-12 10:54
PR 17119 merged miss-islington, 2019-11-12 10:54
Messages (6)
msg260205 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2016-02-12 22:08
When one saves the IDLE Shell window, at least when the cursor is at the prompt, \n is added, so that

>>> |

changes to

>>>
|

This seems wrong.  It does not happen in editor windows.  I should check Output Windows.
msg356423 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2019-11-12 07:45
Zachary determined that the issue is that writing calls iomenu.IOBinding.fixlastline, which unconditionally adds \n at the end if there is one.  That is not needed for the Shell and wrong when it ends with a prompt, which is the normal case.
msg356436 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2019-11-12 10:54
New changeset c8b53dc3d8f721ed8519aa5a35530a42fbfb9424 by Terry Jan Reedy (Zackery Spytz) in branch 'master':
bpo-26353: IDLE adds an unneeded newline when saving a shell window (GH-17103)
https://github.com/python/cpython/commit/c8b53dc3d8f721ed8519aa5a35530a42fbfb9424
msg356441 - (view) Author: miss-islington (miss-islington) Date: 2019-11-12 11:13
New changeset 177b12682cad7edf9cdea91382acc4232c0167e6 by Miss Islington (bot) in branch '3.7':
bpo-26353: IDLE adds an unneeded newline when saving a shell window (GH-17103)
https://github.com/python/cpython/commit/177b12682cad7edf9cdea91382acc4232c0167e6
msg356442 - (view) Author: miss-islington (miss-islington) Date: 2019-11-12 11:13
New changeset 8ce1a9ce038d1a5fda03ae76964002857a2a52f9 by Miss Islington (bot) in branch '3.8':
bpo-26353: IDLE adds an unneeded newline when saving a shell window (GH-17103)
https://github.com/python/cpython/commit/8ce1a9ce038d1a5fda03ae76964002857a2a52f9
msg356583 - (view) Author: Zackery Spytz (ZackerySpytz) * (Python triager) Date: 2019-11-14 07:35
Thank you, Terry, for modifying the PR and merging it.
History
Date User Action Args
2022-04-11 14:58:27adminsetgithub: 70541
2019-11-14 07:35:51ZackerySpytzsetnosy: + ZackerySpytz
messages: + msg356583
2019-11-12 11:14:07terry.reedysetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2019-11-12 11:13:40miss-islingtonsetnosy: + miss-islington
messages: + msg356442
2019-11-12 11:13:40miss-islingtonsetnosy: + miss-islington
messages: + msg356441
2019-11-12 10:54:32miss-islingtonsetpull_requests: + pull_request16625
2019-11-12 10:54:25miss-islingtonsetpull_requests: + pull_request16624
2019-11-12 10:54:13terry.reedysetmessages: + msg356436
2019-11-12 07:45:33terry.reedysetmessages: + msg356423
versions: + Python 3.7, Python 3.8, Python 3.9, - Python 3.5, Python 3.6
2019-11-10 06:57:52ZackerySpytzsetkeywords: + patch
stage: test needed -> patch review
pull_requests: + pull_request16609
2017-06-19 19:02:53terry.reedysetassignee: terry.reedy
components: + IDLE
2016-02-12 22:08:12terry.reedycreate