Skip to content

gh-130932: cwd cannot be removed on Solaris/Illumos #131037

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 1 commit into from
Mar 11, 2025

Conversation

kulikjak
Copy link
Contributor

@kulikjak kulikjak commented Mar 10, 2025

Recently introduced test_script_shadowing_stdlib_cwd_failure (#130934) fails on Solaris/Illumos, because, similarly to Windows, cwd cannot be removed. Instead, it fails with OSError: [Errno 22] Invalid argument.

======================================================================
FAIL: test_script_shadowing_stdlib_cwd_failure (test.test_import.ImportTests.test_script_shadowing_stdlib_cwd_failure)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builds/jkulik/permanent/buildbot-worker/worker/python-main.ulx-0-oracle-solaris-trunk-amd64/build/components/python/pythonmain/cpython-main/Lib/test/test_import/__init__.py", line 1208, in test_script_shadowing_stdlib_cwd_failure
    self.assertRegex(stdout, expected_error)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: Regex didn't match: b"AttributeError: module 'os' has no attribute 'does_not_exist'" not found in b'Traceback (most recent call last):\n  File "<string>", line 1, in <module>\n    import main\n  File "/tmp/test_python_2l_0nt7c/tmp_zo8bxtz/subtmp/main.py", line 7, in <module>\n  File "/builds/jkulik/permanent/buildbot-worker/worker/python-main.ulx-0-oracle-solaris-trunk-amd64/build/components/python/pythonmain/cpython-main/Lib/shutil.py", line 845, in rmtree\n    _rmtree_impl(path, dir_fd, onexc)\n    ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^\n  File "/builds/jkulik/permanent/buildbot-worker/worker/python-main.ulx-0-oracle-solaris-trunk-amd64/build/components/python/pythonmain/cpython-main/Lib/shutil.py", line 714, in _rmtree_safe_fd\n    _rmtree_safe_fd_step(stack, onexc)\n    ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^\n  File "/builds/jkulik/permanent/buildbot-worker/worker/python-main.ulx-0-oracle-solaris-trunk-amd64/build/components/python/pythonmain/cpython-main/Lib/shutil.py", line 795, in _rmtree_safe_fd_step\n    onexc(func, path, err)\n    ~~~~~^^^^^^^^^^^^^^^^^\n  File "/builds/jkulik/permanent/buildbot-worker/worker/python-main.ulx-0-oracle-solaris-trunk-amd64/build/components/python/pythonmain/cpython-main/Lib/shutil.py", line 746, in _rmtree_safe_fd_step\n    os.rmdir(name, dir_fd=dirfd)\n    ~~~~~~~~^^^^^^^^^^^^^^^^^^^^\nOSError: [Errno 22] Invalid argument: \'/tmp/test_python_2l_0nt7c/tmp_zo8bxtz/subtmp\'\n'

@vstinner vstinner added skip news needs backport to 3.13 bugs and security fixes labels Mar 11, 2025
@vstinner vstinner merged commit 69309a5 into python:main Mar 11, 2025
44 checks passed
@miss-islington-app
Copy link

Thanks @kulikjak for the PR, and @vstinner 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 Mar 11, 2025
@bedevere-app
Copy link

bedevere-app bot commented Mar 11, 2025

GH-131073 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 Mar 11, 2025
vstinner pushed a commit that referenced this pull request Mar 11, 2025
#131073)

gh-130932: cwd cannot be removed on Solaris/Illumos (GH-131037)
(cherry picked from commit 69309a5)

Co-authored-by: Jakub Kulík <[email protected]>
seehwan pushed a commit to seehwan/cpython that referenced this pull request Apr 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants