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-143394: filter for turning off automatic margins in test_no_newline#143433

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
ambv merged 2 commits intopython:mainfromchris-eibl:fix-test_no_newline
Jan 5, 2026

Conversation

@chris-eibl
Copy link
Member

@chris-eiblchris-eibl commentedJan 5, 2026
edited by bedevere-appbot
Loading

@smontanaro This should fix your issue.

Sorry, I cannot test because I have no Mac.

Also, I don't know why CI and buildbots did not complain before, see

ifself.is_apple_terminal:
os.write(self.output_fd,b"\033[?7h")

self.is_apple_terminal= (
platform.system()=="Darwin"
andos.getenv("TERM_PROGRAM")=="Apple_Terminal"

safe_patterns.append(r'\x1b\[\?12[hl]') # cursor blinking

# rmam - turn off automatic margins
rmam = ti.get("rmam")
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

I've takenrmam fromhttps://man7.org/linux/man-pages/man5/terminfo.5.html.

@ambv Should I add

       enter_am_mode               smam      SA     turn on automatic margins

as well?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, please.

Chris, this didn't fail because the terminfo database can be different between computers depending on where you got it. I've seen IDEs override it, too, to work around issues with their custom built-in terminal emulators. Finally, while (almost) nobody does that, technically the terminfo database is user-editable and even allows addition of custom user-defined capabilities. So we'll likely have to do some whackamole with stuff we missed for a time, but that's alright. I had the same worry with replacingncurses with a hand-rolled terminfo parser, but so far, so good. The only report we got so far there was from NetBSD.

chris-eibl reacted with thumbs up emoji
Copy link
Contributor

Choose a reason for hiding this comment

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

FWIW, my setup is a stock MacOS Tahoe (26.2) running on an M1 MacBook Pro. I don't do framework builds. Tests are run in a normal MacOS Terminal app withTERM defined asxterm256color. While I refer toTERM in my various shell startup files, I do not change its value, nor do I see a file in/etc containingTERM.

Are the Mac buildbots testing framework builds? If so, what kind of terminal environment exists there? Perhaps thepyrepl tests should be run a few times with different (common?) values forTERM.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Chris, this didn't fail because the terminfo database can be different between computers depending on [...]

Thank you for the detailed explanation ❤️

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Yet, I do not understand why e.g. CI passed previous to this PR. We didn't do any filtering regarding\033[?7h before, but CI passed. I assume, because in CI and for our build botsis_apple_terminal is false, but obviously on@smontanaro's setup it returns true.

Settingis_apple_terminal manually to true immediately raised the problem for me on WSL and native Ubuntu ...

ambv reacted with thumbs up emoji
Copy link
Contributor

Choose a reason for hiding this comment

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

This is the culprit,@chris-eibl: the Apple Terminal special case. I'll make sure to test that, too, when landing stuff. We can also look into running the maintest_pyrepl stuff twice, the second time withis_apple_terminal mocked to returnTrue. That way we won't regress in the future.

Copy link
Contributor

Choose a reason for hiding this comment

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

As someone who uses a Mac daily, are there changes to my environment I can make to mimic the environment of the Mac buildbots? I'm happy to add that to my mix. I routinely run tests for main and the two most recent older branches (currently 3.13 & 3.14).

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Most probablyis_apple_terminal is false on CI, becauseos.getenv("TERM_PROGRAM") == "Apple_Terminal" does not evaluate to true there, but idk why :(

At least#143461 takes care to enforceApple_Terminal, so your use case is now handled, too.

You can setTERM_PROGRAM to something different thanApple_Terminal to mimic what happened in CI.

Copy link
Contributor

Choose a reason for hiding this comment

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

You can set TERM_PROGRAM to something different than Apple_Terminal to mimic what happened in CI.

Excellent, I can just run in an xterm. (Hadn't occurred to me before, but then I didn't realize there were these kinds of environment diffs.)

@ambv
Copy link
Contributor

ambv commentedJan 5, 2026

I reproduced the problem with Apple Terminal and can confirm this PR fixes it.

chris-eibl reacted with hooray emoji

@ambvambv merged commit04ace41 intopython:mainJan 5, 2026
44 checks passed
@ambvambv added the needs backport to 3.14bugs and security fixes labelJan 5, 2026
@miss-islington-app
Copy link

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

miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestJan 5, 2026
…newline (pythonGH-143433)(cherry picked from commit04ace41)Co-authored-by: Chris Eibl <138194463+chris-eibl@users.noreply.github.com>
@bedevere-app
Copy link

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

@bedevere-appbedevere-appbot removed the needs backport to 3.14bugs and security fixes labelJan 5, 2026
ambv pushed a commit that referenced this pull requestJan 5, 2026
…_newline (GH-143433) (GH-143459)(cherry picked from commit04ace41)Co-authored-by: Chris Eibl <138194463+chris-eibl@users.noreply.github.com>
@chris-eiblchris-eibl added the needs backport to 3.13bugs and security fixes labelJan 6, 2026
@miss-islington-app
Copy link

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

miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestJan 6, 2026
…newline (pythonGH-143433)(cherry picked from commit04ace41)Co-authored-by: Chris Eibl <138194463+chris-eibl@users.noreply.github.com>
@bedevere-app
Copy link

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

@bedevere-appbedevere-appbot removed the needs backport to 3.13bugs and security fixes labelJan 6, 2026
ambv added a commit that referenced this pull requestJan 6, 2026
…_newline (GH-143433) (GH-143478)Co-authored-by: Chris Eibl <138194463+chris-eibl@users.noreply.github.com>Co-authored-by: Łukasz Langa <lukasz@langa.pl>
@chris-eiblchris-eibl deleted the fix-test_no_newline branchJanuary 7, 2026 06:51
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@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

@smontanarosmontanarosmontanaro left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

skip newstestsTests in the Lib/test dir

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@chris-eibl@ambv@smontanaro

[8]ページ先頭

©2009-2026 Movatter.jp