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
jump.SSHSession.get function uses the following codes to get a remote file and the write to a local file:
with open(local_path, mode='w') as local_file:
with sftp_client.file(copy_path) as remote_file:
local_file.write(remote_file.read().decode('utf-8'))
When the remote file is in binary format such as PCAP file, it fails at the decode('utf-8').
The following should work for binary file:
with open(local_path, mode='wb') as local_file:
with sftp_client.file(copy_path) as remote_file:
local_file.write(remote_file.read())
A file format argument may be added to distinguish the ascii/text from bin (binary) type.
The text was updated successfully, but these errors were encountered:
jump.SSHSession.get function uses the following codes to get a remote file and the write to a local file:
with open(local_path, mode='w') as local_file:
with sftp_client.file(copy_path) as remote_file:
local_file.write(remote_file.read().decode('utf-8'))
When the remote file is in binary format such as PCAP file, it fails at the decode('utf-8').
The following should work for binary file:
with open(local_path, mode='wb') as local_file:
with sftp_client.file(copy_path) as remote_file:
local_file.write(remote_file.read())
A file format argument may be added to distinguish the ascii/text from bin (binary) type.
The text was updated successfully, but these errors were encountered: