]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
GH-73991: Support preserving metadata in `pathlib.Path.copytree()` (#121438)
authorBarney Gale <barney.gale@gmail.com>
Sat, 20 Jul 2024 22:32:52 +0000 (23:32 +0100)
committerGitHub <noreply@github.com>
Sat, 20 Jul 2024 22:32:52 +0000 (23:32 +0100)
commitc4c7097e64b0c9cb0081de8872b90594865c892b
tree0a0ef494b3df9b78c90f49031318cc0b4f9148a8
parent094375b9b7e087a4f0f60541dc7f2dc53be92646
GH-73991: Support preserving metadata in `pathlib.Path.copytree()` (#121438)

Add *preserve_metadata* keyword-only argument to `pathlib.Path.copytree()`,
defaulting to false. When set to true, we copy timestamps, permissions,
extended attributes and flags where available, like `shutil.copystat()`.
Doc/library/pathlib.rst
Lib/pathlib/_abc.py
Lib/test/test_pathlib/test_pathlib.py