Skip to content

gh-129098: Skip reading source lines if filename is _pyrepl.__main__.py inside REPL #129099

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
wants to merge 1 commit into from

Conversation

WolframAlph
Copy link
Contributor

@WolframAlph WolframAlph commented Jan 20, 2025

@WolframAlph
Copy link
Contributor Author

WolframAlph commented Jan 20, 2025

I don't have much context about REPL and not sure this is the correct way to fix this. After spending some time debugging where this comes from, I found out that adding check inside lazycache fixes this issue. Let me know if this is correct way or if this should be done differently.

@WolframAlph WolframAlph changed the title gh-129098: Skip reading source lines if filename is _pyrepl.__main__ inside REPL gh-129098: Skip reading source lines if filename is _pyrepl.__main__.py inside REPL Jan 20, 2025
@picnixz
Copy link
Member

picnixz commented Jan 20, 2025

I'm not sure we should do it. linecache is independent of the REPL and we shouldn't rely on such checks (maybe the REPL should have its own linecache or something like that? or maybe we should have some better hooking mechanism for it).

Or we could check whether the reported traceback is correct or not (or we could hook compile itself?)

@picnixz
Copy link
Member

picnixz commented Jan 20, 2025

Let's continue the discussion on the issue itself.

@encukou encukou added the topic-repl Related to the interactive shell label Jan 21, 2025
@WolframAlph WolframAlph marked this pull request as draft January 23, 2025 15:26
@picnixz
Copy link
Member

picnixz commented Apr 24, 2025

Closing since it was superseded by #130721.

@picnixz picnixz closed this Apr 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic-repl Related to the interactive shell
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants