Repository navigation
gh-159225: PyREPL input should not write to history - #159263
Merged
Merged
Conversation
Values entered in an input statement are not Python statements and thus the reader should suspend history recording when in input mode
|
Thanks @edvilme for the PR, and @pablogsal for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14, 3.15. |
Member
|
Thanks a lot for picking this up and working through the history behaviour, @edvilme! I added a few extra regression cases before merging. Thanks again for the fix and for helping improve the REPL! 🤘 |
|
GH-159369 is a backport of this pull request to the 3.15 branch. |
|
GH-159370 is a backport of this pull request to the 3.14 branch. |
pablogsal
added a commit
that referenced
this pull request
Oct 13, 2026
#159370) gh-159225: PyREPL input should not write to history (GH-159263) * gh-159225: PyREPL input should not write to history Values entered in an input statement are not Python statements and thus the reader should suspend history recording when in input mode * 📜🤖 Added by blurb_it. * Remove comment * Only suspend writing * gh-159225: Cover input history isolation and interrupted reads --------- (cherry picked from commit 6f92424) Co-authored-by: Eduardo Villalpando Mello <eduardovil@microsoft.com> Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com> Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
pablogsal
added a commit
that referenced
this pull request
Oct 13, 2026
#159369) gh-159225: PyREPL input should not write to history (GH-159263) * gh-159225: PyREPL input should not write to history Values entered in an input statement are not Python statements and thus the reader should suspend history recording when in input mode * 📜🤖 Added by blurb_it. * Remove comment * Only suspend writing * gh-159225: Cover input history isolation and interrupted reads --------- (cherry picked from commit 6f92424) Co-authored-by: Eduardo Villalpando Mello <eduardovil@microsoft.com> Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com> Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
Contributor
Author
Muchas gracias! :) |
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.
Values entered in an input statement are not Python statements and thus the reader should suspend history recording when in input mode
Fixed with
cpython/Lib/_pyrepl/historical_reader.py
Line 293 in 0768eed