From 5a409eede307494300979ab58e256d90271ff7c9 Mon Sep 17 00:00:00 2001 From: Tim Way Date: Tue, 11 Nov 2025 22:16:45 -0600 Subject: [PATCH] Remove EOF Check * Cisco SCP server will close the channel after retreiving a file and calling `ssh_scp_pull_request` will return `-1` and raise an exception aborting `get` --- docs/changelog-fragments/786.bugfix.rst | 2 ++ src/pylibsshext/scp.pyx | 6 ------ 2 files changed, 2 insertions(+), 6 deletions(-) create mode 100644 docs/changelog-fragments/786.bugfix.rst diff --git a/docs/changelog-fragments/786.bugfix.rst b/docs/changelog-fragments/786.bugfix.rst new file mode 100644 index 000000000..611eea913 --- /dev/null +++ b/docs/changelog-fragments/786.bugfix.rst @@ -0,0 +1,2 @@ +Remove the SCP EOF message check in the ``get`` method to allow libssh clients +get files from Cisco SCP servers. -- by :user:`timway`. diff --git a/src/pylibsshext/scp.pyx b/src/pylibsshext/scp.pyx index 99887c527..e3115f6a3 100644 --- a/src/pylibsshext/scp.pyx +++ b/src/pylibsshext/scp.pyx @@ -159,12 +159,6 @@ cdef class SCP: remaining_bytes_to_read -= read_bytes if mode >= 0: os.chmod(local_file, mode) - - # Make sure we have finished requesting files - rc = libssh.ssh_scp_pull_request(scp) - if rc != libssh.SSH_SCP_REQUEST_EOF: - raise LibsshSCPException("Unexpected request: %s" % self._get_ssh_error_str()) - finally: if read_buffer is not NULL: PyMem_Free(read_buffer)