-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
gh-125942: Android: set stdout to errors="backslashreplace"
#125943
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
Conversation
!buildbot android |
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 think this mostly makes sense; one question about an aspect of the implementation inline.
sys.stderr = TextLogStream( | ||
stderr_prio, "python.stderr", sys.stderr.fileno(), | ||
errors=sys.stderr.errors) | ||
stderr_prio, "python.stderr", sys.stderr.fileno()) |
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.
Not sure I understand what is going on here - why is the errors
kwarg no longer required?
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.
Because it's been added as a default in TextLogStream itself.
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.
The idea is that because of how the output is being logged, we want to explicitly use backslashreplace, rather than copying the existing errors
setting.
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.
Got it - I was misreading what sys.stdout.errors
was passing in.
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
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.
👍
sys.stderr = TextLogStream( | ||
stderr_prio, "python.stderr", sys.stderr.fileno(), | ||
errors=sys.stderr.errors) | ||
stderr_prio, "python.stderr", sys.stderr.fileno()) |
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.
Got it - I was misreading what sys.stdout.errors
was passing in.
Thanks @mhsmith for the PR, and @freakboy3742 for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13. |
…ythonGH-125943) Android stdout/err streams now use `backslashreplace` encoding to ensure readability of the Android log. (cherry picked from commit b08570c) Co-authored-by: Malcolm Smith <[email protected]>
GH-125950 is a backport of this pull request to the 3.13 branch. |
…ython#125943) Android stdout/err streams now use `backslashreplace` encoding to ensure readability of the Android log.
errors="surrogateescape"
#125942