Bug report
Bug description:
The test_script_shadowing_stdlib_cwd_failure in test_import is failing on AIX because the operating system prevents deletion of the current working directory while it's in use, similar to Windows and Solaris.
IBM's rmdir() API documentation explicitly states: "If path refers to the current directory of the current job, to the 'root' (/) directory, or to a directory that cannot be removed, the [EBUSY] error is returned."
Configuration
./configure --with-pydebug
Test
./python -m unittest Lib.test.test_import.ImportTests.test_script_shadowing_stdlib_cwd_failure
F
======================================================================
FAIL: test_script_shadowing_stdlib_cwd_failure (Lib.test.test_import.ImportTests.test_script_shadowing_stdlib_cwd_failure)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/python/pdev/cpython-main/Lib/test/test_import/__init__.py", line 1209, 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/tmpyzvecopd/subtmp/main.py", line 7, in <module>\n File "/python/pdev/cpython-main/Lib/shutil.py", line 852, in rmtree\n _rmtree_impl(path, dir_fd, onexc)\n ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^\n File "/python/pdev/cpython-main/Lib/shutil.py", line 721, in _rmtree_safe_fd\n _rmtree_safe_fd_step(stack, onexc)\n ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^\n File "/python/pdev/cpython-main/Lib/shutil.py", line 802, in _rmtree_safe_fd_step\n onexc(func, path, err)\n ~~~~~^^^^^^^^^^^^^^^^^\n File "/python/pdev/cpython-main/Lib/shutil.py", line 753, in _rmtree_safe_fd_step\n os.rmdir(name, dir_fd=dirfd)\n ~~~~~~~~^^^^^^^^^^^^^^^^^^^^\nOSError: [Errno 16] Device busy: \'/tmp/tmpyzvecopd/subtmp\'\n'
----------------------------------------------------------------------
Ran 1 test in 0.270s
FAILED (failures=1)
Environment
- AIX Version: 7200-05-05-2245 (AIX 7.2 TL5 SP5)
CPython versions tested on:
CPython main branch, 3.15, 3.14, 3.13
Operating systems tested on:
Other
Linked PRs
Bug report
Bug description:
The
test_script_shadowing_stdlib_cwd_failureintest_importis failing on AIX because the operating system prevents deletion of the current working directory while it's in use, similar to Windows and Solaris.IBM's rmdir() API documentation explicitly states: "If path refers to the current directory of the current job, to the 'root' (/) directory, or to a directory that cannot be removed, the [EBUSY] error is returned."
Configuration
Test
Environment
CPython versions tested on:
CPython main branch, 3.15, 3.14, 3.13
Operating systems tested on:
Other
Linked PRs