New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
3 bugs fixed: handling of SyntaxErrors in symbol table build #38750
Comments
All three bugs found in both 2.2.3 and 2.3b2. It's one Bug 1: Wrong file name import symtable
symtable.symtable('def foo(a): global a', 'spam', 'exec') The error message says '<string>' instead of 'spam'. Bug 2: Memory leak while True:
try:
compile('def foo(a): global a', 'spam', 'exec')
except SyntaxError:
pass (Cause: symtable_build doesn't free c->c_symtable on The patch is missing a test case for this one; I don't see Bug 3: Exception clobbered def foo(a):
global a # SyntaxError
def bar():
b = 1
global b # SyntaxWarning Running this as a script, the SyntaxWarning is issued, What to do about bugs 1 and 2 is obvious, but bug 3 symtable_global() sees the global statement in foo(), What the patch implements is this: Do not issue SyntaxWarnings if an exception is pending; Alternatives (and why I don't like them):
|
Logged In: YES Just noticed another alternative: leave the checking of The problem with this idea is that it breaks |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: