Skip to content
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

gh-116622: Fix testPyObjectPrintOSError on Android #122487

Merged
merged 3 commits into from
Jul 31, 2024

Conversation

mhsmith
Copy link
Member

@mhsmith mhsmith commented Jul 30, 2024

This test, which was added in #98749, was failing on Android as follows:

17:43:48.804  W  ======================================================================
17:43:48.804  W  FAIL: testPyObjectPrintOSError (test.test_capi.test_object.PrintTest.testPyObjectPrintOSError)
17:43:48.804  W  ----------------------------------------------------------------------
17:43:48.804  W  Traceback (most recent call last):
17:43:48.804  W    File "/data/user/0/org.python.testbed/files/python/lib/python3.13/test/test_capi/test_object.py", line 103, in testPyObjectPrintOSError
17:43:48.804  W      with self.assertRaises(OSError):
17:43:48.804  W          _testcapi.pyobject_print_os_error(output_filename)
17:43:48.804  W  AssertionError: OSError not raised
17:43:48.804  W
17:43:48.804  W  ----------------------------------------------------------------------

This was caused by a recently-fixed bug in OpenBSD's libc, on which Android's libc is based. Luckily there's a simple workaround.

This PR also addresses the comment in #121595 about it being inconvenient to build all architectures before running the testbed. The build script now allows architectures to be missing, as long as at least one is present.

@mhsmith
Copy link
Member Author

mhsmith commented Jul 30, 2024

CI failure seems unrelated:

Copy link
Contributor

@freakboy3742 freakboy3742 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Annoying, but makes sense to me.

@freakboy3742 freakboy3742 merged commit 82db572 into python:main Jul 31, 2024
39 checks passed
@miss-islington-app
Copy link

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

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jul 31, 2024
…2487)

Adds extra handling for way BSD/Android return errors from calls to fwrite.
(cherry picked from commit 82db572)

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

bedevere-app bot commented Jul 31, 2024

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

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Jul 31, 2024
freakboy3742 pushed a commit that referenced this pull request Jul 31, 2024
…#122490)

gh-116622: Fix testPyObjectPrintOSError on Android (GH-122487)

Adds extra handling for way BSD/Android return errors from calls to fwrite.
(cherry picked from commit 82db572)

Co-authored-by: Malcolm Smith <[email protected]>
blhsing pushed a commit to blhsing/cpython that referenced this pull request Aug 22, 2024
Adds extra handling for way BSD/Android return errors from calls to fwrite.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants