Skip to content

Conversation

@WolframAlph
Copy link
Contributor

@WolframAlphWolframAlph commented Jan 20, 2025

@WolframAlph
Copy link
ContributorAuthor

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.

@WolframAlphWolframAlph changed the title gh-129098: Skip reading source lines if filename is _pyrepl.__main__ inside REPLgh-129098: Skip reading source lines if filename is _pyrepl.__main__.py inside REPLJan 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

Let's continue the discussion on the issue itself.

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

Closing since it was superseded by #130721.

@picnixzpicnixz closed this Apr 24, 2025
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

topic-replRelated to the interactive shell

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@WolframAlph@picnixz@encukou