[issue13654] IDLE: Freezes and/or crash on SyntaxWarning... is used prior to global declaration

Marco Scataglini report at bugs.python.org
Fri Dec 23 02:23:33 CET 2011


New submission from Marco Scataglini <atlantide at gmx.com>:

Writing the following code in the IDLE module/scriptneditor and then running it (F5) will momentarily freeze without giving the expected warning message ("SyntaxWarning: name 'GLOBAL1' is used prior to global declaration") and it will crash all IDLE windows instances if ran multiple times after it.

------------------
start code snippet:
------------------
GLOBAL1=10

def test_chnge_val_1(a=1):
##    global GLOBAL1
    b=GLOBAL1
    print GLOBAL1, b
    global GLOBAL1
    GLOBAL1 += a
    b= 100
    print GLOBAL1, b
 

if __name__ == '__main__':
    test_chnge_val_1()
----------------
end code snippet:
----------------

The desired behavior is to not crash but run the code with output and shoot the expected message to STOUT/shell console like regular python shell would.


-----
Notes:
-----
issue_global_crash.py code-file attached.

----------
components: IDLE
files: issue_global_crash.py
messages: 150125
nosy: marco
priority: normal
severity: normal
status: open
title: IDLE: Freezes and/or crash on SyntaxWarning... is used prior to global declaration
versions: Python 2.7
Added file: http://bugs.python.org/file24082/issue_global_crash.py

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue13654>
_______________________________________


More information about the Python-bugs-list mailing list