classification
Title: IDLE: Disable F5, etc, in Shell and Output windows.
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: miss-islington, taleinat, terry.reedy
Priority: normal Keywords: patch

Created on 2019-10-26 21:03 by terry.reedy, last changed 2019-10-29 18:59 by taleinat. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 16939 merged terry.reedy, 2019-10-26 22:26
PR 16941 merged miss-islington, 2019-10-27 01:15
PR 16942 merged miss-islington, 2019-10-27 01:22
Messages (6)
msg355432 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2019-10-26 21:03
When the Shell is active, the Run menu is disabled, but its shortcuts are not.  These are F5 Run Module, Shift-F5 Run ... Custom, and Alt-X Check Module.  If Shell has not been saved, the shortcuts do nothing, but once Shell has been saved, they try to compile the entire shell session.

The result is that the '3' in 'Python 3.8 ...' on the first line is highlighted as an error and the SyntaxError box pops up.  When the box is dismissed, the cursor is placed after the '3'.

Instead of calling compile, IDLE should beep and continue.
msg355434 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2019-10-26 22:25
Trying to compile grep output is also bad.  The ultimate fix is to subclass the specialized code editor from the general text editor, instead of vice versa as at present, but I leave that for later, and will simply check if the window about to be compiled is an instance of OutputWindow (which is also the PyShell superclass).
msg355437 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2019-10-27 01:15
New changeset e3f90b217a5152275b180b466bd503658a734462 by Terry Jan Reedy in branch 'master':
bpo-38598: Do not try to compile IDLE shell or output windows (GH-16939)
https://github.com/python/cpython/commit/e3f90b217a5152275b180b466bd503658a734462
msg355438 - (view) Author: miss-islington (miss-islington) Date: 2019-10-27 01:32
New changeset 849b1b9f6c538085839f8059e0d6a5536d2fdb52 by Miss Skeleton (bot) in branch '3.7':
bpo-38598: Do not try to compile IDLE shell or output windows (GH-16939)
https://github.com/python/cpython/commit/849b1b9f6c538085839f8059e0d6a5536d2fdb52
msg355439 - (view) Author: miss-islington (miss-islington) Date: 2019-10-27 01:41
New changeset e3a477aa072a737d5119b0778d14d9f3ddb9f587 by Miss Skeleton (bot) in branch '3.8':
bpo-38598: Do not try to compile IDLE shell or output windows (GH-16939)
https://github.com/python/cpython/commit/e3a477aa072a737d5119b0778d14d9f3ddb9f587
msg355669 - (view) Author: Tal Einat (taleinat) * (Python committer) Date: 2019-10-29 18:59
As a better design for a long-term fix, I suggest:

* Avoiding isinstance() checks by instead using a dedicated class attribute and checking that. (I've recently used this pattern for line numbers.)
* Instead of baling out inside the "check module" and "run" handlers, don't include the related items in the menus in the first place. (Make them conditional on the above-mentioned class attribute's value.)
History
Date User Action Args
2019-10-29 18:59:18taleinatsetnosy: + taleinat
messages: + msg355669
2019-10-27 01:42:09terry.reedysetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2019-10-27 01:41:29miss-islingtonsetmessages: + msg355439
2019-10-27 01:32:14miss-islingtonsetnosy: + miss-islington
messages: + msg355438
2019-10-27 01:22:20miss-islingtonsetpull_requests: + pull_request16471
2019-10-27 01:15:26terry.reedysetmessages: + msg355437
2019-10-27 01:15:23miss-islingtonsetpull_requests: + pull_request16470
2019-10-26 22:26:24terry.reedysetkeywords: + patch
stage: needs patch -> patch review
pull_requests: + pull_request16468
2019-10-26 22:25:26terry.reedysetmessages: + msg355434
title: IDLE: Disable F5, etc, in Shell, even after saving -> IDLE: Disable F5, etc, in Shell and Output windows.
2019-10-26 21:03:56terry.reedycreate