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 — bpo-35967: Skip test with `uname -p` on Android by yan12125 · Pull Request #19577 · python/cpython

Conversation

@yan12125

@yan12125 yan12125 commented Apr 18, 2020 •
edited by miss-islington
Loading

Uh oh!

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

Copy link
Copy Markdown

The uname binary on Android does not support -p [1]. Here is a sample
log:

0:06:03 load avg: 0.56 [254/421/8] test_platform failed -- running: test_asyncio (5 min 53 sec)
uname: Unknown option p (see "uname --help")
test test_platform failed -- Traceback (most recent call last):
  File "/data/local/tmp/lib/python3.9/test/test_platform.py", line 170, in test_uname_processor
    proc_res = subprocess.check_output(['uname', '-p'], text=True).strip()
  File "/data/local/tmp/lib/python3.9/subprocess.py", line 420, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/data/local/tmp/lib/python3.9/subprocess.py", line 524, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['uname', '-p']' returned non-zero exit status 1.

[1] https://android.googlesource.com/platform/external/toybox/+/refs/heads/master/toys/posix/uname.c

https://bugs.python.org/issue35967

Automerge-Triggered-By: @jaraco

Sorry, something went wrong.

Uh oh!

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

All reactions
@the-knights-who-say-ni the-knights-who-say-ni added the CLA signed label Apr 18, 2020
@bedevere-bot bedevere-bot added tests Tests in the Lib/test dir awaiting review labels Apr 18, 2020
@jaraco

jaraco commented Apr 18, 2020 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

Thanks for making this change and sorry for the noise.

I think it may be better, rather than skipping the test, to assert the expected behavior. In fact, the way this is written, the test asserts that "uname -p is not used" when in fact it is, but the error is suppressed.

How about this instead:

diff --git a/Lib/test/test_platform.py b/Lib/test/test_platform.py
index 855304a68c..e98a79e3b3 100644
--- a/Lib/test/test_platform.py
+++ b/Lib/test/test_platform.py
@@ -167,8 +167,11 @@ class PlatformTest(unittest.TestCase):
         On some systems, the processor must match the output
         of 'uname -p'. See Issue 35967 for rationale.
         """
-        proc_res = subprocess.check_output(['uname', '-p'], text=True).strip()
-        expect = platform._unknown_as_blank(proc_res)
+        try:
+            proc_res = subprocess.check_output(['uname', '-p'], text=True)
+            expect = platform._unknown_as_blank(proc_res.strip())
+        except (OSError, subprocess.CalledProcessError):
+            expect = ''
         self.assertEqual(platform.uname().processor, expect)
 
     @unittest.skipUnless(sys.platform.startswith('win'), "windows only test")
yan12125 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.

Chih-Hsuan Yen
bpo-35967: Ignore errors from uname -p in test_uname_processor on A…
d956f6d
…ndroid

The uname binary on Android does not support -p [1]. Here is a sample
log:

0:06:03 load avg: 0.56 [254/421/8] test_platform failed -- running: test_asyncio (5 min 53 sec)
uname: Unknown option p (see "uname --help")
test test_platform failed -- Traceback (most recent call last):
  File "/data/local/tmp/lib/python3.9/test/test_platform.py", line 170, in test_uname_processor
    proc_res = subprocess.check_output(['uname', '-p'], text=True).strip()
  File "/data/local/tmp/lib/python3.9/subprocess.py", line 420, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/data/local/tmp/lib/python3.9/subprocess.py", line 524, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['uname', '-p']' returned non-zero exit status 1.

[1] https://android.googlesource.com/platform/external/toybox/+/refs/heads/master/toys/posix/uname.c
@jaraco

jaraco commented Apr 18, 2020

Copy link
Copy Markdown
Member

Super! Thanks.

All reactions

Sorry, something went wrong.

Uh oh!

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

jaraco
jaraco approved these changes Apr 18, 2020
View reviewed changes
@bedevere-bot bedevere-bot added awaiting merge and removed awaiting review labels Apr 18, 2020
@jaraco jaraco added skip news 🤖 automerge labels Apr 18, 2020
@yan12125

yan12125 commented Apr 18, 2020

Copy link
Copy Markdown
Author

Thanks for the suggestion! Now I understand the test :)

All reactions

Sorry, something went wrong.

Uh oh!

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

@miss-islington

miss-islington commented Apr 18, 2020

Copy link
Copy Markdown
Contributor

@yan12125: Status check is done, and it's a success ✅ .

All reactions

Sorry, something went wrong.

Uh oh!

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

@miss-islington
miss-islington merged commit fb94040 into python:master Apr 18, 2020
@bedevere-bot bedevere-bot removed the awaiting merge label Apr 18, 2020
@yan12125
yan12125 deleted the android-skip-uname-p-test branch April 18, 2020 14:21
CuriousLearner added a commit to CuriousLearner/cpython that referenced this pull request May 29, 2020
@CuriousLearner
Merge branch 'master' into bpo-26543
e4d193d
* master: (1985 commits)
  bpo-40179: Fix translation of #elif in Argument Clinic (pythonGH-19364)
  bpo-35967: Skip test with `uname -p` on Android (pythonGH-19577)
  bpo-40257: Improve help for the typing module (pythonGH-19546)
  Fix two typos in multiprocessing (pythonGH-19571)
  bpo-40286: Use random.randbytes() in tests (pythonGH-19575)
  bpo-40286: Makes simpler the relation between randbytes() and getrandbits() (pythonGH-19574)
  bpo-39894: Route calls from pathlib.Path.samefile() to os.stat() via the path accessor (pythonGH-18836)
  bpo-39897: Remove needless `Path(self.parent)` call, which makes `is_mount()` misbehave in `Path` subclasses. (pythonGH-18839)
  bpo-40282: Allow random.getrandbits(0) (pythonGH-19539)
  bpo-40302: UTF-32 encoder SWAB4() macro use a|b rather than a+b (pythonGH-19572)
  bpo-40302: Replace PY_INT64_T with int64_t (pythonGH-19573)
  bpo-40286: Add randbytes() method to random.Random (pythonGH-19527)
  bpo-39901: Move `pathlib.Path.owner()` and `group()` implementations into the path accessor. (pythonGH-18844)
  bpo-40300: Allow empty logging.Formatter.default_msec_format. (pythonGH-19551)
  bpo-40302: Add pycore_byteswap.h header file (pythonGH-19552)
  bpo-40287: Fix SpooledTemporaryFile.seek() return value (pythonGH-19540)
  Minor modernization and readability improvement to the tokenizer example (pythonGH-19558)
  bpo-40294: Fix _asyncio when module is loaded/unloaded multiple times (pythonGH-19542)
  Fix parameter names in assertIn() docs (pythonGH-18829)
  bpo-39793: use the same domain on make_msgid tests (python#18698)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@jaraco jaraco jaraco approved these changes

Uh oh!

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

Assignees

No one assigned

Labels

skip news tests Tests in the Lib/test dir

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

@yan12125 @jaraco @miss-islington @the-knights-who-say-ni @bedevere-bot
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.