Skip to content

bugfix textwrap function like CPython #140627 - #170

Merged
jquast merged 5 commits into
masterfrom
jq/bugfix-wrap
Jan 18, 2026
Merged

jquast merged 5 commits into
masterfrom
jq/bugfix-wrap

Conversation

@jquast

@jquast jquast commented Jan 17, 2026 •

Copy link
Copy Markdown
Owner

Matches "strip trailing (and leading) whitespace", bugfixed in latest releases of CPython 3.13, 3.14, 3.15. CPython #140627

Our test cases also require a workaround, using a similar, maybe more forgiving solution, as found in blessed, https://github.com/jquast/blessed/blob/a61492cc758259c5f7f1a41b7b2ee694d36e0391/tests/test_wrap.py#L82-L92

Also removed unused chunk of code--no need to check for "escape sequences" within grapheme boundry check

And, after extensive research ... some code is unreachable but final 'return' type required by type checker, marked as pragma: no cover

using same solution as found in blessed
@jquast
jquast marked this pull request as draft January 17, 2026 21:10
Comment thread tests/test_textwrap.py Fixed
@jquast
jquast marked this pull request as ready for review January 18, 2026 00:59
@jquast jquast changed the title "fix" CI testing on <3.15 python for textwrap bugfix textwrap function like CPython #140627 Jan 18, 2026
@jquast
jquast merged commit 226d039 into master Jan 18, 2026
36 checks passed
@jquast
jquast deleted the jq/bugfix-wrap branch January 18, 2026 02:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants