[issue10189] SyntaxError: no binding for nonlocal doesn't contain a useful traceback

2012-10-31 Thread Roundup Robot
Roundup Robot added the comment: New changeset fbfaef0a9c00 by Benjamin Peterson in branch 'default': point errors related to nonlocals and globals to the statement declaring them (closes #10189) http://hg.python.org/cpython/rev/fbfaef0a9c00 -- nosy: +python-dev resolution: -> fixed st

[issue10189] SyntaxError: no binding for nonlocal doesn't contain a useful traceback

2010-10-26 Thread R. David Murray
R. David Murray added the comment: Ah, I hadn't noticed Benjamin assigned this to himself when I submitted that patch. Well, maybe it will be marginally useful anyway :) -- ___ Python tracker ___

[issue10189] SyntaxError: no binding for nonlocal doesn't contain a useful traceback

2010-10-26 Thread R. David Murray
R. David Murray added the comment: Yes, but in that particular case the exact line referenced is involved in the error, since it that error is that the symbol is both nonlocal and an argument, and the error points to the head of the block which is the 'def' statement. Attached is a patch that

[issue10189] SyntaxError: no binding for nonlocal doesn't contain a useful traceback

2010-10-26 Thread R. David Murray
Changes by R. David Murray : -- Removed message: http://bugs.python.org/msg119601 ___ Python tracker ___ ___ Python-bugs-list mailing

[issue10189] SyntaxError: no binding for nonlocal doesn't contain a useful traceback

2010-10-26 Thread R. David Murray
R. David Murray added the comment: Yes, but in that particular case the exact line referenced is involved in the error, since it that error is that the symbol is both nonlocal and an argument, and the error points to the head of the block which is the 'def' statement. Attached is a patch that

[issue10189] SyntaxError: no binding for nonlocal doesn't contain a useful traceback

2010-10-25 Thread Benjamin Peterson
Changes by Benjamin Peterson : -- assignee: -> benjamin.peterson ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe

[issue10189] SyntaxError: no binding for nonlocal doesn't contain a useful traceback

2010-10-25 Thread Georg Brandl
Georg Brandl added the comment: +1 for adding at least the info the symtable knows (this is already done in one of the branches in that function that raises a SyntaxError). -- nosy: +georg.brandl ___ Python tracker

[issue10189] SyntaxError: no binding for nonlocal doesn't contain a useful traceback

2010-10-24 Thread R. David Murray
R. David Murray added the comment: I figured it was something like that, from looking at the code. I wonder if it would be worthwhile to return the line info that is known (which I think is the start of the block containing the problematic symbol). In a complex program that would at least ge

[issue10189] SyntaxError: no binding for nonlocal doesn't contain a useful traceback

2010-10-24 Thread Benjamin Peterson
Benjamin Peterson added the comment: Technically, it's because the syntax errors come from a latter part of the compiling phase when the origin of names isn't known. Fixing this would involve attaching line numbers and offsets to names somehow. -- nosy: +benjamin.peterson ___

[issue10189] SyntaxError: no binding for nonlocal doesn't contain a useful traceback

2010-10-24 Thread R. David Murray
R. David Murray added the comment: Hmm. Just to clarify, the commit message on the code in question specifically said that the implementation of nonlocal was not complete with that commit, and Jeremy wasn't the only one working on it. So this detail may have simply been overlooked. ---

[issue10189] SyntaxError: no binding for nonlocal doesn't contain a useful traceback

2010-10-24 Thread R. David Murray
R. David Murray added the comment: There are a number of such symbol resolution error messages for nonlocal that don't provide location information in symtable.c. I'm not very experienced with hacking the C code, but a naive addition of location information based on similar calls that do pro

[issue10189] SyntaxError: no binding for nonlocal doesn't contain a useful traceback

2010-10-24 Thread Alex
New submission from Alex : Given the code: def f(): def g(): nonlocal a a = 3 Running it produces: a...@alex-laptop:/tmp$ python3.1 test.py SyntaxError: no binding for nonlocal 'a' found Compared to a different SyntaxError: a...@alex-laptop:/tmp$ python3.1 test.py Fil