GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-116622: Android logging fixes by mhsmith · Pull Request #122698 · python/cpython

Conversation

@mhsmith

@mhsmith mhsmith commented Aug 5, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

This PR fixes several issues with Android's redirection of stdout and stderr to the Logcat, which was added in #118063:

  • The buffering behavior of TextIOWrapper was changed in #119507, which broke the technique we were previously using to stay within Logcat's line length limit. Since this behavior is not part of TextIOWrapper's public API, it's safer to bypass it completely and do the buffering ourselves.

  • When running in --verbose3 mode, I noticed that failure logs of large test modules like test_pathlib were truncated because they were being written faster than the test script could consume them. Fixed by adding a rate limit using the token bucket algorithm.

  • The Android stdout and stderr tests themselves failed in --verbose3 mode because stdout and stderr were captured by a StringIO. Fixed by detecting this mode and using some temporary streams with the same properties.

  • Issue: Add support for Android as a target platform #116622

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
mhsmith added 4 commits August 2, 2024 00:03
@mhsmith
Make TextLogStream handle its own buffering rather than relying on Te…
f8ff442
…xtIOWrapper
@mhsmith
Assert that boolean values are the correct type, not just the correct…
801658a
… truthiness
@mhsmith
Add logcat rate limit of 1 MB per second
3da2d05
@mhsmith
Handle sys.stdout and sys.stderr redirection in --verbose3 mode
4872a02
@bedevere-app bedevere-app Bot mentioned this pull request Aug 5, 2024
Add support for Android as a target platform #116622
Closed
@bedevere-app bedevere-app Bot added the awaiting review label Aug 5, 2024
@mhsmith mhsmith added needs backport to 3.13 only security fixes and removed awaiting review labels Aug 5, 2024
@mhsmith
Clarify function name, add news
e178b9e
@mhsmith mhsmith added the awaiting review label Aug 5, 2024
@mhsmith
mhsmith requested a review from freakboy3742 August 5, 2024 18:10
@mhsmith
mhsmith marked this pull request as draft August 5, 2024 18:39
@bedevere-app bedevere-app Bot removed the awaiting review label Aug 5, 2024
@mhsmith
Make rate limit test more reliable on slower devices
73b2772
@mhsmith
mhsmith marked this pull request as ready for review August 5, 2024 22:16
@bedevere-app bedevere-app Bot added the awaiting review label Aug 5, 2024
@freakboy3742
Merge branch 'main' into android-log-fixes
30a3cd1
freakboy3742
freakboy3742 reviewed Aug 6, 2024
View reviewed changes

@freakboy3742 freakboy3742 left a comment

Copy link
Copy Markdown
Contributor

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.

These changes all make sense to me; but there's a hypothesis test that is currently failing. I want to understand what's going on there before I formally approve/merge.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
freakboy3742
freakboy3742 approved these changes Aug 6, 2024
View reviewed changes

@freakboy3742 freakboy3742 left a comment

Copy link
Copy Markdown
Contributor

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.

Looks like the hypothesis failure is due to #122686, so I guess that makes this good to go!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting review labels Aug 6, 2024
@freakboy3742
Merge branch 'main' into android-log-fixes
57d8b22
@freakboy3742
freakboy3742 merged commit b0c48b8 into python:main Aug 6, 2024
@miss-islington-app

miss-islington-app Bot commented Aug 6, 2024

Copy link
Copy Markdown

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the awaiting merge label Aug 6, 2024
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Aug 6, 2024
@mhsmith @miss-islington
pythongh-116622: Android logging fixes (pythonGH-122698)
5d7ba50
Modifies the handling of stdout/stderr redirection on Android to accomodate
the rate and buffer size limits imposed by Android's logging infrastructure.
(cherry picked from commit b0c48b8)

Co-authored-by: Malcolm Smith <[email protected]>
@bedevere-app

bedevere-app Bot commented Aug 6, 2024

Copy link
Copy Markdown

GH-122719 is a backport of this pull request to the 3.13 branch.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the needs backport to 3.13 only security fixes label Aug 6, 2024
brandtbucher pushed a commit to brandtbucher/cpython that referenced this pull request Aug 7, 2024
@mhsmith @brandtbucher
pythongh-116622: Android logging fixes (python#122698)
9fc6b12
Modifies the handling of stdout/stderr redirection on Android to accomodate 
the rate and buffer size limits imposed by Android's logging infrastructure.
@hugovk

hugovk commented Aug 9, 2024

Copy link
Copy Markdown
Member

Hello! For next time, please could you update your blurb CLI? Thanks!

https://discuss.python.org/t/new-blurb-1-2-please-upgrade/59159

mhsmith reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@freakboy3742 freakboy3742 mentioned this pull request Aug 16, 2024
gh-116622: Add Android test script #121595
Merged
freakboy3742 pushed a commit that referenced this pull request Aug 16, 2024
@miss-islington @mhsmith
[3.13] gh-116622: Android logging fixes (GH-122698) (#122719)
0dd89a7
gh-116622: Android logging fixes (GH-122698)

Modifies the handling of stdout/stderr redirection on Android to accomodate
the rate and buffer size limits imposed by Android's logging infrastructure.
(cherry picked from commit b0c48b8)

Co-authored-by: Malcolm Smith <[email protected]>
blhsing pushed a commit to blhsing/cpython that referenced this pull request Aug 22, 2024
@mhsmith @blhsing
pythongh-116622: Android logging fixes (python#122698)
53863f8
Modifies the handling of stdout/stderr redirection on Android to accomodate 
the rate and buffer size limits imposed by Android's logging infrastructure.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@freakboy3742 freakboy3742 freakboy3742 approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@mhsmith @hugovk @freakboy3742
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.