[Python-Dev] Reference cycles in Exception.__traceback__
Guido van Rossum
guido at python.org
Wed Mar 5 23:12:33 CET 2014
I think it was http://bugs.python.org/issue17911
On Wed, Mar 5, 2014 at 1:54 PM, Nick Coghlan <ncoghlan at gmail.com> wrote:
>
> On 6 Mar 2014 02:43, "Antoine Pitrou" <solipsis at pitrou.net> wrote:
> >
> > Le 05/03/2014 17:37, Victor Stinner a écrit :
> >
> >>
> >> Python 3.4 introduced frame.clear(), but frame.clear() raises an
> >> RuntimeError if the frame is still running. And it doesn't break all
> >> reference cycles.
> >>
> >> An obvious workaround is to store the traceback as text, but this
> >> operation is "expensive" especially if the traceback is only needed in
> >> rare cases.
> >
> >
> > Another "obvious" workaround is to call frame.clear() from the parent
> function (i.e. have a dedicated wrapping layer).
>
> Guido had a fix in mind - splitting traceback formatting into two pieces.
> The first would convert a traceback to a sequence of named tuples, the
> second would do the actual string formatting.
>
> There's an RFE for it on the tracker, but I don't have a link handy.
>
> Cheers,
> Nick.
>
> >
> > Regards
> >
> > Antoine.
> >
> >
> >
> > _______________________________________________
> > Python-Dev mailing list
> > Python-Dev at python.org
> > https://mail.python.org/mailman/listinfo/python-dev
> > Unsubscribe:
> https://mail.python.org/mailman/options/python-dev/ncoghlan%40gmail.com
>
>
> _______________________________________________
> Python-Dev mailing list
> Python-Dev at python.org
> https://mail.python.org/mailman/listinfo/python-dev
> Unsubscribe:
> https://mail.python.org/mailman/options/python-dev/guido%40python.org
>
>
--
--Guido van Rossum (python.org/~guido)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20140305/8f220c38/attachment-0001.html>
More information about the Python-Dev
mailing list