You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
socket.socket.sendfile and asyncio.base_events.BaseEventLoop.sock_sendfile rely on st_size to determine an amount of bytes to be sent if count is not provided.
But st_size is equal to zero for pseudo files like /proc/cpuinfo on Linux. Therefore, the methods send no data for such files.
@kumaraditya303 I do not have any use case, and I have not looked for fixing options.
I was exploring peculiarities of using the copy_file_range syscall for a pseudo file, and checked if a similar issue related to pseudo files exists in Python. That is how I found this issue.
Bug report
socket.socket.sendfile
andasyncio.base_events.BaseEventLoop.sock_sendfile
rely onst_size
to determine an amount of bytes to be sent ifcount
is not provided.But
st_size
is equal to zero for pseudo files like/proc/cpuinfo
on Linux. Therefore, the methods send no data for such files.Related code
cpython/Lib/socket.py
Lines 355 to 360 in a637c09
cpython/Lib/asyncio/unix_events.py
Lines 361 to 367 in 13c10bf
Example
Assuming
nc -lkU some.sock
and./python -m asyncio
run in the same directory:The text was updated successfully, but these errors were encountered: