akira added the comment:

Should socket.sendfile() always return number of bytes sent because file.tell() 
may be changed by something else that uses the same file descriptor?

What happens if the file grows?

Instead of returning `(was_os_sendfile_used, os_sendfile_error)`, you could 
specify `no_fallback=False` that could be set to `True` to assert that the 
fallback is not used (with `no_fallback=True` the `os_sendfile_error` is raised 
instead of using socket.send() as a fallback). 

If possible; always include number of bytes sent in any error that is raised.

----------
nosy: +akira

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue17552>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to