eric ide

Issue33

Classification
Title: missing nonlocal variable leads to crash
Type: crash Product: eric5 snapshot
Process
Priority: urgent    
Status: closed Resolution: fixed
Superseder: Nosy List: detlev, lalop
Assigned to: detlev Keywords:

Created on 2011-10-02.10:25:06 by lalop, last changed by detlev.

Messages (1.0)
msg110 (view) Author: lalop Date: 2011-10-02.10:25:05
Minimal example (in py3 of course):
----
def a():
    def b():
        nonlocal x

Saving, or trying to load this file, leads to the following crash:

---------

Warning:
An unhandled exception occurred.
--------------------------------------------------------------------------------
2011-10-02, 05:21:54
--------------------------------------------------------------------------------
<class 'UnboundLocalError'>: 
local variable 'index' referenced before assignment
--------------------------------------------------------------------------------
File "/usr/lib/python3.1/dist-packages/eric5/ViewManager/ViewManager.py", line 
3508, in saveCurrentEditor
self.saveEditorEd(aw)
File "/usr/lib/python3.1/dist-packages/eric5/ViewManager/ViewManager.py", line 
3496, in saveEditorEd
ok = ed.saveFile()
File "/usr/lib/python3.1/dist-packages/eric5/QScintilla/Editor.py", line 2570, 
in saveFile
self.__autoSyntaxCheck()
File "/usr/lib/python3.1/dist-packages/eric5/QScintilla/Editor.py", line 4376, 
in __autoSyntaxCheck
Utilities.compile(self.fileName or "(Unnamed)", self.text())
File "/usr/lib/python3.1/dist-packages/eric5/Utilities/__init__.py", line 1180, 
in compile
return (True, fn, line, index, code, error)
--------------------------------------------------------------------------------
Version Numbers:
Python 3.1.2
Qt 4.6.2
PyQt4 4.8.5
sip 4.12.4
QScintilla snapshot-2.5.2-9c37c180ba8d
WebKit 532.4
eric5 5.2-snapshot-20110724 (rev c37c49392034)
Platform: linux2
3.1.2 (r312:79147, Sep 27 2010, 09:57:50) 
[GCC 4.4.3]
--------------------------------------------------------------------------------
Plugins Version Numbers:
PluginAbout 5.1.0
PluginEricapi 5.1.0
PluginEricdoc 5.1.0
PluginPep8Checker 5.1.0
PluginRefactoringRope 2.1.0
PluginSyntaxChecker 5.1.0
PluginTabnanny 5.1.0
PluginVcsMercurial 5.1.0
PluginVcsPySvn 5.1.0
PluginVcsSubversion 5.1.0
PluginVmListspace 5.1.0
PluginVmMdiArea 5.1.0
PluginVmTabview 5.1.0
PluginWizardE5MessageBox 5.1.0
PluginWizardPyRegExp 5.1.0
PluginWizardQColorDialog 5.1.0
PluginWizardQFileDialog 5.1.0
PluginWizardQFontDialog 5.1.0
PluginWizardQInputDialog 5.1.0
PluginWizardQMessageBox 5.1.0
PluginWizardQRegExp 5.1.0
--------------------------------------------------------------------------------
Distribution Info:
/etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=10.04
DISTRIB_CODENAME=lucid
DISTRIB_DESCRIPTION="Ubuntu 10.04.3 LTS"
History
Date User Action Args
2011-10-02 10:39:39detlevsetresolution: fixed
status: open -> closed
2011-10-02 10:39:19detlevsetassignedto: detlev
nosy: + detlev
status: new -> open
2011-10-02 10:25:06lalopcreate