Visitar URL original
gh-93180: Update documentation of `os.copy_file_range` by illia-v · Pull Request #93182 · python/cpython · GitHub
Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update the note
  • Loading branch information
illia-v committed May 30, 2022
commit 59561bf89eb8f61a5f4334d942b079bca01c3f42
9 changes: 4 additions & 5 deletions Doc/library/os.rst
Original file line number Diff line number Diff line change
Expand Up @@ -817,11 +817,10 @@ as internal buffering of data.

.. note::

This function should not be used for copying a file from special
filesystems like procfs and sysfs because of
`a known issue <https://lore.kernel.org/linux-fsdevel/20210126135012.1.If45b7cdc3ff707bc1efa17f5366057d60603c45f@changeid/>`_.
It will copy nothing and return 0 because file sizes there are not known
to the system.
:func:`os.copy_file_range` should not be used for copying a range of a
Comment thread
illia-v marked this conversation as resolved.
Outdated
pseudo file from a special filesystem like procfs and sysfs. It will
always copy no bytes and return 0 as if the file was empty because of a
known Linux kernel issue.

.. availability:: Linux kernel >= 4.5 or glibc >= 2.27.

Expand Down