[issue45381] IDLE cannot kill process. "interupt" ctl+c and "restart shell" freeze program.

2021-10-05 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

IDLE uses tk/tkinter text widgets for Editor and Shell windows.  A known 
downside of this is that long lines, greater than about 2000 chars, slow down 
scrolling. See #1442493 for instance.

Part of the Squeezer feature was meant to alleviate this by squeezing long 
lines as well as many lines.  This was meant to be documented but the main 
sentence is garbled a bit and needs to be rewritten.  Squeezer can be partly 
deactivated by raising the threshhold to, for instance, 1_000_000_000.

Another feature of IDLE is that is executes user code in a separate process, 
sending user code output back to the GUI process through a socket.  Massive 
amounts of output are noticeably slower than in the terminal/console.  This can 
be eliminated by starting IDLE with -n.

On my machine, 'a'*n takes about 1 second per 133_333 chars, or 12 for 1.6M.  
160M would take 1200 seconds or 20 minutes.  This of course, has nothing to do 
with any normal use of IDLE.

Keyboard Interrupt, Ctrl-C: It is a known CPython (not IDLE) issue (discussed 
on the tracker) that this does not always interrupt execution of user code.  
This may depend on the OS.  On my machine, I see

'a'*1_600_000  # hit ^C during 12 second wait.
[Squeezed text (20001 lines.)] Traceback (most recent call last):
  File "", line 1, in 
'a'*1_600_000
KeyboardInterrupt

This is not supposed to terminate the execution process, but merely to end 
execution of the statement.  A prompt for another statement should be and for 
me is displayed.  For me, following the above with restart Ctrl-F6 works 
normally.

However, Restart during the wait, with or without ^c, puts IDLE into a 
recoverable state.  Since Restart during time.sleep or 'while True: pass' work, 
I suspect the issue is restarting while receiving input.

--
nosy: +taleinat

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45381] IDLE cannot kill process. "interupt" ctl+c and "restart shell" freeze program.

2021-10-05 Thread A A


New submission from A A :

Idle3 with python 3.7.3 on Debian Buster and XFCE.
Attempting to run the line 'print ("Hello World" * 8**8)' from either the Idle 
shell window or Idle editor will cause Idle to hang and one CPU core runs 
100%.(allowed it to run for several minutes) 
ctl+c or menu Shell>interrupt execution simply pauses CPU processing but does 
not terminate the process nor is there an option to continue the process. 
Following this interrupt with use of menu Shell>Restart-shell causes Idle to 
fully freeze and then requires a system terminate signal to close Idle.
The same line of python used in Idle on another student's MS-Windows laptop 
required ctl-alt-del this was a fresh download with v3.9 as I recall.

When used used on the system Bash shell and python 3.7.3, the line operates 
without any trouble and finishes in 20seconds as: $ python3 -c 'print ( "Hello 
World " * 8**8)' 

Suggestion is that the ctl+c or the Interrupt menu option in Idle should 
terminate the running code rather than pause it.

--
assignee: terry.reedy
components: IDLE
messages: 403259
nosy: capsicumw, terry.reedy
priority: normal
severity: normal
status: open
title: IDLE cannot kill process. "interupt" ctl+c and "restart shell" freeze 
program.
type: behavior
versions: Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com