-
-
Notifications
You must be signed in to change notification settings - Fork 33.9k
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've taken
rmamfrom https://man7.org/linux/man-pages/man5/terminfo.5.html.@ambv Should I add
as well?
There was a problem hiding this comment.
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 replacing
ncurseswith a hand-rolled terminfo parser, but so far, so good. The only report we got so far there was from NetBSD.There was a problem hiding this comment.
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 with
TERMdefined asxterm256color. While I refer toTERMin my various shell startup files, I do not change its value, nor do I see a file in/etccontainingTERM.Are the Mac buildbots testing framework builds? If so, what kind of terminal environment exists there? Perhaps the
pyrepltests should be run a few times with different (common?) values forTERM.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the detailed explanation ❤️
There was a problem hiding this comment.
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[?7hbefore, but CI passed. I assume, because in CI and for our build botsis_apple_terminalis false, but obviously on @smontanaro's setup it returns true.Setting
is_apple_terminalmanually to true immediately raised the problem for me on WSL and native Ubuntu ...There was a problem hiding this comment.
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 main
test_pyreplstuff twice, the second time withis_apple_terminalmocked to returnTrue. That way we won't regress in the future.There was a problem hiding this comment.
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).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most probably
is_apple_terminalis false on CI, becauseos.getenv("TERM_PROGRAM") == "Apple_Terminal"does not evaluate to true there, but idk why :(At least #143461 takes care to enforce
Apple_Terminal, so your use case is now handled, too.You can set
TERM_PROGRAMto something different thanApple_Terminalto mimic what happened in CI.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.)