[New-bugs-announce] [issue30481] lib/socket.py, line 330, Treated 'file' as a socket object, instead of int
Mohamad amin Khakzadan
report at bugs.python.org
Fri May 26 05:10:16 EDT 2017
New submission from Mohamad amin Khakzadan:
When I network programming, I got this problem:
File "ft.py", line 43, in SendFile
sent=conn.sendfile(fd.fileno(), offset)
File "D:\Program Files\Python\Python35-32\lib\socket.py", line 391, in sendfile
return self._sendfile_use_send(file, offset, count)
File "D:\Program Files\Python\Python35-32\lib\socket.py", line 330, in _sendfile_use_send
file_read = file.read
AttributeError: 'int' object has no attribute 'read'
file_read = file.read
^
'file' is fd.fileno() not a socket object
socket.sendfile() documentation:
https://docs.python.org/3/library/socket.html#socket.socket.sendfile
----------
components: Windows
messages: 294539
nosy: Mohamad amin Khakzadan, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: lib/socket.py, line 330, Treated 'file' as a socket object, instead of int
type: compile error
versions: Python 3.5
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue30481>
_______________________________________
More information about the New-bugs-announce
mailing list