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: Redirect stdout and stderr to system log when embedded in an Android app by mhsmith · Pull Request #118063 · python/cpython

Conversation

@mhsmith

@mhsmith mhsmith commented Apr 18, 2024 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

When embedded in an app on current versions of Android, there's no easy way to monitor the process's stdout and stderr. So, as specified in PEP 738, this PR redirects them to the system log, which can be viewed using the developer tools.

  • 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 3 commits April 18, 2024 19:41
@mhsmith
Redirect stdout and stderr to system log when embedded in an Android app
1f65ec6
@mhsmith
Deal with variations in older Android versions
d5cadd5
@mhsmith
Deal with even older Android versions
8e4d56a
@mhsmith
mhsmith requested a review from ericsnowcurrently as a code owner April 18, 2024 18:49
@bedevere-app bedevere-app Bot mentioned this pull request Apr 18, 2024
Add support for Android as a target platform #116622
Closed
@bedevere-app bedevere-app Bot added the awaiting review label Apr 18, 2024
mhsmith added 3 commits April 18, 2024 20:02
@mhsmith
Update stdlib_module_names.h
6da6ef0
@mhsmith
Move ctypes import from top level into a function, since it's not ava…
c6d9809
…ilable on WASI
@mhsmith
Add #ifdef to avoid unused-function warning on other platforms
1f21141
@mhsmith
mhsmith force-pushed the android-log branch from e3995e0 to 1f21141 Compare April 18, 2024 19:43
@mhsmith

mhsmith commented Apr 22, 2024

Copy link
Copy Markdown
Member Author

@serhiy-storchaka: This PR is connected to the io module, which I see you've been working on recently. Are you able to review it?

All reactions

Sorry, something went wrong.

Uh oh!

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

encukou
encukou reviewed Apr 23, 2024
View reviewed changes
Comment thread Lib/_android_support.py Resolved

Uh oh!

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

Comment thread Lib/_android_support.py Resolved

Uh oh!

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

Comment thread Lib/_android_support.py Resolved

Uh oh!

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

@mhsmith
Avoid importing ctypes on startup
a8b6760
@mhsmith
mhsmith requested review from corona10 and erlend-aasland as code owners April 24, 2024 17:19
@mhsmith
Clarify comment
bbe816f
serhiy-storchaka
serhiy-storchaka reviewed Apr 24, 2024
View reviewed changes
Comment thread Lib/_android_support.py Resolved

Uh oh!

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

Comment thread Lib/_android_support.py Resolved

Uh oh!

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

Comment thread Lib/_android_support.py Resolved

Uh oh!

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

Comment thread Python/pylifecycle.c Resolved

Uh oh!

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

Comment thread Python/pylifecycle.c Resolved

Uh oh!

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

Comment thread Python/pylifecycle.c Resolved

Uh oh!

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

Comment thread Python/pylifecycle.c Resolved

Uh oh!

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

Comment thread Python/pylifecycle.c Resolved

Uh oh!

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

Comment thread Lib/_android_support.py Resolved

Uh oh!

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

Comment thread configure.ac Resolved

Uh oh!

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

mhsmith added 3 commits April 24, 2024 21:57
@mhsmith
Fix issues with nulls and newlines
aea0b8b
@mhsmith
Improve identification of bytes-like objects
41736d6
@mhsmith
Fix C coding style
02cf414
encukou
encukou reviewed Apr 25, 2024
View reviewed changes

@encukou encukou left a comment

Copy link
Copy Markdown
Member

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!
This looks good to me, modulo a few small nitpicks. I'll let @serhiy-storchaka resolve the conversations he started.

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread Lib/_android_support.py Resolved

Uh oh!

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

Comment thread Lib/test/test_android.py Resolved

Uh oh!

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

Comment thread Lib/test/test_android.py Resolved

Uh oh!

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

serhiy-storchaka
serhiy-storchaka reviewed Apr 25, 2024
View reviewed changes
Comment thread Lib/_android_support.py Resolved

Uh oh!

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

Comment thread Lib/_android_support.py Resolved

Uh oh!

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

Comment thread Lib/_android_support.py Resolved

Uh oh!

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

Comment thread Lib/_android_support.py Resolved

Uh oh!

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

Comment thread Lib/_android_support.py Resolved

