[issue6323] Py3.1 pdb doesn't deal well with syntax errors

2009-07-09 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Fixed in r73918 (py3k) and r73920 (release31-maint). Thanks for the report! -- resolution: -> fixed status: open -> closed ___ Python tracker __

[issue6323] Py3.1 pdb doesn't deal well with syntax errors

2009-07-09 Thread Andreas Kloeckner
Andreas Kloeckner added the comment: Vladislav: The behavior you find funny is actually correct. "pass" is a statement and as such not allowed in a lambda. (only expressions are) Your posting is unrelated to this bug report. If you're still confused, please ask on comp.lang.python. -- c

[issue6323] Py3.1 pdb doesn't deal well with syntax errors

2009-07-09 Thread Vladislav
Vladislav added the comment: >>> lambda: pass SyntaxError: invalid syntax (, line 1) >>> lambda: pas at 0x00F5C858> >>> func_1=lambda: pas >>> func_1() Traceback (most recent call last): File "", line 1, in func_1() File "", line 1, in func_1=lambda: pas NameError: global name 'pa

[issue6323] Py3.1 pdb doesn't deal well with syntax errors

2009-06-22 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Good point. So in the end, we just replaced exec('%s')# wrong when the text is "x='a'" with exec(%r) -- ___ Python tracker ___

[issue6323] Py3.1 pdb doesn't deal well with syntax errors

2009-06-22 Thread nlopes
nlopes added the comment: That fixes it. It seems to be introduced when committing a fix for issue #1038. -bash-3.2$ svn diff -r 58126:58127 Lib/pdb.py Index: Lib/pdb.py === --- Lib/pdb.py (revision 58126) +++ Lib/pdb.py (revisio

[issue6323] Py3.1 pdb doesn't deal well with syntax errors

2009-06-22 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Thanks for the test case. It appears that 2.7 actually calls exec("execfile(filename)"), when 3.1 directly calls exec(file_content). The indirection seems necessary: the SyntaxError is detected by the pdb trace function; but this function has to run some

[issue6323] Py3.1 pdb doesn't deal well with syntax errors

2009-06-22 Thread nlopes
nlopes added the comment: I can reproduce it in my OpenBSD 4.5 box (only one I tried). This simple code: print(3 seems to break the pdb flow in python 3.1 the way Andreas described it. When I tried in 2.7, this is what I get: -bash-3.2$ ./python -m pdb test.py SyntaxError: ('invalid syntax', (

[issue6323] Py3.1 pdb doesn't deal well with syntax errors

2009-06-22 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: I tried different combinations, and could not reproduce it (for example, the debugged function imports a bad module, or eval() a bad expression) How did you generate the SyntaxError? -- nosy: +amaury.forgeotdarc stage: -> test needed __

[issue6323] Py3.1 pdb doesn't deal well with syntax errors

2009-06-22 Thread Andreas Kloeckner
New submission from Andreas Kloeckner : Steps to reprdocue: 1) Debug a program with a syntax error in pdb. 2) Get the SyntaxError traceback. 3) Hit "q" to quit. 4) Another SyntaxError traceback, and you're back at the Pdb prompt. -- components: Library (Lib) messages: 89599 nosy: induc