diff options
author | Barney Gale <barney.gale@gmail.com> | 2024-06-18 21:15:18 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-18 21:15:18 (GMT) |
commit | 69058e20e420181abdc51094474f590d32cd7174 (patch) | |
tree | f0817ea56ccf1461fb20f93f9ff62dbe17a8fa0c /Lib/test/test_pathlib/test_pathlib.py | |
parent | 49f51deeef901b677853f00e428cbaeb13ecd2f2 (diff) | |
download | cpython-69058e20e420181abdc51094474f590d32cd7174.zip cpython-69058e20e420181abdc51094474f590d32cd7174.tar.gz cpython-69058e20e420181abdc51094474f590d32cd7174.tar.bz2 |
GH-73991: Use same signature for `shutil._rmtree_[un]safe()`. (#120517)
Preparatory work for moving `_rmtree_unsafe()` and `_rmtree_safe_fd()` to
`pathlib._os` so that they can be used from both `shutil` and `pathlib`.
Move implementation-specific setup from `rmtree()` into the safe/unsafe
functions, and give them the same signature `(path, dir_fd, onexc)`.
In the tests, mock `os.open` rather than `_rmtree_safe_fd()` to ensure the
FD-based walk is used, and replace a couple references to
`shutil._use_fd_functions` with `shutil.rmtree.avoids_symlink_attacks`
(which has the same value).
No change of behaviour.
Diffstat (limited to 'Lib/test/test_pathlib/test_pathlib.py')
0 files changed, 0 insertions, 0 deletions