|
31 | 31 | from ssh2.exceptions import AuthenticationError, AgentError, \
|
32 | 32 | SessionHandshakeError, SFTPHandleError, SFTPIOError as SFTPIOError_ssh2
|
33 | 33 | from ssh2.session import Session
|
34 |
| -from ssh2.sftp import LIBSSH2_FXF_CREAT, LIBSSH2_FXF_WRITE, \ |
| 34 | +from ssh2.sftp import LIBSSH2_FXF_READ, LIBSSH2_FXF_CREAT, LIBSSH2_FXF_WRITE, \ |
35 | 35 | LIBSSH2_FXF_TRUNC, LIBSSH2_SFTP_S_IRUSR, LIBSSH2_SFTP_S_IRGRP, \
|
36 | 36 | LIBSSH2_SFTP_S_IWUSR, LIBSSH2_SFTP_S_IXUSR, LIBSSH2_SFTP_S_IROTH, \
|
37 | 37 | LIBSSH2_SFTP_S_IXGRP, LIBSSH2_SFTP_S_IXOTH
|
@@ -587,7 +587,9 @@ def _sftp_get(self, remote_fh, local_file):
|
587 | 587 | local_fh.write(data)
|
588 | 588 |
|
589 | 589 | def sftp_get(self, sftp, remote_file, local_file):
|
590 |
| - with self._sftp_openfh(sftp.open, remote_file, 0, 0) as remote_fh: |
| 590 | + with self._sftp_openfh( |
| 591 | + sftp.open, remote_file, |
| 592 | + LIBSSH2_FXF_READ, LIBSSH2_SFTP_S_IRUSR) as remote_fh: |
591 | 593 | try:
|
592 | 594 | self._sftp_get(remote_fh, local_file)
|
593 | 595 | # THREAD_POOL.apply(
|
|
0 commit comments