gh-125140: Remove the current directory from sys.path when using pyrepl#125212
Merged
ambv merged 2 commits intopython:mainfrom Oct 9, 2024
Merged
gh-125140: Remove the current directory from sys.path when using pyrepl#125212ambv merged 2 commits intopython:mainfrom
ambv merged 2 commits intopython:mainfrom
Conversation
5643a8c to
eb97b2d
Compare
…g pyrepl Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
Misc/NEWS.d/next/Security/2024-10-09-20-08-13.gh-issue-125140.YgNWRB.rst
Outdated
Show resolved
Hide resolved
ambv
reviewed
Oct 9, 2024
| import _pyrepl.unix_console | ||
| from _pyrepl.main import CAN_USE_PYREPL | ||
| finally: | ||
| sys.path = original_path |
Contributor
There was a problem hiding this comment.
Confirmed this works fine for PYTHONSTARTUP usage (including manipulating sys.path there) as well as keeps sitecustomize.py and usercustomize.py working. Also confirmed asyncio REPL still works in the aforementioned cases.
…YgNWRB.rst Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
|
Thanks @pablogsal for the PR, and @ambv for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13. |
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this pull request
Oct 9, 2024
…g pyrepl (pythonGH-125212) (cherry picked from commit c7d5d1d) Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com> Signed-off-by: Pablo Galindo <pablogsal@gmail.com> Co-authored-by: Łukasz Langa <lukasz@langa.pl> Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
|
GH-125224 is a backport of this pull request to the 3.13 branch. |
pablogsal
pushed a commit
that referenced
this pull request
Oct 10, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.