Skip to content

Commit e9935cb

Browse files
committed
sftp: Fix downloading files
Fixes: #341 Signed-off-by: Jakub Jelen <jjelen@redhat.com>
1 parent 64f6cac commit e9935cb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/pylibsshext/sftp.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ cdef class SFTP:
100100
raise LibsshSFTPException("Reading data from remote file [%s] failed with error [%s]"
101101
% (remote_file, self._get_sftp_error_str()))
102102

103-
with open(local_file, 'wb+') as f:
103+
with open(local_file, 'ab') as f:
104104
bytes_written = f.write(read_buffer[:file_data])
105105
if bytes_written and file_data != bytes_written:
106106
sftp.sftp_close(rf)

0 commit comments

Comments
 (0)