GH-73991: Add `pathlib.Path.copy()` by barneygale · Pull Request #119058 · python/cpython · GitHub

github.com

Tin mới

barneygale:gh-73991-copy

GitHub CopilotWrite better code with AI

GitHub Copilot appDirect agents from issue to merge

ActionsAutomate any workflow

CodespacesInstant dev environments

IssuesPlan and track work

Code ReviewManage code changes

Code QualityEnforce quality at merge

GitHub Advanced SecurityFind and fix vulnerabilities

Code securitySecure your code as you build

Secret protectionStop leaks before they start

View all use cases

Financial services

View all industries

Software Development

GitHub SponsorsFund open source developers

Copilot for BusinessEnterprise-grade AI features

Premium SupportEnterprise-grade 24/7 support

Pull requests 2.6k

Security and quality 0

shutil: add reflink=False to file copy functions to control clone/CoW copies (use copy_file_range) #81338

Use copy_file_range() in shutil.copyfile() (server-side copy) #81340

Support moving across filesystems in pathlib.Path, as shutil.move() does #73991

pathlib.Path.copy()

awaiting core review

awaiting core review

Fix tests, add news

Comment on use of shutil.copy2()

Use fcopyfile() / sendfile() where available.

Merge branch 'main' into

Drop usage of shutil

Fix tests, add FICLONE support

View reviewed changes

Learn more about hiding disruptive comments

The reason will be displayed to describe this comment to others. Learn more.

Move to pathlib._os.

Move a bit more code into _os.

Handle classes that subclass PathBase and os.PathLike but not Path.

[WIP] GH-73991: Add os.copy() and friends #119079

View reviewed changes

Add test for directory symlinks

Fix handling of symlinks to directories on Windows.

Expose _winapi.COPY_FILE_DIRECTORY

Test copying empty file.

View reviewed changes

Apply suggestions from code review

Drop follow_symlinks argument for now.

Merge branch 'main' into

Merge branch 'main' into

pathlib.Path.copy()

pathlib.Path.copy()

pathlib.Path.copy()