Title: UnboundLocalError when IDLE cannot connect to its subprocess
Type: Stage:
Components: IDLE Versions: Python 3.0
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: amaury.forgeotdarc, benjamin.peterson
Priority: release blocker Keywords: needs review, patch

Created on 2008-11-21 22:42 by amaury.forgeotdarc, last changed 2008-11-21 23:08 by amaury.forgeotdarc. This issue is now closed.

File name Uploaded Description Edit
idle_socketerror.patch amaury.forgeotdarc, 2008-11-21 22:42
Messages (3)
msg76213 - (view) Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) Date: 2008-11-21 22:42
When IDLE cannot connect to its subprocess, it tries to display the 
socket.error. But since python 3.0 the exception variable is cleared 
after the "except:" block and unavailable for the displaying code.

Exception in thread SockThread:
Traceback (most recent call last):
  File "c:\dev\python\py3k\lib\", line 507, in 
  File "c:\dev\python\py3k\lib\", line 462, in run
    self._target(*self._args, **self._kwargs)
  File "c:\dev\python\py3k\lib\idlelib\", line 125, in 
    show_socket_error(err, address)
UnboundLocalError: local variable 'err' referenced before assignment

Patch is attached.
msg76216 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2008-11-21 23:00
Looks good.
msg76219 - (view) Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) Date: 2008-11-21 23:08
Thanks for the fast review, fixed in r67323
Date User Action Args
2008-11-21 23:08:23amaury.forgeotdarcsetstatus: open -> closed
resolution: fixed
messages: + msg76219
2008-11-21 23:00:01benjamin.petersonsetnosy: + benjamin.peterson
messages: + msg76216
2008-11-21 22:42:47amaury.forgeotdarccreate