-
Notifications
You must be signed in to change notification settings - Fork 18
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
Feature suggestion: Fall back to line-level traces if AST is unavailable #21
Comments
13 tasks
You're completely right, I don't know why I didn't do this in the first place. |
alexmojaki
added a commit
that referenced
this issue
Feb 14, 2022
Fallback to basic Source.pieces when there is no Source.tree. Fixes #21
OK, |
Thank you! https://trac.sagemath.org/ticket/33170#comment:9 confirms this is working for the Sagemath use-case too. |
13 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
(I may be completely wrong in my analysis here, apologies in advance!)
I recently saw a regression in IPython 8 which I believe is due to
stack_data
. To illustrate the situation, I have adapted an example from ipython/ipython#6300. Save this to a file calledcythontest.pyx
:and run this under IPython (
pyximport
is part of Cython):IPython 7 does show the following (great!) traceback:
IPython 8, however, does not show the source code for
cythontest.f
:I believe this happens because IPython 8 depends on this repository's package (stack_data), which tries to parse the
pyx
file and fails to produce an AST because Cython is a superset of Python. Given that we have line number information and thepyx
file is valid source code (just not Python source code), I believe it would be better for the user if the relevant source fragment were printed even in cases where the AST is not available, similar to what IPython 7 does.The text was updated successfully, but these errors were encountered: