]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
GH-73991: Rework `pathlib.Path.copytree()` into `copy()` (#122369)
authorBarney Gale <barney.gale@gmail.com>
Sun, 11 Aug 2024 21:43:18 +0000 (22:43 +0100)
committerGitHub <noreply@github.com>
Sun, 11 Aug 2024 21:43:18 +0000 (22:43 +0100)
commita6644d446416dbe3eab26839a32f79c4e73d3aeb
treea356f0865fe48c81c2bba66b69dd2029b1ddc424
parentea70439bd2b5a1c881342646f30942f527f61373
GH-73991: Rework `pathlib.Path.copytree()` into `copy()` (#122369)

Rename `pathlib.Path.copy()` to `_copy_file()` (i.e. make it private.)

Rename `pathlib.Path.copytree()` to `copy()`, and add support for copying
non-directories. This simplifies the interface for users, and nicely
complements the upcoming `move()` and `delete()` methods (which will also
accept any type of file.)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Doc/library/pathlib.rst
Doc/whatsnew/3.14.rst
Lib/pathlib/__init__.py
Lib/pathlib/_abc.py
Lib/pathlib/_local.py
Lib/pathlib/_os.py
Lib/test/test_pathlib/test_pathlib.py
Lib/test/test_pathlib/test_pathlib_abc.py
Misc/NEWS.d/next/Library/2024-05-15-01-36-08.gh-issue-73991.CGknDf.rst
Misc/NEWS.d/next/Library/2024-06-19-03-09-11.gh-issue-73991.lU_jK9.rst [deleted file]