Uh oh!

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

Comment thread Python/pylifecycle.c Resolved

Uh oh!

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

Comment thread Lib/test/test_android.py Resolved

Uh oh!

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

Comment thread Lib/test/test_android.py Resolved

Uh oh!

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

Comment thread Lib/test/test_android.py Resolved

Uh oh!

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

mhsmith added 4 commits April 27, 2024 14:46
@mhsmith
Use LOOPBACK_TIMEOUT to wait for subprocesses, and add breadcrumb to …
61d7e98
…comment
@mhsmith
Add tests for str subclasses
3014e6c
@mhsmith
Add tests for other bytes-like objects
839de0f
@mhsmith
Add tests for Unicode surrogates and non-standard line separators
0ffb19f
serhiy-storchaka
serhiy-storchaka reviewed Apr 29, 2024
View reviewed changes

@serhiy-storchaka serhiy-storchaka left a comment

Copy link
Copy Markdown
Member

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 addressing my comments. LGTM in general. I left several minor suggestions, but they are not mandatory, you can implement or reject them on case by case base.

In any case I'm going to merge this PR after your answer.

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread Lib/_android_support.py Resolved

Uh oh!

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

Comment thread Lib/test/test_android.py Resolved

Uh oh!

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

Comment thread Lib/test/test_android.py Resolved

Uh oh!

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

encukou
encukou approved these changes Apr 29, 2024
View reviewed changes

@encukou encukou left a comment

Copy link
Copy Markdown
Member

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.

Using the tooling and instructions in #117878, I've confirmed that this works for the test suite:

image

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 Apr 29, 2024
mhsmith added 2 commits April 30, 2024 01:06
@mhsmith
Bytes cleanups
b2e2ef6
@mhsmith
Str cleanups
56e6f85
@erlend-aasland
erlend-aasland removed their request for review April 30, 2024 07:34
vstinner
vstinner reviewed Apr 30, 2024
View reviewed changes
Comment thread Python/pylifecycle.c Resolved

Uh oh!

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

Comment thread configure.ac Resolved

Uh oh!

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

serhiy-storchaka
serhiy-storchaka approved these changes Apr 30, 2024
View reviewed changes
mhsmith and others added 2 commits April 30, 2024 12:54
@mhsmith @vstinner
Update configure.ac
53ba406
Co-authored-by: Victor Stinner <[email protected]>
@mhsmith
Autoreconf
5874687
@vstinner
vstinner merged commit 3b268f4 into python:main Apr 30, 2024
@bedevere-app bedevere-app Bot removed the awaiting merge label Apr 30, 2024
@vstinner

vstinner commented Apr 30, 2024

Copy link
Copy Markdown
Member

Merged. Let's see how it goes. It can be adjusted later if needed.

Nice change @mhsmith.

ericsnowcurrently reacted with hooray emoji
All reactions
  • 🎉 1 reaction

Sorry, something went wrong.

Uh oh!

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

SonicField pushed a commit to SonicField/cpython that referenced this pull request May 8, 2024
@mhsmith @SonicField
pythongh-116622: Redirect stdout and stderr to system log when embedd…
82963b1
…ed in an Android app (python#118063)
SonicField pushed a commit to SonicField/cpython that referenced this pull request May 8, 2024
@mhsmith @SonicField
pythongh-116622: Redirect stdout and stderr to system log when embedd…
a9f2ad0
…ed in an Android app (python#118063)
@mhsmith mhsmith mentioned this pull request Aug 5, 2024
gh-116622: Android logging fixes #122698
Merged
@freakboy3742 freakboy3742 mentioned this pull request Nov 14, 2024
Add option for redirecting stdout and stderr to the system log #126821
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@vstinner vstinner vstinner left review comments
@serhiy-storchaka serhiy-storchaka serhiy-storchaka approved these changes
@erlend-aasland erlend-aasland erlend-aasland left review comments
@encukou encukou encukou approved these changes
@ericsnowcurrently ericsnowcurrently Awaiting requested review from ericsnowcurrently ericsnowcurrently is a code owner
@corona10 corona10 Awaiting requested review from corona10 corona10 is a code owner

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.

5 participants

@mhsmith @vstinner @encukou @serhiy-storchaka @erlend-aasland
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 01402520 — 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.