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
Bug: Incorrect node text when __slots__ and class variables are used (3.11) #53
Comments
I have currently no idea how the new 3.11 code can cause this result. can you provide some more information?
I have currently also no explanation for the performance degradation. The executing test suite got significant faster. There is maybe something special about the way you use executing. Do you check a lot of instructions which provide invalid results |
I'm betting that what's happening is:
|
Also there were versions 0.9.0 and 0.9.1 between 0.8.3 and 1.0.0, can you confirm the exact version where the slowdown happens? |
Using Python 3.10, average of 3 runs of my unit tests, rounded to the nearest second
About your previous comment, from what I can tell:
After https://github.com/friendly-traceback/friendly-traceback/blob/b284e47eb12778f5bb68c1fe366802df8a5ea750/friendly_traceback/tb_data.py#L267, inserting the line:
for the class slot example yields
when using Python 3.10, and
when using Python 3.11 |
Isn't it doing that here?
|
Dang, my bad about the collapse of the multiple lines. I believe that this was needed before, but perhaps it is no longer the case with the new executing. I'll test this right away. As for the slowdown, I did indicate that it occurs when going from 0.9.1 to 1.0.0 |
Whether or not it was 'needed' is unrelated to executing and entirely about how you choose to display things in friendly. I don't think I understand why you chose that collapsing in the first place. What's changed now is that identified nodes can be compound statements like class definitions. Multiline nodes were possible before, but they were expressions formatted that way which were still valid after collapsing. |
Apologies for not providing a self-contained test with
executing
for the following, as I don't know how.The following raises a
ValueError
exception:With Python 3.10 (and prior), the text of the node identified causing the exception is:
With Python 3.11, we get this:
This is not a typo: the text of the node identified a single line, with no
\n
, which is clearly a SyntaxError.This is the only bug I found when running the unit tests for friendly_traceback with executing 1.1.0 and Python 3.11. Everything still works for me with Python 3.6 to 3.10, although I found that the tests I run take about 2 to 3 times as long as compared with using executing 0.8.3. The slowdown seemed to be already present with executing 1.0.0.
The text was updated successfully, but these errors were encountered: