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
Fix debug() in notebook #14338
Comments
strip notebook frames prior to processing |
Author: Nils Bruin |
comment:1
Attachment: trac_14338-strip_frames.patch.gz One fix is to avoid the frames on which The other fix would be to
file = getfile(object)
sourcefile = getsourcefile(object)
- if not sourcefile and file[0] + file[-1] != '<>':
+ if not sourcefile and (not file or file[0] + file[-1] != '<>'):
raise IOError('source code not available')
file = sourcefile if sourcefile else file but that's a change to python, not to sage. |
Reviewer: Andrey Novoseltsev |
comment:2
Thanks for looking into it! The patch works for me and does what was done before in a slightly different way. |
comment:3
OK, I was too fast:
|
Attachment: trac_14338-doctest_fix.patch.gz fix doctest |
comment:4
OK, the doctest uses a stacktrace that's shallower than will ever happen in the notebook, so when we strip off the 5 outer frames that should be removed in the notebook, we have nothing left (hence the error). Attached patch makes a deeper backtrace so that stripping off the first 5 still leaves something to test. Doctest text needs to be changed in some spots. |
comment:5
Looks good and all long tests pass now. |
Merged: sage-5.9.beta2 |
On sage-devel it was observed that at least in 5.7 and 5.8 we have in the notebook:
(as expected)
due to
inspect.getinnerframes
failing on a seemingly otherwise valid traceback object.Component: notebook
Author: Nils Bruin
Reviewer: Andrey Novoseltsev
Merged: sage-5.9.beta2
Issue created by migration from https://trac.sagemath.org/ticket/14338
The text was updated successfully, but these errors were encountered: