[issue38770] Pickle handle self references in classes

2019-11-11 Thread Saim Raza
New submission from Saim Raza : If the __qualname__ of a class is set to have a circular reference to itself, pickle behaves differently based on protocol. Following script demonstrates the issue: == from __future__ import print_function

[issue36537] except statement block incorrectly assumes end of scope(?).

2019-04-12 Thread Saim Raza
Saim Raza added the comment: > Knowing that pdb stops just before the interpreter executes the line after > pdb.set_trace(), what prevents you from writing the pdb.set_trace() statement > before the last line of the except clause ? Of course, that can be done. The issue here

[issue36537] except statement block incorrectly assumes end of scope(?).

2019-04-12 Thread Saim Raza
Saim Raza added the comment: Thanks, SilentGhost! However, should we try to fix set_trace as well to avoid hassles to other users? -- ___ Python tracker <https://bugs.python.org/issue36

[issue36537] except statement block incorrectly assumes end of scope(?).

2019-04-12 Thread Saim Raza
Saim Raza added the comment: This is pretty unintuitive from a user's stand point. Now, I need to *inconveniently* put some dummy code after the ser_trace call every time I want to access the exception inside the except block. Also, this is a change in behavior from Python 2.7

[issue36537] except statement block incorrectly assumes end of scope(?).

2019-04-06 Thread Saim Raza
Saim Raza added the comment: https://docs.python.org/3/reference/compound_stmts.html#the-try-statement says = except E as N: foo = is converted to the following statement: = except E as N: try: foo finally: del N

[issue36537] except statement block incorrectly assumes end of scope(?).

2019-04-05 Thread Saim Raza
New submission from Saim Raza : If pdb.set_trace() is the last statement in the first code snippet, variable 'err' is (wrongly?) excluded from locals(). Adding any code after the pdb.set_trace() statement makes 'err' available in locals. In [2]: try: ...: raise ValueError("

[issue36272] Recursive logging crashes Interpreter in Python 3

2019-03-13 Thread Saim Raza
Saim Raza added the comment: Stack exhaustion doesn't seem to be due to be the root cause. A simple recursive function doesn't crash the interpreter in Python 3.6. >>> def rec(): rec() >>> rec() Traceback (most recent call last): File "", line 1, in Fi

[issue36272] Recursive logging crashes Interpreter in Python 3

2019-03-12 Thread Saim Raza
New submission from Saim Raza : Following code logs an error and calls itself leading to stack overflow and eventually core dump in Python 3.6. >>> import logging >>> def rec(): ... logging.error("foo") ... rec() >>> rec() [1]101641 abort (co