From 7dc38339f70bf7af848ee5e6f33345feb20043dd Mon Sep 17 00:00:00 2001 From: Maxime Daniel Date: Wed, 28 Feb 2018 18:43:47 +0100 Subject: [PATCH 1/2] Don't raise on EAGAIN during sftp open --- ssh2/sftp.pyx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/ssh2/sftp.pyx b/ssh2/sftp.pyx index 24c14c7e..ef915c40 100644 --- a/ssh2/sftp.pyx +++ b/ssh2/sftp.pyx @@ -184,12 +184,18 @@ cdef class SFTP: :raises: :py:class:`ssh2.exceptions.SFTPHandleError` on errors opening file. """ - cdef c_sftp.LIBSSH2_SFTP_HANDLE *_handle + cdef c_sftp.LIBSSH2_SFTP_HANDLE *_handle = NULL cdef bytes b_filename = to_bytes(filename) cdef char *_filename = b_filename + cdef int rc = c_ssh2.LIBSSH2_ERROR_EAGAIN + with nogil: - _handle = c_sftp.libssh2_sftp_open( - self._sftp, _filename, flags, mode) + while _handle == NULL and rc == c_ssh2.LIBSSH2_ERROR_EAGAIN: + _handle = c_sftp.libssh2_sftp_open( + self._sftp, _filename, flags, mode) + + rc = c_ssh2.libssh2_session_last_errno(self._session._session) + if _handle is NULL: raise SFTPHandleError( "Could not open file %s - error code %s - %s", filename, From ae8ce1dc94cdfded37ad475002c8977ef146ae91 Mon Sep 17 00:00:00 2001 From: Maxime Daniel Date: Tue, 27 Mar 2018 16:24:49 +0200 Subject: [PATCH 2/2] Update travis script for local usage --- ci/travis/build-manylinux.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/travis/build-manylinux.sh b/ci/travis/build-manylinux.sh index 3b1e52de..61caacf3 100755 --- a/ci/travis/build-manylinux.sh +++ b/ci/travis/build-manylinux.sh @@ -6,6 +6,6 @@ rm -rf build dist docker pull $docker_tag || echo docker build --cache-from $docker_tag ci/docker/manylinux -t $docker_tag -docker push $docker_tag +# docker push $docker_tag docker run --rm -v `pwd`:/io $docker_tag /io/ci/travis/build-wheels.sh ls wheelhouse/