Skip to content

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

Merged
encukou merged 2 commits into
python:mainfrom
serhiy-storchaka:test_subprocess-test_user
Jan 18, 2024
Merged

gh-104522: Fix test_subprocess failure when build Python in the root home directory#114236
encukou merged 2 commits into
python:mainfrom
serhiy-storchaka:test_subprocess-test_user

Conversation

@serhiy-storchaka

@serhiy-storchaka serhiy-storchaka commented Jan 18, 2024

Copy link
Copy Markdown
Member

EPERM is raised when setreuid() fails.
EACCES is set in execve() when the test user has not access to sys.executable.

… root home directory

EPERM is raised when setreuid() fails.
EACCES is set in execve() when the test user has not access to sys.executable.
@serhiy-storchaka

Copy link
Copy Markdown
Member Author

!buildbot root

@bedevere-bot

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @serhiy-storchaka for commit 8fb5878 🤖

The command will test the builders whose names match following regular expression: root

The builders matched are:

  • AMD64 Debian root PR

if e.errno == errno.EACCES:
self.assertEqual(e.filename, sys.executable)
else:
self.assertIsNone(e.filename)

Copy link
Copy Markdown
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.

@encukou

encukou commented Jan 18, 2024

Copy link
Copy Markdown
Member

I've adjusted the comment. Hope you don't mind me pushing directly. (GitHub doesn't allow suggestions for code that's too far away from the change.)

@serhiy-storchaka

Copy link
Copy Markdown
Member Author

Absolutely not. Thank you @encukou for updating the comment.

Initially this test only ignored EPERM. Then ignoring EACCES was added in #16091 to fix exactly the same error on the buildbot, but the comment was not updated.

@encukou
encukou merged commit 311d1e2 into python:main Jan 18, 2024
@miss-islington-app

Copy link
Copy Markdown

Thanks @serhiy-storchaka for the PR, and @encukou for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12.
🐍🍒⛏🤖 I'm not a witch! I'm not a witch!

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jan 18, 2024
… root home directory (pythonGH-114236)

* pythongh-104522: Fix test_subprocess failure when build Python in the root home directory

EPERM is raised when setreuid() fails.
EACCES is set in execve() when the test user has not access to sys.executable.
(cherry picked from commit 311d1e2)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
@miss-islington-app

Copy link
Copy Markdown

Sorry, @serhiy-storchaka and @encukou, I could not cleanly backport this to 3.11 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 311d1e2701037952eaf75f993be76f3092c1f01c 3.11

@bedevere-app

bedevere-app Bot commented Jan 18, 2024

Copy link
Copy Markdown

GH-114239 is a backport of this pull request to the 3.12 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.12 only security fixes label Jan 18, 2024
@serhiy-storchaka
serhiy-storchaka deleted the test_subprocess-test_user branch January 18, 2024 11:23
@serhiy-storchaka serhiy-storchaka added needs backport to 3.11 only security fixes and removed needs backport to 3.11 only security fixes labels Jan 18, 2024
@miss-islington-app

Copy link
Copy Markdown

Thanks @serhiy-storchaka for the PR, and @encukou for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11.
🐍🍒⛏🤖 I'm not a witch! I'm not a witch!

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jan 18, 2024
… root home directory (pythonGH-114236)

* pythongh-104522: Fix test_subprocess failure when build Python in the root home directory

EPERM is raised when setreuid() fails.
EACCES is set in execve() when the test user has not access to sys.executable.
(cherry picked from commit 311d1e2)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
@bedevere-app

bedevere-app Bot commented Jan 18, 2024

Copy link
Copy Markdown

GH-114245 is a backport of this pull request to the 3.11 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.11 only security fixes label Jan 18, 2024
encukou pushed a commit that referenced this pull request Jan 18, 2024
…e root home directory (GH-114236) (GH-114239)

EPERM is raised when setreuid() fails.
EACCES is set in execve() when the test user has not access to sys.executable.
(cherry picked from commit 311d1e2)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
encukou pushed a commit that referenced this pull request Jan 18, 2024
…e root home directory (GH-114236) (GH-114245)

EPERM is raised when setreuid() fails.
EACCES is set in execve() when the test user has not access to sys.executable.
(cherry picked from commit 311d1e2)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
kulikjak pushed a commit to kulikjak/cpython that referenced this pull request Jan 22, 2024
… root home directory (pythonGH-114236)

* pythongh-104522: Fix test_subprocess failure when build Python in the root home directory

EPERM is raised when setreuid() fails.
EACCES is set in execve() when the test user has not access to sys.executable.
aisk pushed a commit to aisk/cpython that referenced this pull request Feb 11, 2024
… root home directory (pythonGH-114236)

* pythongh-104522: Fix test_subprocess failure when build Python in the root home directory

EPERM is raised when setreuid() fails.
EACCES is set in execve() when the test user has not access to sys.executable.
Glyphack pushed a commit to Glyphack/cpython that referenced this pull request Sep 2, 2024
… root home directory (pythonGH-114236)

* pythongh-104522: Fix test_subprocess failure when build Python in the root home directory

EPERM is raised when setreuid() fails.
EACCES is set in execve() when the test user has not access to sys.executable.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip news tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants