This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mcepl
Recipients mcepl, vstinner
Date 2020-03-04.19:21:51
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1583349711.75.0.193414352095.issue39855@roundup.psfhosted.org>
In-reply-to
Content
When testing Python from Python-3.9.0a3.tar.xz two test cases file in the limited build environment for openSUSE. We have very limited number of users there:

stitny:/home/abuild/rpmbuild/BUILD/Python-3.9.0a3 # cat /etc/passwd 
root:x:0:0:root:/root:/bin/bash
abuild:x:399:399:Autobuild:/home/abuild:/bin/bash
stitny:/home/abuild/rpmbuild/BUILD/Python-3.9.0a3 #

So, tests which expect existence of the user 'nobody' fail:

[  747s] ======================================================================
[  747s] ERROR: test_user (test.test_subprocess.POSIXProcessTestCase) (user='nobody', close_fds=False)
[  747s] ----------------------------------------------------------------------
[  747s] Traceback (most recent call last):
[  747s]   File "/home/abuild/rpmbuild/BUILD/Python-3.9.0a3/Lib/test/test_subprocess.py", line 1805, in test_user
[  747s]     output = subprocess.check_output(
[  747s]   File "/home/abuild/rpmbuild/BUILD/Python-3.9.0a3/Lib/subprocess.py", line 419, in check_output
[  747s]     return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
[  747s]   File "/home/abuild/rpmbuild/BUILD/Python-3.9.0a3/Lib/subprocess.py", line 510, in run
[  747s]     with Popen(*popenargs, **kwargs) as process:
[  747s]   File "/home/abuild/rpmbuild/BUILD/Python-3.9.0a3/Lib/subprocess.py", line 929, in __init__
[  747s]     uid = pwd.getpwnam(user).pw_uid
[  747s] KeyError: "getpwnam(): name not found: 'nobody'"
[  747s] 
[  747s] ======================================================================
[  747s] ERROR: test_user (test.test_subprocess.POSIXProcessTestCase) (user='nobody', close_fds=True)
[  747s] ----------------------------------------------------------------------
[  747s] Traceback (most recent call last):
[  747s]   File "/home/abuild/rpmbuild/BUILD/Python-3.9.0a3/Lib/test/test_subprocess.py", line 1805, in test_user
[  747s]     output = subprocess.check_output(
[  747s]   File "/home/abuild/rpmbuild/BUILD/Python-3.9.0a3/Lib/subprocess.py", line 419, in check_output
[  747s]     return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
[  747s]   File "/home/abuild/rpmbuild/BUILD/Python-3.9.0a3/Lib/subprocess.py", line 510, in run
[  747s]     with Popen(*popenargs, **kwargs) as process:
[  747s]   File "/home/abuild/rpmbuild/BUILD/Python-3.9.0a3/Lib/subprocess.py", line 929, in __init__
[  747s]     uid = pwd.getpwnam(user).pw_uid
[  747s] KeyError: "getpwnam(): name not found: 'nobody'"
[  747s] 
[  747s] ----------------------------------------------------------------------
[  747s]

I am not sure what is the proper solution here. Whether test should be skipped if nobody doesn’t exist, or the test should switch to user 0, or the current user?
History
Date User Action Args
2020-03-04 19:21:51mceplsetrecipients: + mcepl, vstinner
2020-03-04 19:21:51mceplsetmessageid: <1583349711.75.0.193414352095.issue39855@roundup.psfhosted.org>
2020-03-04 19:21:51mcepllinkissue39855 messages
2020-03-04 19:21:51mceplcreate