[issue25156] shutil.copyfile should internally use os.sendfile when possible

desbma report at bugs.python.org
Thu Oct 29 05:36:16 EDT 2015


desbma added the comment:

Thanks for the comment.

> Also, the os.sendfile() doc suggests that some platforms only support writing to sockets, so I definitely think a backup plan is needed.

You are right, the man page clearly says:
> Applications may wish to fall back to read(2)/write(2) in the case
> where sendfile() fails with EINVAL or ENOSYS.

I will improve the code and add tests for conditions where sendfile fails.

I have tested it manually, but I will also add a test with a copy of a file > 4GB (it causes several calls to sendfile).

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue25156>
_______________________________________


More information about the Python-bugs-list mailing list