This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: UnboundLocalError when IDLE cannot connect to its subprocess
Type: Stage:
Components: IDLE Versions: Python 3.0
process
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 2022-04-11 14:56 by admin. This issue is now closed.

Files
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\threading.py", line 507, in 
_bootstrap_inner
    self.run()
  File "c:\dev\python\py3k\lib\threading.py", line 462, in run
    self._target(*self._args, **self._kwargs)
  File "c:\dev\python\py3k\lib\idlelib\run.py", line 125, in 
manage_socket
    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
History
Date User Action Args
2022-04-11 14:56:41adminsetgithub: 48633
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