Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.5k
gh-142035: Textwrap without ansi escapes#142040
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 ourterms of service andprivacy 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?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
21b7359 to6517434Comparealexprengere commentedNov 28, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
This is just a POC, it needs tests, docs, etc. >>>textwrap.wrap("Cafe\u0301 is good",width=4)['Cafe','́ is','good'] |
picnixz commentedNov 29, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Sorry but we should not change |
picnixz commentedNov 29, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Oh actually the patch is quite simple. However as it's a new feature we cannot backport it =/ so we need to think of a solution that can be backported. If it's not possible I would suggest:
If the PR is not ready, I will make it a draft. |
alexprengere commentedNov 29, 2025
Thanks for the reply! I was not thinking about backporting the changes to 3.14 to be honest. The cleanest solution would be to incorporate a complete unicode handling with a technique similar towcwidth, that would allow for proper wrapping of all glyphs. That being said, as this would be indeed a major addition to stdlib, a good first step might be to add the new option to |
picnixz commentedNov 29, 2025
Well.. looks like the current tests are broken which is not good. I need to think about the changes to @serhiy-storchaka Do you think it makes sense to make |
alexprengere commentedNov 29, 2025
Sorry, the draft contained a bug due to a copy paste error, I just pushed a fix. |
Uh oh!
There was an error while loading.Please reload this page.