gh-125942: Android: set stdout to errors="backslashreplace"#125943
gh-125942: Android: set stdout to errors="backslashreplace"#125943freakboy3742 merged 1 commit intopython:mainfrom
errors="backslashreplace"#125943Conversation
|
!buildbot android |
freakboy3742
left a comment
There was a problem hiding this comment.
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.
Not sure I understand what is going on here - why is the errors kwarg no longer required?
There was a problem hiding this comment.
Because it's been added as a default in TextLogStream itself.
There was a problem hiding this comment.
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.
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 |
| 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.
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 <smith@chaquo.com>
|
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