-
-
Notifications
You must be signed in to change notification settings - Fork 33k
gh-127068: default REPL where prompts containing newlines would be dup #139465
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: yihong0618 <[email protected]>
Lib/_pyrepl/reader.py
Outdated
del screeninfo[num_common_lines:] | ||
|
||
last_refresh_line_end_offsets = self.last_refresh_cache.line_end_offsets | ||
last_refresh_line_end_offsets = self.last_refresh_cache.line_end_offsets.copy() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems this last_refresh_line_end_offsets
has never been used in this function. The bug can be fixed by deleting this one.
The other two screen
& screeninfo
are synced back to self.last_refresh_cache
. But for readability & maintenance, we should copy them here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
addressed
The failed Windows test ( If we add the - (4, 2)
+ (2, 3) : [(0, [1, 1, 1, 1, 1]), (0, [1, 1, 1, 1, 1]), (0, [1, 2, 1])] |
Signed-off-by: yihong0618 <[email protected]> Co-authored-by: Keming <[email protected]>
Signed-off-by: yihong0618 <[email protected]>
Signed-off-by: yihong0618 <[email protected]>
The root cause of the this lis the calc_screen() method of reader.py. When screen, screeninfo, and line_end_offsets are retrieved from the cache, they are passed by direct reference instead of by a copy.
before this patch
2025-10-01.12.31.25.mov
after this patch
2025-10-01.12.57.17.mov