Skip to content

bpo-43950: implement on-the-fly source tracking for interactive mode #27117

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

Closed

Conversation

isidentical
Copy link
Member

@isidentical isidentical commented Jul 13, 2021

Purely for design purposes, do not review/merge.

https://bugs.python.org/issue43950

@isidentical isidentical force-pushed the bpo-43950-source-tracking branch from ea92deb to 3d2919c Compare July 13, 2021 17:33
@isidentical
Copy link
Member Author

isidentical commented Jul 17, 2021

One problem with this patch is that, we need to limit fetching from __source__ only for the main frame, otherwise if the offsets match out it will show something like this;

 $ ./python
Python 3.11.0a0 (heads/[bpo-43950](https://bugs.python.org/issue43950)-source-tracking-dirty:1173c11e09, Jul 17 2021, 14:52:40) [GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> def frame_3():
...     return 1/0
... 
>>> def frame_2():
...     return frame_3()
... 
>>> def frame_1():
...     return frame_2()
... 
>>> if True:
...     1+     frame_1()
... 
Traceback (most recent call last):
  File "<stdin>", line 2, in <module>
    1+     frame_1()
           ^^^^^^^^^
  File "<stdin>", line 2, in frame_1
    1+     frame_1()
           ^^^^^^^^^
  File "<stdin>", line 2, in frame_2
    1+     frame_1()
           ^^^^^^^^^
  File "<stdin>", line 2, in frame_3
    1+     frame_1()
           ^^^
ZeroDivisionError: division by zero

@github-actions
Copy link

This PR is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale Stale PR or inactive for long period of time. label Aug 17, 2021
@github-actions github-actions bot removed the stale Stale PR or inactive for long period of time. label Aug 10, 2022
@CAM-Gerlach
Copy link
Member

Hey @isidentical , can this be closed now?

@isidentical
Copy link
Member Author

Thanks for the reminder @CAM-Gerlach, this was mainly an experiment before it ever got to be a real PR so yep we can close it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants