Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

GH-142407: Doc: Clarify shutil.copyfile() does not use CopyFile2 on Windows#144354

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
xiatianxuan wants to merge1 commit intopython:main
base:main
Choose a base branch
Loading
fromxiatianxuan:GH-142407-update-shutil-docs

Conversation

@xiatianxuan
Copy link

@xiatianxuanxiatianxuan commentedJan 31, 2026
edited by github-actionsbot
Loading

The current documentation forshutil implies that all copy functions benefit from fast kernel-space copying on Windows via theCopyFile2 API. However,shutil.copyfile() is an exception — it still uses a userspace read/write loop.

This PR clarifies that:

  • shutil.copy(),copy2(),copytree(), andmove() useCopyFile2 (when available)
  • shutil.copyfile() doesnot, and remains a buffered userspace copy
  • Provides practical guidance: prefercopy2() overcopyfile() for better performance on Windows when metadata preservation is acceptable

The change has been verified by:

  • Building the docs locally withmake html (0 warnings)
  • Confirming the rendered HTML displays the updated text correctly

Related toGH-142407.


📚 Documentation preview 📚:https://cpython-previews--144354.org.readthedocs.build/

@python-cla-bot
Copy link

python-cla-botbot commentedJan 31, 2026
edited
Loading

All commit authors signed the Contributor License Agreement.

CLA signed

@bedevere-appbedevere-appbot added docsDocumentation in the Doc dir skip news awaiting review labelsJan 31, 2026
@xiatianxuanxiatianxuan changed the titleDoc: Clarify that shutil.copyfile() does not use CopyFile2 on WindowsGH-142407: Doc: Clarify shutil.copyfile() does not use CopyFile2 on WindowsJan 31, 2026
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@giampaologiampaoloAwaiting requested review from giampaologiampaolo is a code owner

Assignees

No one assigned

Labels

awaiting reviewdocsDocumentation in the Doc dirskip news

Projects

Status: Todo

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

@xiatianxuan

[8]ページ先頭

©2009-2026 Movatter.jp