New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IDLE should restart instead of hanging when subprocess exits #82876
Comments
This is a spinoff from bpo-38689, about 'strange_callable(' in Shell hanging, because there is an uncaught exception is the run process. (See issue for 'strange_callable'.) Running IDLE from Windows Command Prompt, Windows eventually shows the circle cursor. Clicking on the window turns it gray and trying to close it by clicking 'X' brings up 'Python is not responding' with options to Wait, Close, or Try to Restore. I have seen this before with other code. Restore results in the GUI process RESTARTing a run process and the following in the console. Exception in Tkinter callback
Traceback (most recent call last):
File "f:\dev\3x\lib\idlelib\rpc.py", line 359, in pollpacket
s = self.sock.recv(BUFSIZE)
ConnectionResetError: [WinError 10054] An existing connection was forcibly closed by the remote host
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "f:\dev\3x\lib\idlelib\rpc.py", line 432, in pollresponse
message = self.pollmessage(wait)
File "f:\dev\3x\lib\idlelib\rpc.py", line 384, in pollmessage
packet = self.pollpacket(wait)
File "f:\dev\3x\lib\idlelib\rpc.py", line 361, in pollpacket
raise EOFError
EOFError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "f:\dev\3x\lib\tkinter\__init__.py", line 1885, in __call__
return self.func(*args)
File "f:\dev\3x\lib\idlelib\multicall.py", line 176, in handler
r = l[i](event)
File "f:\dev\3x\lib\idlelib\calltip.py", line 51, in try_open_calltip_event
self.open_calltip(False)
File "f:\dev\3x\lib\idlelib\calltip.py", line 70, in open_calltip
argspec = self.fetch_tip(expression)
File "f:\dev\3x\lib\idlelib\calltip.py", line 95, in fetch_tip
return rpcclt.remotecall("exec", "get_the_calltip",
File "f:\dev\3x\lib\idlelib\rpc.py", line 219, in remotecall
return self.asyncreturn(seq)
File "f:\dev\3x\lib\idlelib\rpc.py", line 248, in asyncreturn
response = self.getresponse(seq, wait=0.05)
File "f:\dev\3x\lib\idlelib\rpc.py", line 291, in getresponse
response = self._getresponse(myseq, wait)
File "f:\dev\3x\lib\idlelib\rpc.py", line 311, in _getresponse
response = self.pollresponse(myseq, wait)
File "f:\dev\3x\lib\idlelib\rpc.py", line 436, in pollresponse
self.handle_EOF()
File "f:\dev\3x\lib\idlelib\pyshell.py", line 389, in handle_EOF
raise EOFError
EOFError (Close, after confirmation, results in nothing except the Windows > prompt.) This suggests to me that the remote process running idlelib.run should have an outer try-except that catches everything and sends "I am stopping" before exiting. The GUI process would then RESTART a new subprocess. There are conditions under which this already happens, so it seems that the current trigger just needs to be broadened. |
@terryjreedy The issue seems to have been resolved. I think we can close the issue. |
Not quite. This issue is about not hanging for any other cause. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: