]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
GH-125413: Add private `pathlib.Path` method to write metadata (#130238)
authorBarney Gale <barney.gale@gmail.com>
Wed, 26 Feb 2025 21:07:27 +0000 (21:07 +0000)
committerGitHub <noreply@github.com>
Wed, 26 Feb 2025 21:07:27 +0000 (21:07 +0000)
commitb251d409f9cf6a84e6d7a78d284467f57c97a63a
tree1cc9ad6e65b48d5a5df7009cdfa5374be869abe2
parent5ba69e747fa9da984a307b2cbc9f82bac1e0db04
GH-125413: Add private `pathlib.Path` method to write metadata (#130238)

Replace `WritablePath._copy_writer` with a new `_write_info()` method. This
method allows the target of a `copy()` to preserve metadata.

Replace `pathlib._os.CopyWriter` and `LocalCopyWriter` classes with new
`copy_file()` and `copy_info()` functions. The `copy_file()` function uses
`source_path.info` wherever possible to save on `stat()`s.
Lib/pathlib/_abc.py
Lib/pathlib/_local.py
Lib/pathlib/_os.py
Misc/NEWS.d/next/Library/2025-02-21-20-16-32.gh-issue-125413.YJ7Msf.rst [new file with mode: 0644]