-
Notifications
You must be signed in to change notification settings - Fork 33
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
Dumping a recursion error causes a recursion error #15
Comments
I'm happy to help in whatever capacity. I can put together a PR if we can agree on an approach. |
I guess we could replace the recursive One cheap way to do it is to just implement this in |
Errrm... forgot about the double negative rule. |
This was my tentative approach: class Traceback(object):
...
@classmethod
def from_tb(cls, tb):
tbs = []
while tb is not None:
traceback = object.__new__(cls)
traceback.tb_frame = Frame(tb.tb_frame)
traceback.tb_lineno = int(tb.tb_lineno)
traceback.tb_next = None
if tbs:
tbs[-1].tb_next = traceback
tbs.append(traceback)
tb = tb.tb_next
...
def pickle_traceback(tb):
return unpickle_traceback, (Frame(tb.tb_frame), tb.tb_lineno,
tb.tb_next and Traceback.from_tb(tb.tb_next)) I suppose the classmethod could be integrated into In fact, if it weren't for BWC, I might like to go one further and change the |
Actually, the |
Ooops, mistyped a name above, edited now - should make more sense. |
Yes, that can work too. |
So that lets us create and pickle a |
This lets us properly create, pickle, and turn back into tracebacks the results of exceeding the recursion limit. Also, `as_traceback` is careful to not create reference cycles in the traceback it returns by cleaning up the temporary variables. Fixes ionelmc#15.
This lets us properly create, pickle, and turn back into tracebacks the results of exceeding the recursion limit. Also, ``as_traceback`` is careful to not create reference cycles in the traceback it returns by cleaning up the temporary variables. Fixes ionelmc#15.
This lets us properly create, pickle, and turn back into tracebacks the results of exceeding the recursion limit. Also, ``as_traceback`` is careful to not create reference cycles in the traceback it returns by cleaning up the temporary variables. Fixes ionelmc#15.
Consider the following code sample:
Instead of properly storing the traceback up to the recursion limit, the exception handling raises a recursion error itself:
This issue initially occured with
gevent
, astblib
is vendored there: gevent/gevent#954The text was updated successfully, but these errors were encountered: