8000 gh-104522: Fix test_subprocess failure when build Python in the root home directory by serhiy-storchaka · Pull Request #114236 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-104522: Fix test_subprocess failure when build Python in the root home directory #114236

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

Merged
merged 2 commits into from
Jan 18, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions Lib/test/test_subprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -2018,11 +2018,10 @@ def test_user(self):
user=user,
close_fds=close_fds)
except PermissionError as e: # (EACCES, EPERM)
self.assertIsNone(e.filename)
except OSError as e:
if e.errno not in (errno.EACCES, errno.EPERM):
raise
self.assertIsNone(e.filename)
if e.errno == errno.EACCES:
self.assertEqual(e.filename, sys.executable)
else:
self.assertIsNone(e.filename)
Copy link
Member Author

Choose a reason for hiding this comment

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

Strictly speaking, EPERM can be set in execve() in some circumstances. e.filename will be equal to sys.executable then. But I do not think that they are related to Python tests.

else:
if isinstance(user, str):
user_uid = pwd.getpwnam(user).pw_uid
Expand Down
0