This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ned.deily
Recipients ned.deily, pablogsal, ronaldoussoren, serhiy.storchaka
Date 2018-06-16.16:02:48
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1529164968.77.0.56676864532.issue33871@psf.upfronthosting.co.za>
In-reply-to
Content
Test case:

import os
fo = open('/tmp/temp', 'wb')
fi = open('/tmp/temp', 'rb')
os.sendfile(fo.fileno(), fi.fileno(), 0, 0, headers=[b'x' * 2**16] * 2**15)

--
run against current master HEAD (2f9cbaa8b2190b6dfd3157ede9b6973523a3b939, as of 2018-06-15)
--with-pydebug
current macOS 10.13.5


64-bit Python

$ ./bin/python3.8 ~/Desktop/test_s.py
Traceback (most recent call last):
 File "/Users/nad/Desktop/test_s.py", line 4, in <module>
   os.sendfile(fo.fileno(), fi.fileno(), 0, 0, headers=[b'x' * 2**16] * 2**15)
OSError: [Errno 38] Socket operation on non-socket
sys:1: ResourceWarning: unclosed file <_io.BufferedWriter name='/tmp/temp'>
sys:1: ResourceWarning: unclosed file <_io.BufferedReader name='/tmp/temp'>


32-bit Python

$ ./bin/python3.8-32 ~/Desktop/test_s.py
Fatal Python error: a function returned NULL without setting an error
SystemError: <built-in function sendfile> returned NULL without setting an error

Current thread 0xa983a1c0 (most recent call first):
 File "/Users/nad/Desktop/test_s.py", line 4 in <module>
Abort trap: 6
History
Date User Action Args
2018-06-16 16:02:48ned.deilysetrecipients: + ned.deily, ronaldoussoren, serhiy.storchaka, pablogsal
2018-06-16 16:02:48ned.deilysetmessageid: <1529164968.77.0.56676864532.issue33871@psf.upfronthosting.co.za>
2018-06-16 16:02:48ned.deilylinkissue33871 messages
2018-06-16 16:02:48ned.deilycreate