Skip to content

GH-125413: Add private pathlib.Path method to write metadata #130238

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Feb 26, 2025

Conversation

barneygale
Copy link
Contributor

@barneygale barneygale commented Feb 17, 2025

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.

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.
@barneygale barneygale changed the title GH-129897: Add private pathlib.Path method to write metadata GH-125413: Add private pathlib.Path method to write metadata Feb 17, 2025
@barneygale barneygale marked this pull request as draft February 17, 2025 20:05
@barneygale barneygale merged commit b251d40 into python:main Feb 26, 2025
39 checks passed
seehwan pushed a commit to seehwan/cpython that referenced this pull request Apr 16, 2025
…ython#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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant