[issue36488] BSD/OSX: os.sendfile() does not return bytes sent on EINTR

Giampaolo Rodola' report at bugs.python.org
Sat Mar 30 12:47:38 EDT 2019


New submission from Giampaolo Rodola' <g.rodola at gmail.com>:

>From "man sendfile" on both OSX and FreeBSD:

<<[EINTR] A signal interrupted sendfile() before it could be completed. If specified, the number of bytes successfully sent will be returned in *len.>>

Right now we catch EINTR and simply retry. Instead we should only retry is no bytes were sent, else we should return those bytes, similarly to what we do on EAGAIN and EBUSY:
https://github.com/python/cpython/blob/2438cdf0e932a341c7613bf4323d06b91ae9f1f1/Modules/posixmodule.c#L8907-L8917

----------
components: Library (Lib)
messages: 339214
nosy: giampaolo.rodola
priority: normal
severity: normal
stage: needs patch
status: open
title: BSD/OSX: os.sendfile() does not return bytes sent on EINTR
versions: Python 3.6, Python 3.7, Python 3.8

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


More information about the Python-bugs-list mailing list