Skip to content

[3.14] gh-159617: Fix _pyrepl dropping the end of long wrapped lines - #159619

Open
lazerg wants to merge 1 commit into
python:3.14from
lazerg:fix-issue-159617-3.14
Open

lazerg wants to merge 1 commit into
python:3.14from
lazerg:fix-issue-159617-3.14

Conversation

@lazerg

@lazerg lazerg commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

In 3.14, Reader.calc_screen() sizes the wrap loop as (width_of_line + prompt) // console_width rows, but each wrapped row only holds console_width - 1 characters because of the \ marker. On long lines the loop ends early, so the tail of the line never reaches screeninfo, and moving down to those rows raises IndexError in max_column(). For example, 19 characters at width 10 already lose the last one.

The loop now runs until the whole line is placed. main and 3.15 don't have this bug, since gh-148105 rewrote the layout code there, so this PR targets 3.14 only. 3.13 has the same loop, so it could take this fix as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant