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
{{ message }}
Repository navigation
Channel Exception on write with buffer API objects #968
Similar to #967, the paramiko socket-like Channel.send() method throws an Exception if passed an object that implements the buffer API, such as the builtin memoryview type.
From the Channel docstring:
A Channel is meant to behave like a socket, and has an API that should be indistinguishable from the Python socket API.
Traceback (most recent call last):
...
File ".../osutils.py", line 2181, in send_all
sent = sock.send(view[sent_total:sent_total+MAX_SOCKET_CHUNK])
File ".../paramiko/channel.py", line 715, in send
return self._send(s, m)
File ".../paramiko/channel.py", line 1080, in _send
m.add_string(s[:size])
File ".../paramiko/message.py", line 285, in add_string
s = asbytes(s)
File ".../paramiko/common.py", line 170, in asbytes
raise Exception('Unknown type')
Exception: Unknown type
A native socket raises TypeError for send with non string or buffer types.
Activity
Allow any buffer type to be sent to Channel
Allow any buffer type to be written to SFTPFile
bitprophet commentedon May 31, 2017
Rolling into the final PR. Thanks!
Allow any buffer type to be sent to Channel
Allow any buffer type to be written to SFTPFile
Allow any buffer type to be sent to Channel
Allow any buffer type to be written to SFTPFile