Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-139246: zero-width word paste can be wrong in default repl#139254

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

Merged
encukou merged 4 commits intopython:mainfromyihong0618:hy/close_issue_139246
Oct 30, 2025

Conversation

@yihong0618
Copy link
Contributor

@yihong0618yihong0618 commentedSep 23, 2025
edited by bedevere-appbot
Loading

Signed-off-by: yihong0618 <zouzou0208@gmail.com>
@yihong0618yihong0618 changed the titlefix: zero-width word paste can be wrong in default replgh-139246: zero-width word paste can be wrong in default replSep 23, 2025
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
Co-authored-by: grayjk <grayjk@gmail.com>

@functools.cache
defstr_width(c:str)->int:
iford(c)<128:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

unrelated to this issue but quite a few of the characters with ord < 128, do not have a display width of 1

for example, in my terminal, tab (ord 9) is 8 charaters wide

something to consider for a future PR

yihong0618 reacted with thumbs up emoji
category=unicodedata.category(c)
ifcategory=="Cf"andc!="\u00ad":
return0
if"\u2028"<=c<="\u2029":
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Hmm, what terminal are you using? Here (on VTE) these take up one cell.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

mac with kitty

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

if \u2028 and \u2029 aren't consistent across terminals, could remove this condition since it is unrelated to the original issue

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

of course will do it

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

fixed

Signed-off-by: yihong0618 <zouzou0208@gmail.com>
@encukouencukou merged commit4e6dba0 intopython:mainOct 30, 2025
58 checks passed
@encukouencukou added needs backport to 3.13bugs and security fixes needs backport to 3.14bugs and security fixes labelsOct 30, 2025
@miss-islington-app
Copy link

Thanks@yihong0618 for the PR, and@encukou for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖

@miss-islington-app
Copy link

Thanks@yihong0618 for the PR, and@encukou for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14.
🐍🍒⛏🤖

@miss-islington-app
Copy link

Sorry,@yihong0618 and@encukou, I could not cleanly backport this to3.13 due to a conflict.
Please backport usingcherry_picker on command line.

cherry_picker 4e6dba0ef74523a52f66547c16b9972664b18fd4 3.13

miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestOct 30, 2025
…ythonGH-139254)(cherry picked from commit4e6dba0)Co-authored-by: yihong <zouzou0208@gmail.com>Signed-off-by: yihong0618 <zouzou0208@gmail.com>Co-authored-by: grayjk <grayjk@gmail.com>
@bedevere-app
Copy link

GH-140796 is a backport of this pull request to the3.14 branch.

@bedevere-appbedevere-appbot removed the needs backport to 3.14bugs and security fixes labelOct 30, 2025
StanFromIreland pushed a commit to StanFromIreland/cpython that referenced this pull requestNov 6, 2025
… repl (pythonGH-139254)(cherry picked from commit4e6dba0)Co-authored-by: yihong <zouzou0208@gmail.com>Signed-off-by: yihong0618 <zouzou0208@gmail.com>Co-authored-by: grayjk <grayjk@gmail.com>
@bedevere-app
Copy link

GH-141166 is a backport of this pull request to the3.13 branch.

@bedevere-appbedevere-appbot removed the needs backport to 3.13bugs and security fixes labelNov 6, 2025
encukou pushed a commit that referenced this pull requestNov 7, 2025
…H-139254) (GH-140796)gh-139246: zero-width word paste can be wrong in default repl (GH-139254)(cherry picked from commit4e6dba0)Signed-off-by: yihong0618 <zouzou0208@gmail.com>Co-authored-by: yihong <zouzou0208@gmail.com>Co-authored-by: grayjk <grayjk@gmail.com>
encukou pushed a commit that referenced this pull requestNov 7, 2025
…H-139254) (GH-141166)(cherry picked from commit4e6dba0)Signed-off-by: yihong0618 <zouzou0208@gmail.com>Co-authored-by: yihong <zouzou0208@gmail.com>Co-authored-by: grayjk <grayjk@gmail.com>
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@encukouencukouencukou approved these changes

@pablogsalpablogsalAwaiting requested review from pablogsalpablogsal is a code owner

@lysnikolaoulysnikolaouAwaiting requested review from lysnikolaoulysnikolaou is a code owner

@ambvambvAwaiting requested review from ambvambv is a code owner

+1 more reviewer

@grayjkgrayjkgrayjk requested changes

Reviewers whose approvals may not affect merge requirements

Assignees

@encukouencukou

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@yihong0618@encukou@grayjk

[8]ページ先頭

©2009-2025 Movatter.jp