[issue36610] os.sendfile can return EINVAL on Solaris

Giampaolo Rodola' report at bugs.python.org
Thu May 30 00:23:35 EDT 2019


Giampaolo Rodola' <g.rodola at gmail.com> added the comment:

I currently have no Solaris box to test this against and am currently short on time but I'm of the opinion that because of:

   > Sendfile on Solaris can raise EINVAL if offset is equal or bigger than the size
   > of the file (Python expects that it will return 0 bytes sent in that case).

...and the fact that beta1 will happen soon it's safer to use sendfile() on Linux only. Googling for "solaris + sendfile" also raises suspicions that sendfile() may be broken on Solaris. shutil.copyfile() is too central to risk breaking it. 

We may also want to look at socket.sendfile() implementation and add tests for large files for both functions (socket.sendfile() and shutil.copyfile()). I'm adding that to my TODO list.

----------
versions:  -Python 3.7

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue36610>
_______________________________________


More information about the Python-bugs-list mailing list