[issue14049] execfile() fails on files that use global variables inside functions

2012-02-24 Thread Terry J. Reedy
Terry J. Reedy added the comment: Searching on 'exec NameError' shows that this issue is a duplicate of (behavior issue) #1167300 which contained an essentially identical example" >>> exec """\ ... x = 3 ... def f(): ... print x ... f() ... """ in {}, {} #1167300 was closed as a duplicate

[issue14049] execfile() fails on files that use global variables inside functions

2012-02-18 Thread anatoly techtonik
New submission from anatoly techtonik : main.py below fails to execute local.py, which work ok (outputs '2') when processed directly in console. Docs are not explaining anything. They spread fear and uncertainty around locals, but nothing is said why globals may fail. http://docs.python.org/li