Title: shutil.copyfile should use ReFS block-level linking on Windows (by invoking CopyFileW) · Issue #137074 · python/cpython · GitHub
Open Graph Title: shutil.copyfile should use ReFS block-level linking on Windows (by invoking CopyFileW) · Issue #137074 · python/cpython
X Title: shutil.copyfile should use ReFS block-level linking on Windows (by invoking CopyFileW) · Issue #137074 · python/cpython
Description: Bug report Bug description: shutil.copyfile("./scratch.txt", "./target.txt") copyfile for copies within a single ReFS volume (or Dev Drive) on Windows 11 does not take advantage of block-level linking capability present in ReFS file syst...
Open Graph Description: Bug report Bug description: shutil.copyfile("./scratch.txt", "./target.txt") copyfile for copies within a single ReFS volume (or Dev Drive) on Windows 11 does not take advantage of block-level link...
X Description: Bug report Bug description: shutil.copyfile("./scratch.txt", "./target.txt") copyfile for copies within a single ReFS volume (or Dev Drive) on Windows 11 does not take advantage...
Opengraph URL: https://github.com/python/cpython/issues/137074
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"shutil.copyfile should use ReFS block-level linking on Windows (by invoking CopyFileW)","articleBody":"# Bug report\n\n### Bug description:\n\n```python\nshutil.copyfile(\"./scratch.txt\", \"./target.txt\")\n```\n\ncopyfile for copies within a single ReFS volume (or Dev Drive) on Windows 11 does not take advantage of block-level linking capability present in ReFS file system. On the other hand, the kernel automatically does so when you invoke CopyFileW these days. C#/.NET use kernel functions for file copy APIs and automatically take advantage of this too.\n\nPython does not offer an API that takes advantage of block-level linking except for directly invoking CopyFileW using windlls.kernel32 from ctypes.\n\nhttps://docs.python.org/3/library/shutil.html#shutil-platform-dependent-efficient-copy-operations\nCopyFileW should be used instead of streaming data from one file to another, at least in circumstances where block-level linking is possible.\n\nRelevant code: https://github.com/python/cpython/blob/e93c30d4666f925c6a5a2cc4952f69782760d101/Lib/shutil.py#L313\n\n### CPython versions tested on:\n\n3.9\n\n### Operating systems tested on:\n\nWindows","author":{"url":"https://github.com/Dico200","@type":"Person","name":"Dico200"},"datePublished":"2025-07-24T11:51:35.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":8},"url":"https://github.com/137074/cpython/issues/137074"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:cc1b5c63-191c-85c5-bed9-e20afcdf95ba |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E6DC:2C2C4D:28B8809:37253D4:696ADCEA |
| html-safe-nonce | 67b550e806b9814149626e4fad7c93f6ed866f7adf0de243c3873fdc7dde8548 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNkRDOjJDMkM0RDoyOEI4ODA5OjM3MjUzRDQ6Njk2QURDRUEiLCJ2aXNpdG9yX2lkIjoiODU3MDQwNTMxMzA0OTE4OTYxMCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | f0db77801369a8c295ff2df1359eb891eca2e21402e339d79d48f44ef159c4cf |
| hovercard-subject-tag | issue:3259613533 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/137074/issue_layout |
| twitter:image | https://opengraph.githubassets.com/16aebfd1af3e9e9b672bf5033caef1af73301baeabd2d3b925aef0e86e0c4a48/python/cpython/issues/137074 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/16aebfd1af3e9e9b672bf5033caef1af73301baeabd2d3b925aef0e86e0c4a48/python/cpython/issues/137074 |
| og:image:alt | Bug report Bug description: shutil.copyfile("./scratch.txt", "./target.txt") copyfile for copies within a single ReFS volume (or Dev Drive) on Windows 11 does not take advantage of block-level link... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Dico200 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5f99f7c1d70f01da5b93e5ca90303359738944d8ab470e396496262c66e60b8d |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 524a93f2c1f36522a3b4be4c110467ee4172245d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width