[New-bugs-announce] [issue13300] IDLE 3.3 Restart Shell command fails

Ned Deily report at bugs.python.org
Mon Oct 31 03:06:39 CET 2011


New submission from Ned Deily <nad at 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 <report at bugs.python.org>
<http://bugs.python.org/issue13300>
_______________________________________


More information about the New-bugs-announce mailing list