This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author acapnotic
Recipients acapnotic
Date 2012-06-21.18:01:03
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1340301668.18.0.785702018205.issue15128@psf.upfronthosting.co.za>
In-reply-to
Content
The attached example shows how inspect.findsource fails when given a stack frame that points to a non-existent source line, and how inspect.getframeinfo and getinnerframes do not handle that failure.

On the one hand, yes, this code was asking for it by building such a broken frame.  On the other hand, having code that examines tracebacks result in tracebacks of its own sucks a whole bunch.

The inspect find&get source methods are documented as returning IOError if they cannot find the source, and the calling code handles that case, so that's probably what should happen here.

(Actually, that seems straightforward enough, I can make a patch for that shortly.)

This may help with issue #1628987 as well.
History
Date User Action Args
2012-06-21 18:01:08acapnoticsetrecipients: + acapnotic
2012-06-21 18:01:08acapnoticsetmessageid: <1340301668.18.0.785702018205.issue15128@psf.upfronthosting.co.za>
2012-06-21 18:01:07acapnoticlinkissue15128 messages
2012-06-21 18:01:05acapnoticcreate