Thanks to visit codestin.com
Credit goes to github.com

Skip to content

test_script_shadowing_stdlib_cwd_failure fails on AIX #138854

@furkanonder

Description

@furkanonder

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions