GeezerVison is showing github.com — gh-150932: Add a partial-line-marker on Apple system logger and optimize the iOS testbed runner by timrid · Pull Request #150983 · python/cpython
Conversation
timrid
commented
Jun 5, 2026
•
edited by bedevere-app
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
This adds a marker for partial lines on the Apple system logger, so that a cooperating log reader (like the iOS testbed runner) can re-join them instead of rendering each flush as a separate line in the Apple system log.
Additionally, this optimizes the iOS testbed runner by:
- Joining partial lines marked by the system log, so that they are rendered as a single line in the testbed output.
- Restoring control characters (e.g. ANSI color escapes) escaped by the system log.
Fixes #150932
To test this, I used this test script and ran it in an iOS testbed:
# Test colors ###################################
colors = {
"red": "\033[31m",
"green": "\033[32m",
"yellow": "\033[33m",
"blue": "\033[34m",
"magenta": "\033[35m",
"cyan": "\033[36m",
"white": "\033[37m",
}
reset = "\033[0m"
for name, code in colors.items():
print(f"{code}Hello in {name}!{reset}")
# Test newline handling #########################
print("This should be ", end="", flush=True)
print("in one line.")
print("This should al", end="", flush=True)
print("so be in one", end="", flush=True)
print(" line.")
print("This are \n two lines.")
# Test live output ##############################
import time
for i in range(10):
print(".", end="")
time.sleep(1)
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.
If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Thanks for the PR; however, I'm going to close this on the basis that the discussion on the underlying ticket hasn't yet concluded that either of these ideas are desirable.
Of the two, the ANSI reversal is a firm "no" from me. I'm not yet convinced the line-end thing is worthwhile either; but if I am convinced, it will need to be extracted from the ANSI reversal stuff, so a clean PR would make sense.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Reviewers
freakboy3742
Awaiting requested review from freakboy3742
freakboy3742 is a code owner
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
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.
|