New submission from Ned Deily <n...@acm.org>:

Currently in the default (pre-3.3) branch, IDLE fails if its Restart Shell 
command is attempted:

Exception in Tkinter callback
Traceback (most recent call last):
  File "Lib/tkinter/__init__.py", line 1397, in __call__
    return self.func(*args)
  File "Lib/idlelib/PyShell.py", line 1180, in restart_shell
    self.interp.restart_subprocess()
  File "Lib/idlelib/PyShell.py", line 429, in restart_subprocess
    self.rpcclt.accept()
  File "Lib/idlelib/rpc.py", line 525, in accept
    working_sock, address = self.listening_sock.accept()
  File "Lib/socket.py", line 134, in accept
    fd, addr = self._accept()
OSError: [Errno 9] Bad file descriptor
IDLE Subprocess: socket error: Connection refused, retrying....
IDLE Subprocess: socket error: Connection refused, retrying....

Warning (from warnings module):
  File "Lib/idlelib/run.py", line 127
    socket_error = err
ResourceWarning: unclosed <socket.socket object, fd=3, family=2, type=1, 
proto=0>
IDLE Subprocess: socket error: Connection refused, retrying....

The culprit is recent changeset 3a5a0943b201 which attempted to prevent some 
debug ResourceWarnings during IDLE shutdown.  Adding the close override to the 
RPCClient class causes the listening socket to be closed when the shell is 
restarted but then a new listening socket is not opened.  The listening socket 
should only be closed when IDLE terminates, not when the subprocess is 
restarted.

----------
assignee: ned.deily
components: IDLE
messages: 146672
nosy: amaury.forgeotdarc, ned.deily
priority: normal
severity: normal
stage: needs patch
status: open
title: IDLE 3.3 Restart Shell command fails
type: behavior
versions: Python 3.3

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue13300>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to