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
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 is t
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
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. Is
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
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:
...: ra
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
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