From a615bf49e07fe25e7f627c6139ce06001fc4406a Mon Sep 17 00:00:00 2001 From: Pan Date: Sun, 6 Aug 2017 00:55:04 +0100 Subject: [PATCH 1/6] Implemented channel receive window adjust, x11_*, poll and handle extended data methods. Implemented session get/set blocking, get/set timeout and scp methods and integration tests. Updated agent connection error exception. Updated session method name to match libssh2. Implemented file info extension class for SCP file stat structure. --- ssh2/agent.c | 41 +- ssh2/agent.pyx | 6 +- ssh2/c_ssh2.pxd | 36 +- ssh2/channel.c | 1409 +++++++++++++-- ssh2/channel.pyx | 78 +- ssh2/error_codes.c | 40 +- ssh2/error_codes.pyx | 2 + ssh2/exceptions.c | 38 +- ssh2/exceptions.pxd | 2 +- ssh2/fileinfo.c | 3927 ++++++++++++++++++++++++++++++++++++++++++ ssh2/fileinfo.pxd | 5 + ssh2/fileinfo.pyx | 83 + ssh2/listener.c | 13 +- ssh2/pkey.c | 13 +- ssh2/session.c | 2627 +++++++++++++++++----------- ssh2/session.pyx | 86 +- ssh2/sftp.c | 1252 +++++++------- ssh2/utils.c | 13 +- tests/test_ssh2.py | 63 + 19 files changed, 7887 insertions(+), 1847 deletions(-) create mode 100644 ssh2/fileinfo.c create mode 100644 ssh2/fileinfo.pxd create mode 100644 ssh2/fileinfo.pyx diff --git a/ssh2/agent.c b/ssh2/agent.c index 4744fd06..89d80969 100644 --- a/ssh2/agent.c +++ b/ssh2/agent.c @@ -3,18 +3,18 @@ /* BEGIN: Cython Metadata { "distutils": { - "depends": [], + "depends": [], "extra_compile_args": [ "-ggdb" - ], + ], "libraries": [ "ssh2" - ], - "name": "ssh2.agent", + ], + "name": "ssh2.agent", "sources": [ "ssh2/agent.pyx" ] - }, + }, "module_name": "ssh2.agent" } END: Cython Metadata */ @@ -488,6 +488,7 @@ static CYTHON_INLINE float __PYX_NAN() { #define __PYX_HAVE__ssh2__agent #define __PYX_HAVE_API__ssh2__agent +#include #include #include #include @@ -704,7 +705,7 @@ struct __pyx_obj_4ssh2_7session_Session; struct __pyx_obj_4ssh2_4pkey_PublicKey; struct __pyx_obj_4ssh2_10exceptions_AgentError; struct __pyx_obj_4ssh2_10exceptions_AuthenticationError; -struct __pyx_obj_4ssh2_10exceptions_AgentConnectError; +struct __pyx_obj_4ssh2_10exceptions_AgentConnectionError; struct __pyx_obj_4ssh2_10exceptions_AgentAuthenticationError; struct __pyx_obj_4ssh2_10exceptions_AgentListIdentitiesError; struct __pyx_obj_4ssh2_10exceptions_AgentGetIdentityError; @@ -768,11 +769,11 @@ struct __pyx_obj_4ssh2_10exceptions_AuthenticationError { /* "exceptions.pxd":25 * * - * cdef class AgentConnectError(AgentError): # <<<<<<<<<<<<<< + * cdef class AgentConnectionError(AgentError): # <<<<<<<<<<<<<< * pass * */ -struct __pyx_obj_4ssh2_10exceptions_AgentConnectError { +struct __pyx_obj_4ssh2_10exceptions_AgentConnectionError { struct __pyx_obj_4ssh2_10exceptions_AgentError __pyx_base; }; @@ -1131,6 +1132,8 @@ static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (** static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); +/* Module declarations from 'libc.stdint' */ + /* Module declarations from 'libc.stddef' */ /* Module declarations from 'libc.time' */ @@ -1149,7 +1152,7 @@ static PyObject *(*__pyx_f_4ssh2_4pkey_PyPublicKey)(struct libssh2_agent_publick /* Module declarations from 'ssh2.exceptions' */ static PyTypeObject *__pyx_ptype_4ssh2_10exceptions_AgentError = 0; static PyTypeObject *__pyx_ptype_4ssh2_10exceptions_AuthenticationError = 0; -static PyTypeObject *__pyx_ptype_4ssh2_10exceptions_AgentConnectError = 0; +static PyTypeObject *__pyx_ptype_4ssh2_10exceptions_AgentConnectionError = 0; static PyTypeObject *__pyx_ptype_4ssh2_10exceptions_AgentAuthenticationError = 0; static PyTypeObject *__pyx_ptype_4ssh2_10exceptions_AgentListIdentitiesError = 0; static PyTypeObject *__pyx_ptype_4ssh2_10exceptions_AgentGetIdentityError = 0; @@ -2483,7 +2486,7 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_10disconnect(struct __pyx_obj_4ssh /* Python wrapper */ static PyObject *__pyx_pw_4ssh2_5agent_5Agent_13connect(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static char __pyx_doc_4ssh2_5agent_5Agent_12connect[] = "Agent.connect(self)\nConnect to agent.\n\n :raises: :py:class:`ssh2.exceptions.AgentConnectError` on errors\n connecting to agent.\n\n :rtype: int"; +static char __pyx_doc_4ssh2_5agent_5Agent_12connect[] = "Agent.connect(self)\nConnect to agent.\n\n :raises: :py:class:`ssh2.exceptions.AgentConnectionError` on errors\n connecting to agent.\n\n :rtype: int"; static PyObject *__pyx_pw_4ssh2_5agent_5Agent_13connect(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations @@ -2532,7 +2535,7 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_12connect(struct __pyx_obj_4ssh2_5 * rc = c_ssh2.libssh2_agent_connect(self._agent) * if rc != 0: # <<<<<<<<<<<<<< * with gil: - * raise AgentConnectError("Unable to connect to agent") + * raise AgentConnectionError("Unable to connect to agent") */ __pyx_t_1 = ((__pyx_v_rc != 0) != 0); if (__pyx_t_1) { @@ -2541,7 +2544,7 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_12connect(struct __pyx_obj_4ssh2_5 * rc = c_ssh2.libssh2_agent_connect(self._agent) * if rc != 0: * with gil: # <<<<<<<<<<<<<< - * raise AgentConnectError("Unable to connect to agent") + * raise AgentConnectionError("Unable to connect to agent") * return rc */ { @@ -2553,10 +2556,10 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_12connect(struct __pyx_obj_4ssh2_5 /* "ssh2/agent.pyx":143 * if rc != 0: * with gil: - * raise AgentConnectError("Unable to connect to agent") # <<<<<<<<<<<<<< + * raise AgentConnectionError("Unable to connect to agent") # <<<<<<<<<<<<<< * return rc */ - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4ssh2_10exceptions_AgentConnectError), __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 143, __pyx_L8_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4ssh2_10exceptions_AgentConnectionError), __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 143, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -2567,7 +2570,7 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_12connect(struct __pyx_obj_4ssh2_5 * rc = c_ssh2.libssh2_agent_connect(self._agent) * if rc != 0: * with gil: # <<<<<<<<<<<<<< - * raise AgentConnectError("Unable to connect to agent") + * raise AgentConnectionError("Unable to connect to agent") * return rc */ /*finally:*/ { @@ -2585,7 +2588,7 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_12connect(struct __pyx_obj_4ssh2_5 * rc = c_ssh2.libssh2_agent_connect(self._agent) * if rc != 0: # <<<<<<<<<<<<<< * with gil: - * raise AgentConnectError("Unable to connect to agent") + * raise AgentConnectionError("Unable to connect to agent") */ } } @@ -2618,7 +2621,7 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_12connect(struct __pyx_obj_4ssh2_5 /* "ssh2/agent.pyx":144 * with gil: - * raise AgentConnectError("Unable to connect to agent") + * raise AgentConnectionError("Unable to connect to agent") * return rc # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); @@ -2947,7 +2950,7 @@ static int __Pyx_InitCachedConstants(void) { /* "ssh2/agent.pyx":143 * if rc != 0: * with gil: - * raise AgentConnectError("Unable to connect to agent") # <<<<<<<<<<<<<< + * raise AgentConnectionError("Unable to connect to agent") # <<<<<<<<<<<<<< * return rc */ __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_connect_to_agent); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 143, __pyx_L1_error) @@ -3087,7 +3090,7 @@ PyMODINIT_FUNC PyInit_agent(void) __pyx_ptype_4ssh2_4pkey_PublicKey = __Pyx_ImportType("ssh2.pkey", "PublicKey", sizeof(struct __pyx_obj_4ssh2_4pkey_PublicKey), 1); if (unlikely(!__pyx_ptype_4ssh2_4pkey_PublicKey)) __PYX_ERR(3, 23, __pyx_L1_error) __pyx_ptype_4ssh2_10exceptions_AgentError = __Pyx_ImportType("ssh2.exceptions", "AgentError", sizeof(struct __pyx_obj_4ssh2_10exceptions_AgentError), 1); if (unlikely(!__pyx_ptype_4ssh2_10exceptions_AgentError)) __PYX_ERR(4, 17, __pyx_L1_error) __pyx_ptype_4ssh2_10exceptions_AuthenticationError = __Pyx_ImportType("ssh2.exceptions", "AuthenticationError", sizeof(struct __pyx_obj_4ssh2_10exceptions_AuthenticationError), 1); if (unlikely(!__pyx_ptype_4ssh2_10exceptions_AuthenticationError)) __PYX_ERR(4, 21, __pyx_L1_error) - __pyx_ptype_4ssh2_10exceptions_AgentConnectError = __Pyx_ImportType("ssh2.exceptions", "AgentConnectError", sizeof(struct __pyx_obj_4ssh2_10exceptions_AgentConnectError), 1); if (unlikely(!__pyx_ptype_4ssh2_10exceptions_AgentConnectError)) __PYX_ERR(4, 25, __pyx_L1_error) + __pyx_ptype_4ssh2_10exceptions_AgentConnectionError = __Pyx_ImportType("ssh2.exceptions", "AgentConnectionError", sizeof(struct __pyx_obj_4ssh2_10exceptions_AgentConnectionError), 1); if (unlikely(!__pyx_ptype_4ssh2_10exceptions_AgentConnectionError)) __PYX_ERR(4, 25, __pyx_L1_error) __pyx_ptype_4ssh2_10exceptions_AgentAuthenticationError = __Pyx_ImportType("ssh2.exceptions", "AgentAuthenticationError", sizeof(struct __pyx_obj_4ssh2_10exceptions_AgentAuthenticationError), 1); if (unlikely(!__pyx_ptype_4ssh2_10exceptions_AgentAuthenticationError)) __PYX_ERR(4, 29, __pyx_L1_error) __pyx_ptype_4ssh2_10exceptions_AgentListIdentitiesError = __Pyx_ImportType("ssh2.exceptions", "AgentListIdentitiesError", sizeof(struct __pyx_obj_4ssh2_10exceptions_AgentListIdentitiesError), 1); if (unlikely(!__pyx_ptype_4ssh2_10exceptions_AgentListIdentitiesError)) __PYX_ERR(4, 33, __pyx_L1_error) __pyx_ptype_4ssh2_10exceptions_AgentGetIdentityError = __Pyx_ImportType("ssh2.exceptions", "AgentGetIdentityError", sizeof(struct __pyx_obj_4ssh2_10exceptions_AgentGetIdentityError), 1); if (unlikely(!__pyx_ptype_4ssh2_10exceptions_AgentGetIdentityError)) __PYX_ERR(4, 37, __pyx_L1_error) diff --git a/ssh2/agent.pyx b/ssh2/agent.pyx index 765137ca..c6fd679e 100644 --- a/ssh2/agent.pyx +++ b/ssh2/agent.pyx @@ -16,7 +16,7 @@ cimport c_ssh2 from pkey cimport PublicKey, PyPublicKey -from exceptions cimport AgentConnectError, AgentListIdentitiesError, \ +from exceptions cimport AgentConnectionError, AgentListIdentitiesError, \ AgentGetIdentityError, AgentAuthenticationError from utils cimport to_bytes @@ -131,7 +131,7 @@ cdef class Agent: def connect(self): """Connect to agent. - :raises: :py:class:`ssh2.exceptions.AgentConnectError` on errors + :raises: :py:class:`ssh2.exceptions.AgentConnectionError` on errors connecting to agent. :rtype: int""" @@ -140,5 +140,5 @@ cdef class Agent: rc = c_ssh2.libssh2_agent_connect(self._agent) if rc != 0: with gil: - raise AgentConnectError("Unable to connect to agent") + raise AgentConnectionError("Unable to connect to agent") return rc diff --git a/ssh2/c_ssh2.pxd b/ssh2/c_ssh2.pxd index 679054c3..f7541359 100644 --- a/ssh2/c_ssh2.pxd +++ b/ssh2/c_ssh2.pxd @@ -14,8 +14,11 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +from libc.stdint cimport uint64_t from libc.time cimport time_t -from posix.types cimport off_t +from posix.types cimport (blkcnt_t, blksize_t, dev_t, gid_t, ino_t, mode_t, + nlink_t, off_t, time_t, uid_t) + cdef extern from "libssh2.h" nogil: ctypedef int libssh2_socket_t @@ -29,10 +32,35 @@ cdef extern from "libssh2.h" nogil: _LIBSSH2_CHANNEL_FLUSH_EXTENDED_DATA "LIBSSH2_CHANNEL_FLUSH_EXTENDED_DATA" _LIBSSH2_CHANNEL_FLUSH_ALL "LIBSSH2_CHANNEL_FLUSH_ALL" ctypedef long long libssh2_int64_t - ctypedef struct stat - ctypedef off_t libssh2_struct_stat_size + ctypedef struct stat: + dev_t st_dev + ino_t st_ino + mode_t st_mode + nlink_t st_nlink + uid_t st_uid + gid_t st_gid + dev_t st_rdev + off_t st_size + blksize_t st_blksize + blkcnt_t st_blocks + time_t st_atime + time_t st_mtime + time_t st_ctime + ctypedef uint64_t libssh2_struct_stat_size ctypedef struct libssh2_struct_stat: - libssh2_struct_stat_size st_size + dev_t st_dev + ino_t st_ino + unsigned long st_mode + nlink_t st_nlink + uid_t st_uid + gid_t st_gid + dev_t st_rdev + uint64_t st_size + blksize_t st_blksize + blkcnt_t st_blocks + time_t st_atime + time_t st_mtime + time_t st_ctime ctypedef struct LIBSSH2_SESSION: pass ctypedef struct LIBSSH2_CHANNEL: diff --git a/ssh2/channel.c b/ssh2/channel.c index 811c8e21..d7018363 100644 --- a/ssh2/channel.c +++ b/ssh2/channel.c @@ -488,13 +488,13 @@ static CYTHON_INLINE float __PYX_NAN() { #define __PYX_HAVE__ssh2__channel #define __PYX_HAVE_API__ssh2__channel +#include #include #include #include #include "libssh2.h" #include #include -#include #include "libssh2_sftp.h" #ifdef _OPENMP #include @@ -708,7 +708,7 @@ struct __pyx_obj_4ssh2_7session_Session; struct __pyx_obj_4ssh2_4sftp_SFTP; struct __pyx_obj_4ssh2_10exceptions_AgentError; struct __pyx_obj_4ssh2_10exceptions_AuthenticationError; -struct __pyx_obj_4ssh2_10exceptions_AgentConnectError; +struct __pyx_obj_4ssh2_10exceptions_AgentConnectionError; struct __pyx_obj_4ssh2_10exceptions_AgentAuthenticationError; struct __pyx_obj_4ssh2_10exceptions_AgentListIdentitiesError; struct __pyx_obj_4ssh2_10exceptions_AgentGetIdentityError; @@ -774,11 +774,11 @@ struct __pyx_obj_4ssh2_10exceptions_AuthenticationError { /* "exceptions.pxd":25 * * - * cdef class AgentConnectError(AgentError): # <<<<<<<<<<<<<< + * cdef class AgentConnectionError(AgentError): # <<<<<<<<<<<<<< * pass * */ -struct __pyx_obj_4ssh2_10exceptions_AgentConnectError { +struct __pyx_obj_4ssh2_10exceptions_AgentConnectionError { struct __pyx_obj_4ssh2_10exceptions_AgentError __pyx_base; }; @@ -1159,6 +1159,8 @@ static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (** static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); +/* Module declarations from 'libc.stdint' */ + /* Module declarations from 'libc.stddef' */ /* Module declarations from 'libc.time' */ @@ -1174,8 +1176,6 @@ static PyTypeObject *__pyx_ptype_4ssh2_7session_Session = 0; /* Module declarations from 'libc.stdlib' */ -/* Module declarations from 'libc.stdint' */ - /* Module declarations from 'ssh2.c_sftp' */ /* Module declarations from 'ssh2.sftp' */ @@ -1186,7 +1186,7 @@ static PyTypeObject *__pyx_ptype_4ssh2_4sftp_SFTP = 0; /* Module declarations from 'ssh2.exceptions' */ static PyTypeObject *__pyx_ptype_4ssh2_10exceptions_AgentError = 0; static PyTypeObject *__pyx_ptype_4ssh2_10exceptions_AuthenticationError = 0; -static PyTypeObject *__pyx_ptype_4ssh2_10exceptions_AgentConnectError = 0; +static PyTypeObject *__pyx_ptype_4ssh2_10exceptions_AgentConnectionError = 0; static PyTypeObject *__pyx_ptype_4ssh2_10exceptions_AgentAuthenticationError = 0; static PyTypeObject *__pyx_ptype_4ssh2_10exceptions_AgentListIdentitiesError = 0; static PyTypeObject *__pyx_ptype_4ssh2_10exceptions_AgentGetIdentityError = 0; @@ -1206,7 +1206,6 @@ int __pyx_module_is_main_ssh2__channel = 0; /* Implementation of 'ssh2.channel' */ static PyObject *__pyx_builtin_MemoryError; -static PyObject *__pyx_builtin_NotImplementedError; static PyObject *__pyx_builtin_TypeError; static const char __pyx_k_[] = ""; static const char __pyx_k_buf[] = "buf"; @@ -1214,20 +1213,27 @@ static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_size[] = "size"; static const char __pyx_k_term[] = "term"; static const char __pyx_k_test[] = "__test__"; +static const char __pyx_k_force[] = "force"; static const char __pyx_k_value[] = "value"; static const char __pyx_k_vt100[] = "vt100"; +static const char __pyx_k_message[] = "message"; static const char __pyx_k_read_ex[] = "read_ex"; +static const char __pyx_k_request[] = "request"; static const char __pyx_k_session[] = "session"; static const char __pyx_k_varname[] = "varname"; static const char __pyx_k_TypeError[] = "TypeError"; static const char __pyx_k_stream_id[] = "stream_id"; +static const char __pyx_k_adjustment[] = "adjustment"; +static const char __pyx_k_auth_proto[] = "auth_proto"; static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; static const char __pyx_k_read_avail[] = "read_avail"; static const char __pyx_k_MemoryError[] = "MemoryError"; +static const char __pyx_k_auth_cookie[] = "auth_cookie"; static const char __pyx_k_reduce_cython[] = "__reduce_cython__"; +static const char __pyx_k_screen_number[] = "screen_number"; static const char __pyx_k_setstate_cython[] = "__setstate_cython__"; +static const char __pyx_k_single_connection[] = "single_connection"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; -static const char __pyx_k_NotImplementedError[] = "NotImplementedError"; static const char __pyx_k_window_size_initial[] = "window_size_initial"; static const char __pyx_k_Error_executing_command_s_error[] = "Error executing command %s - error code %s"; static const char __pyx_k_Error_requesting_PTY_with_error[] = "Error requesting PTY with error code %s"; @@ -1238,18 +1244,25 @@ static PyObject *__pyx_kp_s_Error_executing_command_s_error; static PyObject *__pyx_kp_s_Error_requesting_PTY_with_error; static PyObject *__pyx_kp_s_Error_requesting_subsystem_s_err; static PyObject *__pyx_n_s_MemoryError; -static PyObject *__pyx_n_s_NotImplementedError; static PyObject *__pyx_n_s_TypeError; +static PyObject *__pyx_n_s_adjustment; +static PyObject *__pyx_n_s_auth_cookie; +static PyObject *__pyx_n_s_auth_proto; static PyObject *__pyx_n_s_buf; static PyObject *__pyx_n_s_cline_in_traceback; +static PyObject *__pyx_n_s_force; static PyObject *__pyx_n_s_main; +static PyObject *__pyx_n_s_message; static PyObject *__pyx_kp_s_no_default___reduce___due_to_non; static PyObject *__pyx_n_s_pyx_vtable; static PyObject *__pyx_n_s_read_avail; static PyObject *__pyx_n_s_read_ex; static PyObject *__pyx_n_s_reduce_cython; +static PyObject *__pyx_n_s_request; +static PyObject *__pyx_n_s_screen_number; static PyObject *__pyx_n_s_session; static PyObject *__pyx_n_s_setstate_cython; +static PyObject *__pyx_n_s_single_connection; static PyObject *__pyx_n_s_size; static PyObject *__pyx_n_s_stream_id; static PyObject *__pyx_n_s_term; @@ -1281,13 +1294,20 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_38window_read_ex(struct __pyx_ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_40window_read(struct __pyx_obj_4ssh2_7channel_Channel *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_42window_write_ex(struct __pyx_obj_4ssh2_7channel_Channel *__pyx_v_self, unsigned long __pyx_v_window_size_initial); /* proto */ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_44window_write(struct __pyx_obj_4ssh2_7channel_Channel *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_4ssh2_7channel_7Channel_46write(struct __pyx_obj_4ssh2_7channel_Channel *__pyx_v_self, PyObject *__pyx_v_buf); /* proto */ -static PyObject *__pyx_pf_4ssh2_7channel_7Channel_48write_ex(struct __pyx_obj_4ssh2_7channel_Channel *__pyx_v_self, int __pyx_v_stream_id, PyObject *__pyx_v_buf); /* proto */ -static PyObject *__pyx_pf_4ssh2_7channel_7Channel_50write_stderr(struct __pyx_obj_4ssh2_7channel_Channel *__pyx_v_self, PyObject *__pyx_v_buf); /* proto */ -static PyObject *__pyx_pf_4ssh2_7channel_7Channel_52x11_req(CYTHON_UNUSED struct __pyx_obj_4ssh2_7channel_Channel *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_4ssh2_7channel_7Channel_54x11_req_ex(CYTHON_UNUSED struct __pyx_obj_4ssh2_7channel_Channel *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_4ssh2_7channel_7Channel_56__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_4ssh2_7channel_Channel *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_4ssh2_7channel_7Channel_58__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_4ssh2_7channel_Channel *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ +static PyObject *__pyx_pf_4ssh2_7channel_7Channel_46receive_window_adjust(struct __pyx_obj_4ssh2_7channel_Channel *__pyx_v_self, unsigned long __pyx_v_adjustment, unsigned long __pyx_v_force); /* proto */ +static PyObject *__pyx_pf_4ssh2_7channel_7Channel_48receive_window_adjust2(struct __pyx_obj_4ssh2_7channel_Channel *__pyx_v_self, unsigned long __pyx_v_adjustment, unsigned long __pyx_v_force); /* proto */ +static PyObject *__pyx_pf_4ssh2_7channel_7Channel_50write(struct __pyx_obj_4ssh2_7channel_Channel *__pyx_v_self, PyObject *__pyx_v_buf); /* proto */ +static PyObject *__pyx_pf_4ssh2_7channel_7Channel_52write_ex(struct __pyx_obj_4ssh2_7channel_Channel *__pyx_v_self, int __pyx_v_stream_id, PyObject *__pyx_v_buf); /* proto */ +static PyObject *__pyx_pf_4ssh2_7channel_7Channel_54write_stderr(struct __pyx_obj_4ssh2_7channel_Channel *__pyx_v_self, PyObject *__pyx_v_buf); /* proto */ +static PyObject *__pyx_pf_4ssh2_7channel_7Channel_56x11_req(struct __pyx_obj_4ssh2_7channel_Channel *__pyx_v_self, int __pyx_v_screen_number); /* proto */ +static PyObject *__pyx_pf_4ssh2_7channel_7Channel_58x11_req_ex(struct __pyx_obj_4ssh2_7channel_Channel *__pyx_v_self, int __pyx_v_single_connection, char const *__pyx_v_auth_proto, char const *__pyx_v_auth_cookie, int __pyx_v_screen_number); /* proto */ +static PyObject *__pyx_pf_4ssh2_7channel_7Channel_60process_startup(struct __pyx_obj_4ssh2_7channel_Channel *__pyx_v_self, PyObject *__pyx_v_request, PyObject *__pyx_v_message); /* proto */ +static PyObject *__pyx_pf_4ssh2_7channel_7Channel_62poll_channel_read(struct __pyx_obj_4ssh2_7channel_Channel *__pyx_v_self, int __pyx_v_extended); /* proto */ +static PyObject *__pyx_pf_4ssh2_7channel_7Channel_64handle_extended_data(struct __pyx_obj_4ssh2_7channel_Channel *__pyx_v_self, int __pyx_v_ignore_mode); /* proto */ +static PyObject *__pyx_pf_4ssh2_7channel_7Channel_66handle_extended_data2(struct __pyx_obj_4ssh2_7channel_Channel *__pyx_v_self, int __pyx_v_ignore_mode); /* proto */ +static PyObject *__pyx_pf_4ssh2_7channel_7Channel_68ignore_extended_data(struct __pyx_obj_4ssh2_7channel_Channel *__pyx_v_self, int __pyx_v_ignore_mode); /* proto */ +static PyObject *__pyx_pf_4ssh2_7channel_7Channel_70__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_4ssh2_7channel_Channel *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4ssh2_7channel_7Channel_72__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_4ssh2_7channel_Channel *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_tp_new_4ssh2_7channel_Channel(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_int_0; static PyObject *__pyx_tuple__2; @@ -4924,7 +4944,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_44window_write(struct __pyx_ob * rc = c_ssh2.libssh2_channel_window_write(self._channel) * return rc # <<<<<<<<<<<<<< * - * def write(self, buf not None): + * def receive_window_adjust(self, unsigned long adjustment, */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_unsigned_long(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 308, __pyx_L1_error) @@ -4953,6 +4973,324 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_44window_write(struct __pyx_ob } /* "ssh2/channel.pyx":310 + * return rc + * + * def receive_window_adjust(self, unsigned long adjustment, # <<<<<<<<<<<<<< + * unsigned long force): + * cdef unsigned long rc + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4ssh2_7channel_7Channel_47receive_window_adjust(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_4ssh2_7channel_7Channel_46receive_window_adjust[] = "Channel.receive_window_adjust(self, unsigned long adjustment, unsigned long force)"; +static PyObject *__pyx_pw_4ssh2_7channel_7Channel_47receive_window_adjust(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + unsigned long __pyx_v_adjustment; + unsigned long __pyx_v_force; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("receive_window_adjust (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_adjustment,&__pyx_n_s_force,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_adjustment)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_force)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("receive_window_adjust", 1, 2, 2, 1); __PYX_ERR(0, 310, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "receive_window_adjust") < 0)) __PYX_ERR(0, 310, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_adjustment = __Pyx_PyInt_As_unsigned_long(values[0]); if (unlikely((__pyx_v_adjustment == (unsigned long)-1) && PyErr_Occurred())) __PYX_ERR(0, 310, __pyx_L3_error) + __pyx_v_force = __Pyx_PyInt_As_unsigned_long(values[1]); if (unlikely((__pyx_v_force == (unsigned long)-1) && PyErr_Occurred())) __PYX_ERR(0, 311, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("receive_window_adjust", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 310, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("ssh2.channel.Channel.receive_window_adjust", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_4ssh2_7channel_7Channel_46receive_window_adjust(((struct __pyx_obj_4ssh2_7channel_Channel *)__pyx_v_self), __pyx_v_adjustment, __pyx_v_force); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4ssh2_7channel_7Channel_46receive_window_adjust(struct __pyx_obj_4ssh2_7channel_Channel *__pyx_v_self, unsigned long __pyx_v_adjustment, unsigned long __pyx_v_force) { + unsigned long __pyx_v_rc; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("receive_window_adjust", 0); + + /* "ssh2/channel.pyx":313 + * unsigned long force): + * cdef unsigned long rc + * with nogil: # <<<<<<<<<<<<<< + * rc = c_ssh2.libssh2_channel_receive_window_adjust( + * self._channel, adjustment, force) + */ + { + #ifdef WITH_THREAD + PyThreadState *_save; + Py_UNBLOCK_THREADS + __Pyx_FastGIL_Remember(); + #endif + /*try:*/ { + + /* "ssh2/channel.pyx":314 + * cdef unsigned long rc + * with nogil: + * rc = c_ssh2.libssh2_channel_receive_window_adjust( # <<<<<<<<<<<<<< + * self._channel, adjustment, force) + * return rc + */ + __pyx_v_rc = libssh2_channel_receive_window_adjust(__pyx_v_self->_channel, __pyx_v_adjustment, __pyx_v_force); + } + + /* "ssh2/channel.pyx":313 + * unsigned long force): + * cdef unsigned long rc + * with nogil: # <<<<<<<<<<<<<< + * rc = c_ssh2.libssh2_channel_receive_window_adjust( + * self._channel, adjustment, force) + */ + /*finally:*/ { + /*normal exit:*/{ + #ifdef WITH_THREAD + __Pyx_FastGIL_Forget(); + Py_BLOCK_THREADS + #endif + goto __pyx_L5; + } + __pyx_L5:; + } + } + + /* "ssh2/channel.pyx":316 + * rc = c_ssh2.libssh2_channel_receive_window_adjust( + * self._channel, adjustment, force) + * return rc # <<<<<<<<<<<<<< + * + * def receive_window_adjust2(self, unsigned long adjustment, + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_unsigned_long(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 316, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "ssh2/channel.pyx":310 + * return rc + * + * def receive_window_adjust(self, unsigned long adjustment, # <<<<<<<<<<<<<< + * unsigned long force): + * cdef unsigned long rc + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("ssh2.channel.Channel.receive_window_adjust", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "ssh2/channel.pyx":318 + * return rc + * + * def receive_window_adjust2(self, unsigned long adjustment, # <<<<<<<<<<<<<< + * unsigned long force): + * cdef unsigned long rc + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4ssh2_7channel_7Channel_49receive_window_adjust2(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_4ssh2_7channel_7Channel_48receive_window_adjust2[] = "Channel.receive_window_adjust2(self, unsigned long adjustment, unsigned long force)"; +static PyObject *__pyx_pw_4ssh2_7channel_7Channel_49receive_window_adjust2(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + unsigned long __pyx_v_adjustment; + unsigned long __pyx_v_force; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("receive_window_adjust2 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_adjustment,&__pyx_n_s_force,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_adjustment)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_force)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("receive_window_adjust2", 1, 2, 2, 1); __PYX_ERR(0, 318, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "receive_window_adjust2") < 0)) __PYX_ERR(0, 318, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_adjustment = __Pyx_PyInt_As_unsigned_long(values[0]); if (unlikely((__pyx_v_adjustment == (unsigned long)-1) && PyErr_Occurred())) __PYX_ERR(0, 318, __pyx_L3_error) + __pyx_v_force = __Pyx_PyInt_As_unsigned_long(values[1]); if (unlikely((__pyx_v_force == (unsigned long)-1) && PyErr_Occurred())) __PYX_ERR(0, 319, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("receive_window_adjust2", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 318, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("ssh2.channel.Channel.receive_window_adjust2", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_4ssh2_7channel_7Channel_48receive_window_adjust2(((struct __pyx_obj_4ssh2_7channel_Channel *)__pyx_v_self), __pyx_v_adjustment, __pyx_v_force); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4ssh2_7channel_7Channel_48receive_window_adjust2(struct __pyx_obj_4ssh2_7channel_Channel *__pyx_v_self, unsigned long __pyx_v_adjustment, unsigned long __pyx_v_force) { + unsigned long __pyx_v_rc; + unsigned int __pyx_v_storewindow; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("receive_window_adjust2", 0); + + /* "ssh2/channel.pyx":321 + * unsigned long force): + * cdef unsigned long rc + * cdef unsigned int storewindow = 0 # <<<<<<<<<<<<<< + * with nogil: + * rc = c_ssh2.libssh2_channel_receive_window_adjust2( + */ + __pyx_v_storewindow = 0; + + /* "ssh2/channel.pyx":322 + * cdef unsigned long rc + * cdef unsigned int storewindow = 0 + * with nogil: # <<<<<<<<<<<<<< + * rc = c_ssh2.libssh2_channel_receive_window_adjust2( + * self._channel, adjustment, force, &storewindow) + */ + { + #ifdef WITH_THREAD + PyThreadState *_save; + Py_UNBLOCK_THREADS + __Pyx_FastGIL_Remember(); + #endif + /*try:*/ { + + /* "ssh2/channel.pyx":323 + * cdef unsigned int storewindow = 0 + * with nogil: + * rc = c_ssh2.libssh2_channel_receive_window_adjust2( # <<<<<<<<<<<<<< + * self._channel, adjustment, force, &storewindow) + * return rc + */ + __pyx_v_rc = libssh2_channel_receive_window_adjust2(__pyx_v_self->_channel, __pyx_v_adjustment, __pyx_v_force, (&__pyx_v_storewindow)); + } + + /* "ssh2/channel.pyx":322 + * cdef unsigned long rc + * cdef unsigned int storewindow = 0 + * with nogil: # <<<<<<<<<<<<<< + * rc = c_ssh2.libssh2_channel_receive_window_adjust2( + * self._channel, adjustment, force, &storewindow) + */ + /*finally:*/ { + /*normal exit:*/{ + #ifdef WITH_THREAD + __Pyx_FastGIL_Forget(); + Py_BLOCK_THREADS + #endif + goto __pyx_L5; + } + __pyx_L5:; + } + } + + /* "ssh2/channel.pyx":325 + * rc = c_ssh2.libssh2_channel_receive_window_adjust2( + * self._channel, adjustment, force, &storewindow) + * return rc # <<<<<<<<<<<<<< + * + * def write(self, buf not None): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_unsigned_long(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 325, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "ssh2/channel.pyx":318 + * return rc + * + * def receive_window_adjust2(self, unsigned long adjustment, # <<<<<<<<<<<<<< + * unsigned long force): + * cdef unsigned long rc + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("ssh2.channel.Channel.receive_window_adjust2", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "ssh2/channel.pyx":327 * return rc * * def write(self, buf not None): # <<<<<<<<<<<<<< @@ -4961,16 +5299,16 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_44window_write(struct __pyx_ob */ /* Python wrapper */ -static PyObject *__pyx_pw_4ssh2_7channel_7Channel_47write(PyObject *__pyx_v_self, PyObject *__pyx_v_buf); /*proto*/ -static char __pyx_doc_4ssh2_7channel_7Channel_46write[] = "Channel.write(self, buf)\nWrite buffer to stdin\n\n :param buf: Buffer to write\n :type buf: str\n\n :rtype: int"; -static PyObject *__pyx_pw_4ssh2_7channel_7Channel_47write(PyObject *__pyx_v_self, PyObject *__pyx_v_buf) { +static PyObject *__pyx_pw_4ssh2_7channel_7Channel_51write(PyObject *__pyx_v_self, PyObject *__pyx_v_buf); /*proto*/ +static char __pyx_doc_4ssh2_7channel_7Channel_50write[] = "Channel.write(self, buf)\nWrite buffer to stdin\n\n :param buf: Buffer to write\n :type buf: str\n\n :rtype: int"; +static PyObject *__pyx_pw_4ssh2_7channel_7Channel_51write(PyObject *__pyx_v_self, PyObject *__pyx_v_buf) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("write (wrapper)", 0); if (unlikely(((PyObject *)__pyx_v_buf) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "buf"); __PYX_ERR(0, 310, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "buf"); __PYX_ERR(0, 327, __pyx_L1_error) } - __pyx_r = __pyx_pf_4ssh2_7channel_7Channel_46write(((struct __pyx_obj_4ssh2_7channel_Channel *)__pyx_v_self), ((PyObject *)__pyx_v_buf)); + __pyx_r = __pyx_pf_4ssh2_7channel_7Channel_50write(((struct __pyx_obj_4ssh2_7channel_Channel *)__pyx_v_self), ((PyObject *)__pyx_v_buf)); /* function exit code */ goto __pyx_L0; @@ -4981,7 +5319,7 @@ static PyObject *__pyx_pw_4ssh2_7channel_7Channel_47write(PyObject *__pyx_v_self return __pyx_r; } -static PyObject *__pyx_pf_4ssh2_7channel_7Channel_46write(struct __pyx_obj_4ssh2_7channel_Channel *__pyx_v_self, PyObject *__pyx_v_buf) { +static PyObject *__pyx_pf_4ssh2_7channel_7Channel_50write(struct __pyx_obj_4ssh2_7channel_Channel *__pyx_v_self, PyObject *__pyx_v_buf) { char const *__pyx_v__buf; size_t __pyx_v_buflen; Py_ssize_t __pyx_v_rc; @@ -4991,7 +5329,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_46write(struct __pyx_obj_4ssh2 PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("write", 0); - /* "ssh2/channel.pyx":317 + /* "ssh2/channel.pyx":334 * * :rtype: int""" * cdef const char *_buf = to_bytes(buf) # <<<<<<<<<<<<<< @@ -5000,7 +5338,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_46write(struct __pyx_obj_4ssh2 */ __pyx_v__buf = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_buf); - /* "ssh2/channel.pyx":318 + /* "ssh2/channel.pyx":335 * :rtype: int""" * cdef const char *_buf = to_bytes(buf) * cdef size_t buflen = len(_buf) # <<<<<<<<<<<<<< @@ -5010,7 +5348,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_46write(struct __pyx_obj_4ssh2 __pyx_t_1 = strlen(__pyx_v__buf); __pyx_v_buflen = __pyx_t_1; - /* "ssh2/channel.pyx":320 + /* "ssh2/channel.pyx":337 * cdef size_t buflen = len(_buf) * cdef ssize_t rc * with nogil: # <<<<<<<<<<<<<< @@ -5025,7 +5363,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_46write(struct __pyx_obj_4ssh2 #endif /*try:*/ { - /* "ssh2/channel.pyx":321 + /* "ssh2/channel.pyx":338 * cdef ssize_t rc * with nogil: * rc = c_ssh2.libssh2_channel_write(self._channel, _buf, buflen) # <<<<<<<<<<<<<< @@ -5035,7 +5373,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_46write(struct __pyx_obj_4ssh2 __pyx_v_rc = libssh2_channel_write(__pyx_v_self->_channel, __pyx_v__buf, __pyx_v_buflen); } - /* "ssh2/channel.pyx":320 + /* "ssh2/channel.pyx":337 * cdef size_t buflen = len(_buf) * cdef ssize_t rc * with nogil: # <<<<<<<<<<<<<< @@ -5054,7 +5392,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_46write(struct __pyx_obj_4ssh2 } } - /* "ssh2/channel.pyx":322 + /* "ssh2/channel.pyx":339 * with nogil: * rc = c_ssh2.libssh2_channel_write(self._channel, _buf, buflen) * return rc # <<<<<<<<<<<<<< @@ -5062,13 +5400,13 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_46write(struct __pyx_obj_4ssh2 * def write_ex(self, int stream_id, buf not None): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_rc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 322, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_rc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 339, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "ssh2/channel.pyx":310 + /* "ssh2/channel.pyx":327 * return rc * * def write(self, buf not None): # <<<<<<<<<<<<<< @@ -5087,7 +5425,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_46write(struct __pyx_obj_4ssh2 return __pyx_r; } -/* "ssh2/channel.pyx":324 +/* "ssh2/channel.pyx":341 * return rc * * def write_ex(self, int stream_id, buf not None): # <<<<<<<<<<<<<< @@ -5096,9 +5434,9 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_46write(struct __pyx_obj_4ssh2 */ /* Python wrapper */ -static PyObject *__pyx_pw_4ssh2_7channel_7Channel_49write_ex(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_4ssh2_7channel_7Channel_48write_ex[] = "Channel.write_ex(self, int stream_id, buf)\nWrite buffer to specified stream id.\n\n :param stream_id: Id of stream to write to\n :type stream_id: int\n :param buf: Buffer to write\n :type buf: str\n\n :rtype: int"; -static PyObject *__pyx_pw_4ssh2_7channel_7Channel_49write_ex(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_pw_4ssh2_7channel_7Channel_53write_ex(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_4ssh2_7channel_7Channel_52write_ex[] = "Channel.write_ex(self, int stream_id, buf)\nWrite buffer to specified stream id.\n\n :param stream_id: Id of stream to write to\n :type stream_id: int\n :param buf: Buffer to write\n :type buf: str\n\n :rtype: int"; +static PyObject *__pyx_pw_4ssh2_7channel_7Channel_53write_ex(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_v_stream_id; PyObject *__pyx_v_buf = 0; PyObject *__pyx_r = 0; @@ -5127,11 +5465,11 @@ static PyObject *__pyx_pw_4ssh2_7channel_7Channel_49write_ex(PyObject *__pyx_v_s case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_buf)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("write_ex", 1, 2, 2, 1); __PYX_ERR(0, 324, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("write_ex", 1, 2, 2, 1); __PYX_ERR(0, 341, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "write_ex") < 0)) __PYX_ERR(0, 324, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "write_ex") < 0)) __PYX_ERR(0, 341, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -5139,21 +5477,21 @@ static PyObject *__pyx_pw_4ssh2_7channel_7Channel_49write_ex(PyObject *__pyx_v_s values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } - __pyx_v_stream_id = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_stream_id == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 324, __pyx_L3_error) + __pyx_v_stream_id = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_stream_id == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 341, __pyx_L3_error) __pyx_v_buf = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("write_ex", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 324, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("write_ex", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 341, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.channel.Channel.write_ex", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(((PyObject *)__pyx_v_buf) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "buf"); __PYX_ERR(0, 324, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "buf"); __PYX_ERR(0, 341, __pyx_L1_error) } - __pyx_r = __pyx_pf_4ssh2_7channel_7Channel_48write_ex(((struct __pyx_obj_4ssh2_7channel_Channel *)__pyx_v_self), __pyx_v_stream_id, __pyx_v_buf); + __pyx_r = __pyx_pf_4ssh2_7channel_7Channel_52write_ex(((struct __pyx_obj_4ssh2_7channel_Channel *)__pyx_v_self), __pyx_v_stream_id, __pyx_v_buf); /* function exit code */ goto __pyx_L0; @@ -5164,7 +5502,7 @@ static PyObject *__pyx_pw_4ssh2_7channel_7Channel_49write_ex(PyObject *__pyx_v_s return __pyx_r; } -static PyObject *__pyx_pf_4ssh2_7channel_7Channel_48write_ex(struct __pyx_obj_4ssh2_7channel_Channel *__pyx_v_self, int __pyx_v_stream_id, PyObject *__pyx_v_buf) { +static PyObject *__pyx_pf_4ssh2_7channel_7Channel_52write_ex(struct __pyx_obj_4ssh2_7channel_Channel *__pyx_v_self, int __pyx_v_stream_id, PyObject *__pyx_v_buf) { char const *__pyx_v__buf; size_t __pyx_v_buflen; Py_ssize_t __pyx_v_rc; @@ -5174,7 +5512,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_48write_ex(struct __pyx_obj_4s PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("write_ex", 0); - /* "ssh2/channel.pyx":333 + /* "ssh2/channel.pyx":350 * * :rtype: int""" * cdef const char *_buf = to_bytes(buf) # <<<<<<<<<<<<<< @@ -5183,7 +5521,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_48write_ex(struct __pyx_obj_4s */ __pyx_v__buf = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_buf); - /* "ssh2/channel.pyx":334 + /* "ssh2/channel.pyx":351 * :rtype: int""" * cdef const char *_buf = to_bytes(buf) * cdef size_t buflen = len(_buf) # <<<<<<<<<<<<<< @@ -5193,7 +5531,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_48write_ex(struct __pyx_obj_4s __pyx_t_1 = strlen(__pyx_v__buf); __pyx_v_buflen = __pyx_t_1; - /* "ssh2/channel.pyx":336 + /* "ssh2/channel.pyx":353 * cdef size_t buflen = len(_buf) * cdef ssize_t rc * with nogil: # <<<<<<<<<<<<<< @@ -5208,7 +5546,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_48write_ex(struct __pyx_obj_4s #endif /*try:*/ { - /* "ssh2/channel.pyx":337 + /* "ssh2/channel.pyx":354 * cdef ssize_t rc * with nogil: * rc = c_ssh2.libssh2_channel_write_ex( # <<<<<<<<<<<<<< @@ -5218,7 +5556,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_48write_ex(struct __pyx_obj_4s __pyx_v_rc = libssh2_channel_write_ex(__pyx_v_self->_channel, __pyx_v_stream_id, __pyx_v__buf, __pyx_v_buflen); } - /* "ssh2/channel.pyx":336 + /* "ssh2/channel.pyx":353 * cdef size_t buflen = len(_buf) * cdef ssize_t rc * with nogil: # <<<<<<<<<<<<<< @@ -5237,7 +5575,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_48write_ex(struct __pyx_obj_4s } } - /* "ssh2/channel.pyx":339 + /* "ssh2/channel.pyx":356 * rc = c_ssh2.libssh2_channel_write_ex( * self._channel, stream_id, _buf, buflen) * return rc # <<<<<<<<<<<<<< @@ -5245,13 +5583,13 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_48write_ex(struct __pyx_obj_4s * def write_stderr(self, buf not None): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_rc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 339, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_rc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "ssh2/channel.pyx":324 + /* "ssh2/channel.pyx":341 * return rc * * def write_ex(self, int stream_id, buf not None): # <<<<<<<<<<<<<< @@ -5270,7 +5608,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_48write_ex(struct __pyx_obj_4s return __pyx_r; } -/* "ssh2/channel.pyx":341 +/* "ssh2/channel.pyx":358 * return rc * * def write_stderr(self, buf not None): # <<<<<<<<<<<<<< @@ -5279,16 +5617,16 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_48write_ex(struct __pyx_obj_4s */ /* Python wrapper */ -static PyObject *__pyx_pw_4ssh2_7channel_7Channel_51write_stderr(PyObject *__pyx_v_self, PyObject *__pyx_v_buf); /*proto*/ -static char __pyx_doc_4ssh2_7channel_7Channel_50write_stderr[] = "Channel.write_stderr(self, buf)\nWrite buffer to stderr.\n\n :param buf: Buffer to write\n :type buf: str\n\n :rtype: int"; -static PyObject *__pyx_pw_4ssh2_7channel_7Channel_51write_stderr(PyObject *__pyx_v_self, PyObject *__pyx_v_buf) { +static PyObject *__pyx_pw_4ssh2_7channel_7Channel_55write_stderr(PyObject *__pyx_v_self, PyObject *__pyx_v_buf); /*proto*/ +static char __pyx_doc_4ssh2_7channel_7Channel_54write_stderr[] = "Channel.write_stderr(self, buf)\nWrite buffer to stderr.\n\n :param buf: Buffer to write\n :type buf: str\n\n :rtype: int"; +static PyObject *__pyx_pw_4ssh2_7channel_7Channel_55write_stderr(PyObject *__pyx_v_self, PyObject *__pyx_v_buf) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("write_stderr (wrapper)", 0); if (unlikely(((PyObject *)__pyx_v_buf) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "buf"); __PYX_ERR(0, 341, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "buf"); __PYX_ERR(0, 358, __pyx_L1_error) } - __pyx_r = __pyx_pf_4ssh2_7channel_7Channel_50write_stderr(((struct __pyx_obj_4ssh2_7channel_Channel *)__pyx_v_self), ((PyObject *)__pyx_v_buf)); + __pyx_r = __pyx_pf_4ssh2_7channel_7Channel_54write_stderr(((struct __pyx_obj_4ssh2_7channel_Channel *)__pyx_v_self), ((PyObject *)__pyx_v_buf)); /* function exit code */ goto __pyx_L0; @@ -5299,7 +5637,7 @@ static PyObject *__pyx_pw_4ssh2_7channel_7Channel_51write_stderr(PyObject *__pyx return __pyx_r; } -static PyObject *__pyx_pf_4ssh2_7channel_7Channel_50write_stderr(struct __pyx_obj_4ssh2_7channel_Channel *__pyx_v_self, PyObject *__pyx_v_buf) { +static PyObject *__pyx_pf_4ssh2_7channel_7Channel_54write_stderr(struct __pyx_obj_4ssh2_7channel_Channel *__pyx_v_self, PyObject *__pyx_v_buf) { char const *__pyx_v__buf; size_t __pyx_v_buflen; Py_ssize_t __pyx_v_rc; @@ -5309,7 +5647,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_50write_stderr(struct __pyx_ob PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("write_stderr", 0); - /* "ssh2/channel.pyx":348 + /* "ssh2/channel.pyx":365 * * :rtype: int""" * cdef const char *_buf = to_bytes(buf) # <<<<<<<<<<<<<< @@ -5318,7 +5656,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_50write_stderr(struct __pyx_ob */ __pyx_v__buf = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_buf); - /* "ssh2/channel.pyx":349 + /* "ssh2/channel.pyx":366 * :rtype: int""" * cdef const char *_buf = to_bytes(buf) * cdef size_t buflen = len(_buf) # <<<<<<<<<<<<<< @@ -5328,7 +5666,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_50write_stderr(struct __pyx_ob __pyx_t_1 = strlen(__pyx_v__buf); __pyx_v_buflen = __pyx_t_1; - /* "ssh2/channel.pyx":351 + /* "ssh2/channel.pyx":368 * cdef size_t buflen = len(_buf) * cdef ssize_t rc * with nogil: # <<<<<<<<<<<<<< @@ -5343,7 +5681,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_50write_stderr(struct __pyx_ob #endif /*try:*/ { - /* "ssh2/channel.pyx":352 + /* "ssh2/channel.pyx":369 * cdef ssize_t rc * with nogil: * rc = c_ssh2.libssh2_channel_write_stderr( # <<<<<<<<<<<<<< @@ -5353,7 +5691,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_50write_stderr(struct __pyx_ob __pyx_v_rc = libssh2_channel_write_stderr(__pyx_v_self->_channel, __pyx_v__buf, __pyx_v_buflen); } - /* "ssh2/channel.pyx":351 + /* "ssh2/channel.pyx":368 * cdef size_t buflen = len(_buf) * cdef ssize_t rc * with nogil: # <<<<<<<<<<<<<< @@ -5372,21 +5710,21 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_50write_stderr(struct __pyx_ob } } - /* "ssh2/channel.pyx":354 + /* "ssh2/channel.pyx":371 * rc = c_ssh2.libssh2_channel_write_stderr( * self._channel, _buf, buflen) * return rc # <<<<<<<<<<<<<< * - * def x11_req(self): + * def x11_req(self, int screen_number): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_rc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 354, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_rc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 371, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "ssh2/channel.pyx":341 + /* "ssh2/channel.pyx":358 * return rc * * def write_stderr(self, buf not None): # <<<<<<<<<<<<<< @@ -5405,105 +5743,913 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_50write_stderr(struct __pyx_ob return __pyx_r; } -/* "ssh2/channel.pyx":356 +/* "ssh2/channel.pyx":373 * return rc * - * def x11_req(self): # <<<<<<<<<<<<<< - * raise NotImplementedError - * + * def x11_req(self, int screen_number): # <<<<<<<<<<<<<< + * cdef int rc + * with nogil: */ /* Python wrapper */ -static PyObject *__pyx_pw_4ssh2_7channel_7Channel_53x11_req(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static char __pyx_doc_4ssh2_7channel_7Channel_52x11_req[] = "Channel.x11_req(self)"; -static PyObject *__pyx_pw_4ssh2_7channel_7Channel_53x11_req(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { +static PyObject *__pyx_pw_4ssh2_7channel_7Channel_57x11_req(PyObject *__pyx_v_self, PyObject *__pyx_arg_screen_number); /*proto*/ +static char __pyx_doc_4ssh2_7channel_7Channel_56x11_req[] = "Channel.x11_req(self, int screen_number)"; +static PyObject *__pyx_pw_4ssh2_7channel_7Channel_57x11_req(PyObject *__pyx_v_self, PyObject *__pyx_arg_screen_number) { + int __pyx_v_screen_number; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("x11_req (wrapper)", 0); - __pyx_r = __pyx_pf_4ssh2_7channel_7Channel_52x11_req(((struct __pyx_obj_4ssh2_7channel_Channel *)__pyx_v_self)); + assert(__pyx_arg_screen_number); { + __pyx_v_screen_number = __Pyx_PyInt_As_int(__pyx_arg_screen_number); if (unlikely((__pyx_v_screen_number == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 373, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("ssh2.channel.Channel.x11_req", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_4ssh2_7channel_7Channel_56x11_req(((struct __pyx_obj_4ssh2_7channel_Channel *)__pyx_v_self), ((int)__pyx_v_screen_number)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_4ssh2_7channel_7Channel_52x11_req(CYTHON_UNUSED struct __pyx_obj_4ssh2_7channel_Channel *__pyx_v_self) { +static PyObject *__pyx_pf_4ssh2_7channel_7Channel_56x11_req(struct __pyx_obj_4ssh2_7channel_Channel *__pyx_v_self, int __pyx_v_screen_number) { + int __pyx_v_rc; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("x11_req", 0); - /* "ssh2/channel.pyx":357 - * - * def x11_req(self): - * raise NotImplementedError # <<<<<<<<<<<<<< - * - * def x11_req_ex(self): + /* "ssh2/channel.pyx":375 + * def x11_req(self, int screen_number): + * cdef int rc + * with nogil: # <<<<<<<<<<<<<< + * rc = c_ssh2.libssh2_channel_x11_req( + * self._channel, screen_number) */ - __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); - __PYX_ERR(0, 357, __pyx_L1_error) + { + #ifdef WITH_THREAD + PyThreadState *_save; + Py_UNBLOCK_THREADS + __Pyx_FastGIL_Remember(); + #endif + /*try:*/ { - /* "ssh2/channel.pyx":356 + /* "ssh2/channel.pyx":376 + * cdef int rc + * with nogil: + * rc = c_ssh2.libssh2_channel_x11_req( # <<<<<<<<<<<<<< + * self._channel, screen_number) * return rc + */ + __pyx_v_rc = libssh2_channel_x11_req(__pyx_v_self->_channel, __pyx_v_screen_number); + } + + /* "ssh2/channel.pyx":375 + * def x11_req(self, int screen_number): + * cdef int rc + * with nogil: # <<<<<<<<<<<<<< + * rc = c_ssh2.libssh2_channel_x11_req( + * self._channel, screen_number) + */ + /*finally:*/ { + /*normal exit:*/{ + #ifdef WITH_THREAD + __Pyx_FastGIL_Forget(); + Py_BLOCK_THREADS + #endif + goto __pyx_L5; + } + __pyx_L5:; + } + } + + /* "ssh2/channel.pyx":378 + * rc = c_ssh2.libssh2_channel_x11_req( + * self._channel, screen_number) + * return rc # <<<<<<<<<<<<<< * - * def x11_req(self): # <<<<<<<<<<<<<< - * raise NotImplementedError + * def x11_req_ex(self, int single_connection, + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 378, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "ssh2/channel.pyx":373 + * return rc * + * def x11_req(self, int screen_number): # <<<<<<<<<<<<<< + * cdef int rc + * with nogil: */ /* function exit code */ __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("ssh2.channel.Channel.x11_req", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; + __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "ssh2/channel.pyx":359 - * raise NotImplementedError +/* "ssh2/channel.pyx":380 + * return rc * - * def x11_req_ex(self): # <<<<<<<<<<<<<< - * raise NotImplementedError + * def x11_req_ex(self, int single_connection, # <<<<<<<<<<<<<< + * const char *auth_proto, + * const char *auth_cookie, */ /* Python wrapper */ -static PyObject *__pyx_pw_4ssh2_7channel_7Channel_55x11_req_ex(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static char __pyx_doc_4ssh2_7channel_7Channel_54x11_req_ex[] = "Channel.x11_req_ex(self)"; -static PyObject *__pyx_pw_4ssh2_7channel_7Channel_55x11_req_ex(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { +static PyObject *__pyx_pw_4ssh2_7channel_7Channel_59x11_req_ex(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_4ssh2_7channel_7Channel_58x11_req_ex[] = "Channel.x11_req_ex(self, int single_connection, const char *auth_proto, const char *auth_cookie, int screen_number)"; +static PyObject *__pyx_pw_4ssh2_7channel_7Channel_59x11_req_ex(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_v_single_connection; + char const *__pyx_v_auth_proto; + char const *__pyx_v_auth_cookie; + int __pyx_v_screen_number; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("x11_req_ex (wrapper)", 0); - __pyx_r = __pyx_pf_4ssh2_7channel_7Channel_54x11_req_ex(((struct __pyx_obj_4ssh2_7channel_Channel *)__pyx_v_self)); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_single_connection,&__pyx_n_s_auth_proto,&__pyx_n_s_auth_cookie,&__pyx_n_s_screen_number,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_single_connection)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_auth_proto)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("x11_req_ex", 1, 4, 4, 1); __PYX_ERR(0, 380, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_auth_cookie)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("x11_req_ex", 1, 4, 4, 2); __PYX_ERR(0, 380, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_screen_number)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("x11_req_ex", 1, 4, 4, 3); __PYX_ERR(0, 380, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "x11_req_ex") < 0)) __PYX_ERR(0, 380, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_single_connection = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_single_connection == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 380, __pyx_L3_error) + __pyx_v_auth_proto = __Pyx_PyObject_AsString(values[1]); if (unlikely((!__pyx_v_auth_proto) && PyErr_Occurred())) __PYX_ERR(0, 381, __pyx_L3_error) + __pyx_v_auth_cookie = __Pyx_PyObject_AsString(values[2]); if (unlikely((!__pyx_v_auth_cookie) && PyErr_Occurred())) __PYX_ERR(0, 382, __pyx_L3_error) + __pyx_v_screen_number = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_screen_number == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 383, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("x11_req_ex", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 380, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("ssh2.channel.Channel.x11_req_ex", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_4ssh2_7channel_7Channel_58x11_req_ex(((struct __pyx_obj_4ssh2_7channel_Channel *)__pyx_v_self), __pyx_v_single_connection, __pyx_v_auth_proto, __pyx_v_auth_cookie, __pyx_v_screen_number); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_4ssh2_7channel_7Channel_54x11_req_ex(CYTHON_UNUSED struct __pyx_obj_4ssh2_7channel_Channel *__pyx_v_self) { +static PyObject *__pyx_pf_4ssh2_7channel_7Channel_58x11_req_ex(struct __pyx_obj_4ssh2_7channel_Channel *__pyx_v_self, int __pyx_v_single_connection, char const *__pyx_v_auth_proto, char const *__pyx_v_auth_cookie, int __pyx_v_screen_number) { + int __pyx_v_rc; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("x11_req_ex", 0); - /* "ssh2/channel.pyx":360 + /* "ssh2/channel.pyx":385 + * int screen_number): + * cdef int rc + * with nogil: # <<<<<<<<<<<<<< + * rc = c_ssh2.libssh2_channel_x11_req_ex( + * self._channel, single_connection, + */ + { + #ifdef WITH_THREAD + PyThreadState *_save; + Py_UNBLOCK_THREADS + __Pyx_FastGIL_Remember(); + #endif + /*try:*/ { + + /* "ssh2/channel.pyx":386 + * cdef int rc + * with nogil: + * rc = c_ssh2.libssh2_channel_x11_req_ex( # <<<<<<<<<<<<<< + * self._channel, single_connection, + * auth_proto, auth_cookie, screen_number) + */ + __pyx_v_rc = libssh2_channel_x11_req_ex(__pyx_v_self->_channel, __pyx_v_single_connection, __pyx_v_auth_proto, __pyx_v_auth_cookie, __pyx_v_screen_number); + } + + /* "ssh2/channel.pyx":385 + * int screen_number): + * cdef int rc + * with nogil: # <<<<<<<<<<<<<< + * rc = c_ssh2.libssh2_channel_x11_req_ex( + * self._channel, single_connection, + */ + /*finally:*/ { + /*normal exit:*/{ + #ifdef WITH_THREAD + __Pyx_FastGIL_Forget(); + Py_BLOCK_THREADS + #endif + goto __pyx_L5; + } + __pyx_L5:; + } + } + + /* "ssh2/channel.pyx":389 + * self._channel, single_connection, + * auth_proto, auth_cookie, screen_number) + * return rc # <<<<<<<<<<<<<< * - * def x11_req_ex(self): - * raise NotImplementedError # <<<<<<<<<<<<<< + * def process_startup(self, request, message): */ - __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); - __PYX_ERR(0, 360, __pyx_L1_error) + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 389, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; - /* "ssh2/channel.pyx":359 - * raise NotImplementedError + /* "ssh2/channel.pyx":380 + * return rc * - * def x11_req_ex(self): # <<<<<<<<<<<<<< - * raise NotImplementedError + * def x11_req_ex(self, int single_connection, # <<<<<<<<<<<<<< + * const char *auth_proto, + * const char *auth_cookie, */ /* function exit code */ __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("ssh2.channel.Channel.x11_req_ex", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "ssh2/channel.pyx":391 + * return rc + * + * def process_startup(self, request, message): # <<<<<<<<<<<<<< + * """Startup process on server for request with message. + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4ssh2_7channel_7Channel_61process_startup(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_4ssh2_7channel_7Channel_60process_startup[] = "Channel.process_startup(self, request, message)\nStartup process on server for request with message.\n\n Request is a supported SSH subsystem and clients would typically use\n one of execute/shell/subsystem functions depending on request type."; +static PyObject *__pyx_pw_4ssh2_7channel_7Channel_61process_startup(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_request = 0; + PyObject *__pyx_v_message = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("process_startup (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_request,&__pyx_n_s_message,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_request)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_message)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("process_startup", 1, 2, 2, 1); __PYX_ERR(0, 391, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "process_startup") < 0)) __PYX_ERR(0, 391, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_request = values[0]; + __pyx_v_message = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("process_startup", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 391, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("ssh2.channel.Channel.process_startup", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_4ssh2_7channel_7Channel_60process_startup(((struct __pyx_obj_4ssh2_7channel_Channel *)__pyx_v_self), __pyx_v_request, __pyx_v_message); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4ssh2_7channel_7Channel_60process_startup(struct __pyx_obj_4ssh2_7channel_Channel *__pyx_v_self, PyObject *__pyx_v_request, PyObject *__pyx_v_message) { + char *__pyx_v__request; + char *__pyx_v__message; + size_t __pyx_v_r_len; + size_t __pyx_v_m_len; + int __pyx_v_rc; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + size_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("process_startup", 0); + + /* "ssh2/channel.pyx":396 + * Request is a supported SSH subsystem and clients would typically use + * one of execute/shell/subsystem functions depending on request type.""" + * cdef char *_request = to_bytes(request) # <<<<<<<<<<<<<< + * cdef char *_message = to_bytes(message) + * cdef size_t r_len = len(_request) + */ + __pyx_v__request = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_request); + + /* "ssh2/channel.pyx":397 + * one of execute/shell/subsystem functions depending on request type.""" + * cdef char *_request = to_bytes(request) + * cdef char *_message = to_bytes(message) # <<<<<<<<<<<<<< + * cdef size_t r_len = len(_request) + * cdef size_t m_len = len(_message) + */ + __pyx_v__message = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_message); + + /* "ssh2/channel.pyx":398 + * cdef char *_request = to_bytes(request) + * cdef char *_message = to_bytes(message) + * cdef size_t r_len = len(_request) # <<<<<<<<<<<<<< + * cdef size_t m_len = len(_message) + * cdef int rc + */ + __pyx_t_1 = strlen(__pyx_v__request); + __pyx_v_r_len = __pyx_t_1; + + /* "ssh2/channel.pyx":399 + * cdef char *_message = to_bytes(message) + * cdef size_t r_len = len(_request) + * cdef size_t m_len = len(_message) # <<<<<<<<<<<<<< + * cdef int rc + * with nogil: + */ + __pyx_t_1 = strlen(__pyx_v__message); + __pyx_v_m_len = __pyx_t_1; + + /* "ssh2/channel.pyx":401 + * cdef size_t m_len = len(_message) + * cdef int rc + * with nogil: # <<<<<<<<<<<<<< + * rc = c_ssh2.libssh2_channel_process_startup( + * self._channel, _request, r_len, _message, m_len) + */ + { + #ifdef WITH_THREAD + PyThreadState *_save; + Py_UNBLOCK_THREADS + __Pyx_FastGIL_Remember(); + #endif + /*try:*/ { + + /* "ssh2/channel.pyx":402 + * cdef int rc + * with nogil: + * rc = c_ssh2.libssh2_channel_process_startup( # <<<<<<<<<<<<<< + * self._channel, _request, r_len, _message, m_len) + * return rc + */ + __pyx_v_rc = libssh2_channel_process_startup(__pyx_v_self->_channel, __pyx_v__request, __pyx_v_r_len, __pyx_v__message, __pyx_v_m_len); + } + + /* "ssh2/channel.pyx":401 + * cdef size_t m_len = len(_message) + * cdef int rc + * with nogil: # <<<<<<<<<<<<<< + * rc = c_ssh2.libssh2_channel_process_startup( + * self._channel, _request, r_len, _message, m_len) + */ + /*finally:*/ { + /*normal exit:*/{ + #ifdef WITH_THREAD + __Pyx_FastGIL_Forget(); + Py_BLOCK_THREADS + #endif + goto __pyx_L5; + } + __pyx_L5:; + } + } + + /* "ssh2/channel.pyx":404 + * rc = c_ssh2.libssh2_channel_process_startup( + * self._channel, _request, r_len, _message, m_len) + * return rc # <<<<<<<<<<<<<< + * + * def poll_channel_read(self, int extended): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 404, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "ssh2/channel.pyx":391 + * return rc + * + * def process_startup(self, request, message): # <<<<<<<<<<<<<< + * """Startup process on server for request with message. + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("ssh2.channel.Channel.process_startup", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "ssh2/channel.pyx":406 + * return rc + * + * def poll_channel_read(self, int extended): # <<<<<<<<<<<<<< + * """Deprecated - use blockdirections and socket polling instead""" + * cdef int rc + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4ssh2_7channel_7Channel_63poll_channel_read(PyObject *__pyx_v_self, PyObject *__pyx_arg_extended); /*proto*/ +static char __pyx_doc_4ssh2_7channel_7Channel_62poll_channel_read[] = "Channel.poll_channel_read(self, int extended)\nDeprecated - use blockdirections and socket polling instead"; +static PyObject *__pyx_pw_4ssh2_7channel_7Channel_63poll_channel_read(PyObject *__pyx_v_self, PyObject *__pyx_arg_extended) { + int __pyx_v_extended; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("poll_channel_read (wrapper)", 0); + assert(__pyx_arg_extended); { + __pyx_v_extended = __Pyx_PyInt_As_int(__pyx_arg_extended); if (unlikely((__pyx_v_extended == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 406, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("ssh2.channel.Channel.poll_channel_read", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_4ssh2_7channel_7Channel_62poll_channel_read(((struct __pyx_obj_4ssh2_7channel_Channel *)__pyx_v_self), ((int)__pyx_v_extended)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4ssh2_7channel_7Channel_62poll_channel_read(struct __pyx_obj_4ssh2_7channel_Channel *__pyx_v_self, int __pyx_v_extended) { + int __pyx_v_rc; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("poll_channel_read", 0); + + /* "ssh2/channel.pyx":409 + * """Deprecated - use blockdirections and socket polling instead""" + * cdef int rc + * with nogil: # <<<<<<<<<<<<<< + * rc = c_ssh2.libssh2_poll_channel_read(self._channel, extended) + * return rc + */ + { + #ifdef WITH_THREAD + PyThreadState *_save; + Py_UNBLOCK_THREADS + __Pyx_FastGIL_Remember(); + #endif + /*try:*/ { + + /* "ssh2/channel.pyx":410 + * cdef int rc + * with nogil: + * rc = c_ssh2.libssh2_poll_channel_read(self._channel, extended) # <<<<<<<<<<<<<< + * return rc + * + */ + __pyx_v_rc = libssh2_poll_channel_read(__pyx_v_self->_channel, __pyx_v_extended); + } + + /* "ssh2/channel.pyx":409 + * """Deprecated - use blockdirections and socket polling instead""" + * cdef int rc + * with nogil: # <<<<<<<<<<<<<< + * rc = c_ssh2.libssh2_poll_channel_read(self._channel, extended) + * return rc + */ + /*finally:*/ { + /*normal exit:*/{ + #ifdef WITH_THREAD + __Pyx_FastGIL_Forget(); + Py_BLOCK_THREADS + #endif + goto __pyx_L5; + } + __pyx_L5:; + } + } + + /* "ssh2/channel.pyx":411 + * with nogil: + * rc = c_ssh2.libssh2_poll_channel_read(self._channel, extended) + * return rc # <<<<<<<<<<<<<< + * + * def handle_extended_data(self, int ignore_mode): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 411, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "ssh2/channel.pyx":406 + * return rc + * + * def poll_channel_read(self, int extended): # <<<<<<<<<<<<<< + * """Deprecated - use blockdirections and socket polling instead""" + * cdef int rc + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("ssh2.channel.Channel.poll_channel_read", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "ssh2/channel.pyx":413 + * return rc + * + * def handle_extended_data(self, int ignore_mode): # <<<<<<<<<<<<<< + * """Deprecated, use handle_extended_data2""" + * with nogil: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4ssh2_7channel_7Channel_65handle_extended_data(PyObject *__pyx_v_self, PyObject *__pyx_arg_ignore_mode); /*proto*/ +static char __pyx_doc_4ssh2_7channel_7Channel_64handle_extended_data[] = "Channel.handle_extended_data(self, int ignore_mode)\nDeprecated, use handle_extended_data2"; +static PyObject *__pyx_pw_4ssh2_7channel_7Channel_65handle_extended_data(PyObject *__pyx_v_self, PyObject *__pyx_arg_ignore_mode) { + int __pyx_v_ignore_mode; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("handle_extended_data (wrapper)", 0); + assert(__pyx_arg_ignore_mode); { + __pyx_v_ignore_mode = __Pyx_PyInt_As_int(__pyx_arg_ignore_mode); if (unlikely((__pyx_v_ignore_mode == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 413, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("ssh2.channel.Channel.handle_extended_data", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_4ssh2_7channel_7Channel_64handle_extended_data(((struct __pyx_obj_4ssh2_7channel_Channel *)__pyx_v_self), ((int)__pyx_v_ignore_mode)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4ssh2_7channel_7Channel_64handle_extended_data(struct __pyx_obj_4ssh2_7channel_Channel *__pyx_v_self, int __pyx_v_ignore_mode) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("handle_extended_data", 0); + + /* "ssh2/channel.pyx":415 + * def handle_extended_data(self, int ignore_mode): + * """Deprecated, use handle_extended_data2""" + * with nogil: # <<<<<<<<<<<<<< + * c_ssh2.libssh2_channel_handle_extended_data( + * self._channel, ignore_mode) + */ + { + #ifdef WITH_THREAD + PyThreadState *_save; + Py_UNBLOCK_THREADS + __Pyx_FastGIL_Remember(); + #endif + /*try:*/ { + + /* "ssh2/channel.pyx":416 + * """Deprecated, use handle_extended_data2""" + * with nogil: + * c_ssh2.libssh2_channel_handle_extended_data( # <<<<<<<<<<<<<< + * self._channel, ignore_mode) + * + */ + libssh2_channel_handle_extended_data(__pyx_v_self->_channel, __pyx_v_ignore_mode); + } + + /* "ssh2/channel.pyx":415 + * def handle_extended_data(self, int ignore_mode): + * """Deprecated, use handle_extended_data2""" + * with nogil: # <<<<<<<<<<<<<< + * c_ssh2.libssh2_channel_handle_extended_data( + * self._channel, ignore_mode) + */ + /*finally:*/ { + /*normal exit:*/{ + #ifdef WITH_THREAD + __Pyx_FastGIL_Forget(); + Py_BLOCK_THREADS + #endif + goto __pyx_L5; + } + __pyx_L5:; + } + } + + /* "ssh2/channel.pyx":413 + * return rc + * + * def handle_extended_data(self, int ignore_mode): # <<<<<<<<<<<<<< + * """Deprecated, use handle_extended_data2""" + * with nogil: + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "ssh2/channel.pyx":419 + * self._channel, ignore_mode) + * + * def handle_extended_data2(self, int ignore_mode): # <<<<<<<<<<<<<< + * cdef int rc + * with nogil: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4ssh2_7channel_7Channel_67handle_extended_data2(PyObject *__pyx_v_self, PyObject *__pyx_arg_ignore_mode); /*proto*/ +static char __pyx_doc_4ssh2_7channel_7Channel_66handle_extended_data2[] = "Channel.handle_extended_data2(self, int ignore_mode)"; +static PyObject *__pyx_pw_4ssh2_7channel_7Channel_67handle_extended_data2(PyObject *__pyx_v_self, PyObject *__pyx_arg_ignore_mode) { + int __pyx_v_ignore_mode; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("handle_extended_data2 (wrapper)", 0); + assert(__pyx_arg_ignore_mode); { + __pyx_v_ignore_mode = __Pyx_PyInt_As_int(__pyx_arg_ignore_mode); if (unlikely((__pyx_v_ignore_mode == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 419, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("ssh2.channel.Channel.handle_extended_data2", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_4ssh2_7channel_7Channel_66handle_extended_data2(((struct __pyx_obj_4ssh2_7channel_Channel *)__pyx_v_self), ((int)__pyx_v_ignore_mode)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4ssh2_7channel_7Channel_66handle_extended_data2(struct __pyx_obj_4ssh2_7channel_Channel *__pyx_v_self, int __pyx_v_ignore_mode) { + int __pyx_v_rc; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("handle_extended_data2", 0); + + /* "ssh2/channel.pyx":421 + * def handle_extended_data2(self, int ignore_mode): + * cdef int rc + * with nogil: # <<<<<<<<<<<<<< + * rc = c_ssh2.libssh2_channel_handle_extended_data2( + * self._channel, ignore_mode) + */ + { + #ifdef WITH_THREAD + PyThreadState *_save; + Py_UNBLOCK_THREADS + __Pyx_FastGIL_Remember(); + #endif + /*try:*/ { + + /* "ssh2/channel.pyx":422 + * cdef int rc + * with nogil: + * rc = c_ssh2.libssh2_channel_handle_extended_data2( # <<<<<<<<<<<<<< + * self._channel, ignore_mode) + * return rc + */ + __pyx_v_rc = libssh2_channel_handle_extended_data2(__pyx_v_self->_channel, __pyx_v_ignore_mode); + } + + /* "ssh2/channel.pyx":421 + * def handle_extended_data2(self, int ignore_mode): + * cdef int rc + * with nogil: # <<<<<<<<<<<<<< + * rc = c_ssh2.libssh2_channel_handle_extended_data2( + * self._channel, ignore_mode) + */ + /*finally:*/ { + /*normal exit:*/{ + #ifdef WITH_THREAD + __Pyx_FastGIL_Forget(); + Py_BLOCK_THREADS + #endif + goto __pyx_L5; + } + __pyx_L5:; + } + } + + /* "ssh2/channel.pyx":424 + * rc = c_ssh2.libssh2_channel_handle_extended_data2( + * self._channel, ignore_mode) + * return rc # <<<<<<<<<<<<<< + * + * def ignore_extended_data(self, int ignore_mode): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 424, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "ssh2/channel.pyx":419 + * self._channel, ignore_mode) + * + * def handle_extended_data2(self, int ignore_mode): # <<<<<<<<<<<<<< + * cdef int rc + * with nogil: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("ssh2.channel.Channel.handle_extended_data2", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "ssh2/channel.pyx":426 + * return rc + * + * def ignore_extended_data(self, int ignore_mode): # <<<<<<<<<<<<<< + * """Deprecated, use handle_extended_data2""" + * with nogil: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4ssh2_7channel_7Channel_69ignore_extended_data(PyObject *__pyx_v_self, PyObject *__pyx_arg_ignore_mode); /*proto*/ +static char __pyx_doc_4ssh2_7channel_7Channel_68ignore_extended_data[] = "Channel.ignore_extended_data(self, int ignore_mode)\nDeprecated, use handle_extended_data2"; +static PyObject *__pyx_pw_4ssh2_7channel_7Channel_69ignore_extended_data(PyObject *__pyx_v_self, PyObject *__pyx_arg_ignore_mode) { + int __pyx_v_ignore_mode; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("ignore_extended_data (wrapper)", 0); + assert(__pyx_arg_ignore_mode); { + __pyx_v_ignore_mode = __Pyx_PyInt_As_int(__pyx_arg_ignore_mode); if (unlikely((__pyx_v_ignore_mode == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 426, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("ssh2.channel.Channel.ignore_extended_data", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_4ssh2_7channel_7Channel_68ignore_extended_data(((struct __pyx_obj_4ssh2_7channel_Channel *)__pyx_v_self), ((int)__pyx_v_ignore_mode)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4ssh2_7channel_7Channel_68ignore_extended_data(struct __pyx_obj_4ssh2_7channel_Channel *__pyx_v_self, int __pyx_v_ignore_mode) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("ignore_extended_data", 0); + + /* "ssh2/channel.pyx":428 + * def ignore_extended_data(self, int ignore_mode): + * """Deprecated, use handle_extended_data2""" + * with nogil: # <<<<<<<<<<<<<< + * c_ssh2.libssh2_channel_handle_extended_data( + * self._channel, ignore_mode) + */ + { + #ifdef WITH_THREAD + PyThreadState *_save; + Py_UNBLOCK_THREADS + __Pyx_FastGIL_Remember(); + #endif + /*try:*/ { + + /* "ssh2/channel.pyx":429 + * """Deprecated, use handle_extended_data2""" + * with nogil: + * c_ssh2.libssh2_channel_handle_extended_data( # <<<<<<<<<<<<<< + * self._channel, ignore_mode) + */ + libssh2_channel_handle_extended_data(__pyx_v_self->_channel, __pyx_v_ignore_mode); + } + + /* "ssh2/channel.pyx":428 + * def ignore_extended_data(self, int ignore_mode): + * """Deprecated, use handle_extended_data2""" + * with nogil: # <<<<<<<<<<<<<< + * c_ssh2.libssh2_channel_handle_extended_data( + * self._channel, ignore_mode) + */ + /*finally:*/ { + /*normal exit:*/{ + #ifdef WITH_THREAD + __Pyx_FastGIL_Forget(); + Py_BLOCK_THREADS + #endif + goto __pyx_L5; + } + __pyx_L5:; + } + } + + /* "ssh2/channel.pyx":426 + * return rc + * + * def ignore_extended_data(self, int ignore_mode): # <<<<<<<<<<<<<< + * """Deprecated, use handle_extended_data2""" + * with nogil: + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; @@ -5516,20 +6662,20 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_54x11_req_ex(CYTHON_UNUSED str */ /* Python wrapper */ -static PyObject *__pyx_pw_4ssh2_7channel_7Channel_57__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static char __pyx_doc_4ssh2_7channel_7Channel_56__reduce_cython__[] = "Channel.__reduce_cython__(self)"; -static PyObject *__pyx_pw_4ssh2_7channel_7Channel_57__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { +static PyObject *__pyx_pw_4ssh2_7channel_7Channel_71__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_4ssh2_7channel_7Channel_70__reduce_cython__[] = "Channel.__reduce_cython__(self)"; +static PyObject *__pyx_pw_4ssh2_7channel_7Channel_71__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); - __pyx_r = __pyx_pf_4ssh2_7channel_7Channel_56__reduce_cython__(((struct __pyx_obj_4ssh2_7channel_Channel *)__pyx_v_self)); + __pyx_r = __pyx_pf_4ssh2_7channel_7Channel_70__reduce_cython__(((struct __pyx_obj_4ssh2_7channel_Channel *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_4ssh2_7channel_7Channel_56__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_4ssh2_7channel_Channel *__pyx_v_self) { +static PyObject *__pyx_pf_4ssh2_7channel_7Channel_70__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_4ssh2_7channel_Channel *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -5571,20 +6717,20 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_56__reduce_cython__(CYTHON_UNU */ /* Python wrapper */ -static PyObject *__pyx_pw_4ssh2_7channel_7Channel_59__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ -static char __pyx_doc_4ssh2_7channel_7Channel_58__setstate_cython__[] = "Channel.__setstate_cython__(self, __pyx_state)"; -static PyObject *__pyx_pw_4ssh2_7channel_7Channel_59__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { +static PyObject *__pyx_pw_4ssh2_7channel_7Channel_73__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static char __pyx_doc_4ssh2_7channel_7Channel_72__setstate_cython__[] = "Channel.__setstate_cython__(self, __pyx_state)"; +static PyObject *__pyx_pw_4ssh2_7channel_7Channel_73__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); - __pyx_r = __pyx_pf_4ssh2_7channel_7Channel_58__setstate_cython__(((struct __pyx_obj_4ssh2_7channel_Channel *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + __pyx_r = __pyx_pf_4ssh2_7channel_7Channel_72__setstate_cython__(((struct __pyx_obj_4ssh2_7channel_Channel *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_4ssh2_7channel_7Channel_58__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_4ssh2_7channel_Channel *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { +static PyObject *__pyx_pf_4ssh2_7channel_7Channel_72__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_4ssh2_7channel_Channel *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -5696,13 +6842,20 @@ static PyMethodDef __pyx_methods_4ssh2_7channel_Channel[] = { {"window_read", (PyCFunction)__pyx_pw_4ssh2_7channel_7Channel_41window_read, METH_NOARGS, __pyx_doc_4ssh2_7channel_7Channel_40window_read}, {"window_write_ex", (PyCFunction)__pyx_pw_4ssh2_7channel_7Channel_43window_write_ex, METH_O, __pyx_doc_4ssh2_7channel_7Channel_42window_write_ex}, {"window_write", (PyCFunction)__pyx_pw_4ssh2_7channel_7Channel_45window_write, METH_NOARGS, __pyx_doc_4ssh2_7channel_7Channel_44window_write}, - {"write", (PyCFunction)__pyx_pw_4ssh2_7channel_7Channel_47write, METH_O, __pyx_doc_4ssh2_7channel_7Channel_46write}, - {"write_ex", (PyCFunction)__pyx_pw_4ssh2_7channel_7Channel_49write_ex, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4ssh2_7channel_7Channel_48write_ex}, - {"write_stderr", (PyCFunction)__pyx_pw_4ssh2_7channel_7Channel_51write_stderr, METH_O, __pyx_doc_4ssh2_7channel_7Channel_50write_stderr}, - {"x11_req", (PyCFunction)__pyx_pw_4ssh2_7channel_7Channel_53x11_req, METH_NOARGS, __pyx_doc_4ssh2_7channel_7Channel_52x11_req}, - {"x11_req_ex", (PyCFunction)__pyx_pw_4ssh2_7channel_7Channel_55x11_req_ex, METH_NOARGS, __pyx_doc_4ssh2_7channel_7Channel_54x11_req_ex}, - {"__reduce_cython__", (PyCFunction)__pyx_pw_4ssh2_7channel_7Channel_57__reduce_cython__, METH_NOARGS, __pyx_doc_4ssh2_7channel_7Channel_56__reduce_cython__}, - {"__setstate_cython__", (PyCFunction)__pyx_pw_4ssh2_7channel_7Channel_59__setstate_cython__, METH_O, __pyx_doc_4ssh2_7channel_7Channel_58__setstate_cython__}, + {"receive_window_adjust", (PyCFunction)__pyx_pw_4ssh2_7channel_7Channel_47receive_window_adjust, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4ssh2_7channel_7Channel_46receive_window_adjust}, + {"receive_window_adjust2", (PyCFunction)__pyx_pw_4ssh2_7channel_7Channel_49receive_window_adjust2, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4ssh2_7channel_7Channel_48receive_window_adjust2}, + {"write", (PyCFunction)__pyx_pw_4ssh2_7channel_7Channel_51write, METH_O, __pyx_doc_4ssh2_7channel_7Channel_50write}, + {"write_ex", (PyCFunction)__pyx_pw_4ssh2_7channel_7Channel_53write_ex, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4ssh2_7channel_7Channel_52write_ex}, + {"write_stderr", (PyCFunction)__pyx_pw_4ssh2_7channel_7Channel_55write_stderr, METH_O, __pyx_doc_4ssh2_7channel_7Channel_54write_stderr}, + {"x11_req", (PyCFunction)__pyx_pw_4ssh2_7channel_7Channel_57x11_req, METH_O, __pyx_doc_4ssh2_7channel_7Channel_56x11_req}, + {"x11_req_ex", (PyCFunction)__pyx_pw_4ssh2_7channel_7Channel_59x11_req_ex, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4ssh2_7channel_7Channel_58x11_req_ex}, + {"process_startup", (PyCFunction)__pyx_pw_4ssh2_7channel_7Channel_61process_startup, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4ssh2_7channel_7Channel_60process_startup}, + {"poll_channel_read", (PyCFunction)__pyx_pw_4ssh2_7channel_7Channel_63poll_channel_read, METH_O, __pyx_doc_4ssh2_7channel_7Channel_62poll_channel_read}, + {"handle_extended_data", (PyCFunction)__pyx_pw_4ssh2_7channel_7Channel_65handle_extended_data, METH_O, __pyx_doc_4ssh2_7channel_7Channel_64handle_extended_data}, + {"handle_extended_data2", (PyCFunction)__pyx_pw_4ssh2_7channel_7Channel_67handle_extended_data2, METH_O, __pyx_doc_4ssh2_7channel_7Channel_66handle_extended_data2}, + {"ignore_extended_data", (PyCFunction)__pyx_pw_4ssh2_7channel_7Channel_69ignore_extended_data, METH_O, __pyx_doc_4ssh2_7channel_7Channel_68ignore_extended_data}, + {"__reduce_cython__", (PyCFunction)__pyx_pw_4ssh2_7channel_7Channel_71__reduce_cython__, METH_NOARGS, __pyx_doc_4ssh2_7channel_7Channel_70__reduce_cython__}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_4ssh2_7channel_7Channel_73__setstate_cython__, METH_O, __pyx_doc_4ssh2_7channel_7Channel_72__setstate_cython__}, {0, 0, 0, 0} }; @@ -5792,18 +6945,25 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_s_Error_requesting_PTY_with_error, __pyx_k_Error_requesting_PTY_with_error, sizeof(__pyx_k_Error_requesting_PTY_with_error), 0, 0, 1, 0}, {&__pyx_kp_s_Error_requesting_subsystem_s_err, __pyx_k_Error_requesting_subsystem_s_err, sizeof(__pyx_k_Error_requesting_subsystem_s_err), 0, 0, 1, 0}, {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1}, - {&__pyx_n_s_NotImplementedError, __pyx_k_NotImplementedError, sizeof(__pyx_k_NotImplementedError), 0, 0, 1, 1}, {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, + {&__pyx_n_s_adjustment, __pyx_k_adjustment, sizeof(__pyx_k_adjustment), 0, 0, 1, 1}, + {&__pyx_n_s_auth_cookie, __pyx_k_auth_cookie, sizeof(__pyx_k_auth_cookie), 0, 0, 1, 1}, + {&__pyx_n_s_auth_proto, __pyx_k_auth_proto, sizeof(__pyx_k_auth_proto), 0, 0, 1, 1}, {&__pyx_n_s_buf, __pyx_k_buf, sizeof(__pyx_k_buf), 0, 0, 1, 1}, {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, + {&__pyx_n_s_force, __pyx_k_force, sizeof(__pyx_k_force), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_message, __pyx_k_message, sizeof(__pyx_k_message), 0, 0, 1, 1}, {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0}, {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, {&__pyx_n_s_read_avail, __pyx_k_read_avail, sizeof(__pyx_k_read_avail), 0, 0, 1, 1}, {&__pyx_n_s_read_ex, __pyx_k_read_ex, sizeof(__pyx_k_read_ex), 0, 0, 1, 1}, {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1}, + {&__pyx_n_s_request, __pyx_k_request, sizeof(__pyx_k_request), 0, 0, 1, 1}, + {&__pyx_n_s_screen_number, __pyx_k_screen_number, sizeof(__pyx_k_screen_number), 0, 0, 1, 1}, {&__pyx_n_s_session, __pyx_k_session, sizeof(__pyx_k_session), 0, 0, 1, 1}, {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1}, + {&__pyx_n_s_single_connection, __pyx_k_single_connection, sizeof(__pyx_k_single_connection), 0, 0, 1, 1}, {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1}, {&__pyx_n_s_stream_id, __pyx_k_stream_id, sizeof(__pyx_k_stream_id), 0, 0, 1, 1}, {&__pyx_n_s_term, __pyx_k_term, sizeof(__pyx_k_term), 0, 0, 1, 1}, @@ -5816,7 +6976,6 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { }; static int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(0, 122, __pyx_L1_error) - __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) __PYX_ERR(0, 357, __pyx_L1_error) __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error) return 0; __pyx_L1_error:; @@ -5958,7 +7117,7 @@ PyMODINIT_FUNC PyInit_channel(void) __pyx_ptype_4ssh2_4sftp_SFTP = __Pyx_ImportType("ssh2.sftp", "SFTP", sizeof(struct __pyx_obj_4ssh2_4sftp_SFTP), 1); if (unlikely(!__pyx_ptype_4ssh2_4sftp_SFTP)) __PYX_ERR(3, 26, __pyx_L1_error) __pyx_ptype_4ssh2_10exceptions_AgentError = __Pyx_ImportType("ssh2.exceptions", "AgentError", sizeof(struct __pyx_obj_4ssh2_10exceptions_AgentError), 1); if (unlikely(!__pyx_ptype_4ssh2_10exceptions_AgentError)) __PYX_ERR(4, 17, __pyx_L1_error) __pyx_ptype_4ssh2_10exceptions_AuthenticationError = __Pyx_ImportType("ssh2.exceptions", "AuthenticationError", sizeof(struct __pyx_obj_4ssh2_10exceptions_AuthenticationError), 1); if (unlikely(!__pyx_ptype_4ssh2_10exceptions_AuthenticationError)) __PYX_ERR(4, 21, __pyx_L1_error) - __pyx_ptype_4ssh2_10exceptions_AgentConnectError = __Pyx_ImportType("ssh2.exceptions", "AgentConnectError", sizeof(struct __pyx_obj_4ssh2_10exceptions_AgentConnectError), 1); if (unlikely(!__pyx_ptype_4ssh2_10exceptions_AgentConnectError)) __PYX_ERR(4, 25, __pyx_L1_error) + __pyx_ptype_4ssh2_10exceptions_AgentConnectionError = __Pyx_ImportType("ssh2.exceptions", "AgentConnectionError", sizeof(struct __pyx_obj_4ssh2_10exceptions_AgentConnectionError), 1); if (unlikely(!__pyx_ptype_4ssh2_10exceptions_AgentConnectionError)) __PYX_ERR(4, 25, __pyx_L1_error) __pyx_ptype_4ssh2_10exceptions_AgentAuthenticationError = __Pyx_ImportType("ssh2.exceptions", "AgentAuthenticationError", sizeof(struct __pyx_obj_4ssh2_10exceptions_AgentAuthenticationError), 1); if (unlikely(!__pyx_ptype_4ssh2_10exceptions_AgentAuthenticationError)) __PYX_ERR(4, 29, __pyx_L1_error) __pyx_ptype_4ssh2_10exceptions_AgentListIdentitiesError = __Pyx_ImportType("ssh2.exceptions", "AgentListIdentitiesError", sizeof(struct __pyx_obj_4ssh2_10exceptions_AgentListIdentitiesError), 1); if (unlikely(!__pyx_ptype_4ssh2_10exceptions_AgentListIdentitiesError)) __PYX_ERR(4, 33, __pyx_L1_error) __pyx_ptype_4ssh2_10exceptions_AgentGetIdentityError = __Pyx_ImportType("ssh2.exceptions", "AgentGetIdentityError", sizeof(struct __pyx_obj_4ssh2_10exceptions_AgentGetIdentityError), 1); if (unlikely(!__pyx_ptype_4ssh2_10exceptions_AgentGetIdentityError)) __PYX_ERR(4, 37, __pyx_L1_error) diff --git a/ssh2/channel.pyx b/ssh2/channel.pyx index 1a2495eb..9d7c6655 100644 --- a/ssh2/channel.pyx +++ b/ssh2/channel.pyx @@ -307,6 +307,23 @@ cdef class Channel: rc = c_ssh2.libssh2_channel_window_write(self._channel) return rc + def receive_window_adjust(self, unsigned long adjustment, + unsigned long force): + cdef unsigned long rc + with nogil: + rc = c_ssh2.libssh2_channel_receive_window_adjust( + self._channel, adjustment, force) + return rc + + def receive_window_adjust2(self, unsigned long adjustment, + unsigned long force): + cdef unsigned long rc + cdef unsigned int storewindow = 0 + with nogil: + rc = c_ssh2.libssh2_channel_receive_window_adjust2( + self._channel, adjustment, force, &storewindow) + return rc + def write(self, buf not None): """Write buffer to stdin @@ -353,8 +370,61 @@ cdef class Channel: self._channel, _buf, buflen) return rc - def x11_req(self): - raise NotImplementedError + def x11_req(self, int screen_number): + cdef int rc + with nogil: + rc = c_ssh2.libssh2_channel_x11_req( + self._channel, screen_number) + return rc + + def x11_req_ex(self, int single_connection, + const char *auth_proto, + const char *auth_cookie, + int screen_number): + cdef int rc + with nogil: + rc = c_ssh2.libssh2_channel_x11_req_ex( + self._channel, single_connection, + auth_proto, auth_cookie, screen_number) + return rc + + def process_startup(self, request, message): + """Startup process on server for request with message. - def x11_req_ex(self): - raise NotImplementedError + Request is a supported SSH subsystem and clients would typically use + one of execute/shell/subsystem functions depending on request type.""" + cdef char *_request = to_bytes(request) + cdef char *_message = to_bytes(message) + cdef size_t r_len = len(_request) + cdef size_t m_len = len(_message) + cdef int rc + with nogil: + rc = c_ssh2.libssh2_channel_process_startup( + self._channel, _request, r_len, _message, m_len) + return rc + + def poll_channel_read(self, int extended): + """Deprecated - use blockdirections and socket polling instead""" + cdef int rc + with nogil: + rc = c_ssh2.libssh2_poll_channel_read(self._channel, extended) + return rc + + def handle_extended_data(self, int ignore_mode): + """Deprecated, use handle_extended_data2""" + with nogil: + c_ssh2.libssh2_channel_handle_extended_data( + self._channel, ignore_mode) + + def handle_extended_data2(self, int ignore_mode): + cdef int rc + with nogil: + rc = c_ssh2.libssh2_channel_handle_extended_data2( + self._channel, ignore_mode) + return rc + + def ignore_extended_data(self, int ignore_mode): + """Deprecated, use handle_extended_data2""" + with nogil: + c_ssh2.libssh2_channel_handle_extended_data( + self._channel, ignore_mode) diff --git a/ssh2/error_codes.c b/ssh2/error_codes.c index ca61f123..3027d958 100644 --- a/ssh2/error_codes.c +++ b/ssh2/error_codes.c @@ -3,18 +3,18 @@ /* BEGIN: Cython Metadata { "distutils": { - "depends": [], + "depends": [], "extra_compile_args": [ "-ggdb" - ], + ], "libraries": [ "ssh2" - ], - "name": "ssh2.error_codes", + ], + "name": "ssh2.error_codes", "sources": [ "ssh2/error_codes.pyx" ] - }, + }, "module_name": "ssh2.error_codes" } END: Cython Metadata */ @@ -489,6 +489,7 @@ static CYTHON_INLINE float __PYX_NAN() { #define __PYX_HAVE__ssh2__error_codes #define __PYX_HAVE_API__ssh2__error_codes #include "libssh2.h" +#include #include #include #include @@ -818,6 +819,8 @@ static int __Pyx_check_binary_version(void); static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); +/* Module declarations from 'libc.stdint' */ + /* Module declarations from 'libc.stddef' */ /* Module declarations from 'libc.time' */ @@ -837,7 +840,9 @@ static const char __pyx_k_LIBSSH2_ERROR_NONE[] = "LIBSSH2_ERROR_NONE"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_LIBSSH2_ERROR_EAGAIN[] = "LIBSSH2_ERROR_EAGAIN"; static const char __pyx_k_LIBSSH2CHANNEL_EAGAIN[] = "LIBSSH2CHANNEL_EAGAIN"; +static const char __pyx_k_LIBSSH2_ERROR_TIMEOUT[] = "LIBSSH2_ERROR_TIMEOUT"; static const char __pyx_k_LIBSSH2_ERROR_SOCKET_RECV[] = "LIBSSH2_ERROR_SOCKET_RECV"; +static const char __pyx_k_LIBSSH2_ERROR_SOCKET_TIMEOUT[] = "LIBSSH2_ERROR_SOCKET_TIMEOUT"; static const char __pyx_k_LIBSSH2_SESSION_BLOCK_INBOUND[] = "LIBSSH2_SESSION_BLOCK_INBOUND"; static const char __pyx_k_LIBSSH2_SESSION_BLOCK_OUTBOUND[] = "LIBSSH2_SESSION_BLOCK_OUTBOUND"; static const char __pyx_k_LIBSSH2_ERROR_AUTHENTICATION_FAI[] = "LIBSSH2_ERROR_AUTHENTICATION_FAILED"; @@ -846,6 +851,8 @@ static PyObject *__pyx_n_s_LIBSSH2_ERROR_AUTHENTICATION_FAI; static PyObject *__pyx_n_s_LIBSSH2_ERROR_EAGAIN; static PyObject *__pyx_n_s_LIBSSH2_ERROR_NONE; static PyObject *__pyx_n_s_LIBSSH2_ERROR_SOCKET_RECV; +static PyObject *__pyx_n_s_LIBSSH2_ERROR_SOCKET_TIMEOUT; +static PyObject *__pyx_n_s_LIBSSH2_ERROR_TIMEOUT; static PyObject *__pyx_n_s_LIBSSH2_SESSION_BLOCK_INBOUND; static PyObject *__pyx_n_s_LIBSSH2_SESSION_BLOCK_OUTBOUND; static PyObject *__pyx_n_s_cline_in_traceback; @@ -880,6 +887,8 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_LIBSSH2_ERROR_EAGAIN, __pyx_k_LIBSSH2_ERROR_EAGAIN, sizeof(__pyx_k_LIBSSH2_ERROR_EAGAIN), 0, 0, 1, 1}, {&__pyx_n_s_LIBSSH2_ERROR_NONE, __pyx_k_LIBSSH2_ERROR_NONE, sizeof(__pyx_k_LIBSSH2_ERROR_NONE), 0, 0, 1, 1}, {&__pyx_n_s_LIBSSH2_ERROR_SOCKET_RECV, __pyx_k_LIBSSH2_ERROR_SOCKET_RECV, sizeof(__pyx_k_LIBSSH2_ERROR_SOCKET_RECV), 0, 0, 1, 1}, + {&__pyx_n_s_LIBSSH2_ERROR_SOCKET_TIMEOUT, __pyx_k_LIBSSH2_ERROR_SOCKET_TIMEOUT, sizeof(__pyx_k_LIBSSH2_ERROR_SOCKET_TIMEOUT), 0, 0, 1, 1}, + {&__pyx_n_s_LIBSSH2_ERROR_TIMEOUT, __pyx_k_LIBSSH2_ERROR_TIMEOUT, sizeof(__pyx_k_LIBSSH2_ERROR_TIMEOUT), 0, 0, 1, 1}, {&__pyx_n_s_LIBSSH2_SESSION_BLOCK_INBOUND, __pyx_k_LIBSSH2_SESSION_BLOCK_INBOUND, sizeof(__pyx_k_LIBSSH2_SESSION_BLOCK_INBOUND), 0, 0, 1, 1}, {&__pyx_n_s_LIBSSH2_SESSION_BLOCK_OUTBOUND, __pyx_k_LIBSSH2_SESSION_BLOCK_OUTBOUND, sizeof(__pyx_k_LIBSSH2_SESSION_BLOCK_OUTBOUND), 0, 0, 1, 1}, {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, @@ -1094,6 +1103,27 @@ PyMODINIT_FUNC PyInit_error_codes(void) if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_SESSION_BLOCK_OUTBOUND, __pyx_t_1) < 0) __PYX_ERR(0, 28, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /* "ssh2/error_codes.pyx":31 + * # LIBSSH2_CHANNEL_FLUSH_EXTENDED_DATA = c_ssh2._LIBSSH2_CHANNEL_FLUSH_EXTENDED_DATA + * # LIBSSH2_CHANNEL_FLUSH_ALL = c_ssh2._LIBSSH2_CHANNEL_FLUSH_ALL + * LIBSSH2_ERROR_TIMEOUT = error_codes._LIBSSH2_ERROR_TIMEOUT # <<<<<<<<<<<<<< + * LIBSSH2_ERROR_SOCKET_TIMEOUT = error_codes._LIBSSH2_ERROR_SOCKET_TIMEOUT + */ + __pyx_t_1 = __Pyx_PyInt_From_int(LIBSSH2_ERROR_TIMEOUT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 31, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_ERROR_TIMEOUT, __pyx_t_1) < 0) __PYX_ERR(0, 31, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "ssh2/error_codes.pyx":32 + * # LIBSSH2_CHANNEL_FLUSH_ALL = c_ssh2._LIBSSH2_CHANNEL_FLUSH_ALL + * LIBSSH2_ERROR_TIMEOUT = error_codes._LIBSSH2_ERROR_TIMEOUT + * LIBSSH2_ERROR_SOCKET_TIMEOUT = error_codes._LIBSSH2_ERROR_SOCKET_TIMEOUT # <<<<<<<<<<<<<< + */ + __pyx_t_1 = __Pyx_PyInt_From_int(LIBSSH2_ERROR_SOCKET_TIMEOUT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 32, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_ERROR_SOCKET_TIMEOUT, __pyx_t_1) < 0) __PYX_ERR(0, 32, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /* "ssh2/error_codes.pyx":1 * # This file is part of ssh2-python. # <<<<<<<<<<<<<< * # Copyright (C) 2017 Panos Kittenis diff --git a/ssh2/error_codes.pyx b/ssh2/error_codes.pyx index db61cca6..c2a55a18 100644 --- a/ssh2/error_codes.pyx +++ b/ssh2/error_codes.pyx @@ -28,3 +28,5 @@ LIBSSH2_SESSION_BLOCK_INBOUND = c_ssh2._LIBSSH2_SESSION_BLOCK_INBOUND LIBSSH2_SESSION_BLOCK_OUTBOUND = c_ssh2._LIBSSH2_SESSION_BLOCK_OUTBOUND # LIBSSH2_CHANNEL_FLUSH_EXTENDED_DATA = c_ssh2._LIBSSH2_CHANNEL_FLUSH_EXTENDED_DATA # LIBSSH2_CHANNEL_FLUSH_ALL = c_ssh2._LIBSSH2_CHANNEL_FLUSH_ALL +LIBSSH2_ERROR_TIMEOUT = error_codes._LIBSSH2_ERROR_TIMEOUT +LIBSSH2_ERROR_SOCKET_TIMEOUT = error_codes._LIBSSH2_ERROR_SOCKET_TIMEOUT diff --git a/ssh2/exceptions.c b/ssh2/exceptions.c index 3cd49a8e..e4d10f88 100644 --- a/ssh2/exceptions.c +++ b/ssh2/exceptions.c @@ -5,15 +5,15 @@ "distutils": { "extra_compile_args": [ "-ggdb" - ], + ], "libraries": [ "ssh2" - ], - "name": "ssh2.exceptions", + ], + "name": "ssh2.exceptions", "sources": [ "ssh2/exceptions.pyx" ] - }, + }, "module_name": "ssh2.exceptions" } END: Cython Metadata */ @@ -694,7 +694,7 @@ static const char *__pyx_f[] = { /*--- Type declarations ---*/ struct __pyx_obj_4ssh2_10exceptions_AgentError; struct __pyx_obj_4ssh2_10exceptions_AuthenticationError; -struct __pyx_obj_4ssh2_10exceptions_AgentConnectError; +struct __pyx_obj_4ssh2_10exceptions_AgentConnectionError; struct __pyx_obj_4ssh2_10exceptions_AgentAuthenticationError; struct __pyx_obj_4ssh2_10exceptions_AgentListIdentitiesError; struct __pyx_obj_4ssh2_10exceptions_AgentGetIdentityError; @@ -731,11 +731,11 @@ struct __pyx_obj_4ssh2_10exceptions_AuthenticationError { /* "ssh2/exceptions.pxd":25 * * - * cdef class AgentConnectError(AgentError): # <<<<<<<<<<<<<< + * cdef class AgentConnectionError(AgentError): # <<<<<<<<<<<<<< * pass * */ -struct __pyx_obj_4ssh2_10exceptions_AgentConnectError { +struct __pyx_obj_4ssh2_10exceptions_AgentConnectionError { struct __pyx_obj_4ssh2_10exceptions_AgentError __pyx_base; }; @@ -956,7 +956,7 @@ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* Module declarations from 'ssh2.exceptions' */ static PyTypeObject *__pyx_ptype_4ssh2_10exceptions_AgentError = 0; static PyTypeObject *__pyx_ptype_4ssh2_10exceptions_AuthenticationError = 0; -static PyTypeObject *__pyx_ptype_4ssh2_10exceptions_AgentConnectError = 0; +static PyTypeObject *__pyx_ptype_4ssh2_10exceptions_AgentConnectionError = 0; static PyTypeObject *__pyx_ptype_4ssh2_10exceptions_AgentAuthenticationError = 0; static PyTypeObject *__pyx_ptype_4ssh2_10exceptions_AgentListIdentitiesError = 0; static PyTypeObject *__pyx_ptype_4ssh2_10exceptions_AgentGetIdentityError = 0; @@ -977,7 +977,7 @@ static PyObject *__pyx_n_s_main; static PyObject *__pyx_n_s_test; static PyObject *__pyx_tp_new_4ssh2_10exceptions_AgentError(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_4ssh2_10exceptions_AuthenticationError(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_4ssh2_10exceptions_AgentConnectError(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_4ssh2_10exceptions_AgentConnectionError(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_4ssh2_10exceptions_AgentAuthenticationError(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_4ssh2_10exceptions_AgentListIdentitiesError(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_4ssh2_10exceptions_AgentGetIdentityError(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ @@ -1159,16 +1159,16 @@ static PyTypeObject __pyx_type_4ssh2_10exceptions_AuthenticationError = { #endif }; -static PyObject *__pyx_tp_new_4ssh2_10exceptions_AgentConnectError(PyTypeObject *t, PyObject *a, PyObject *k) { +static PyObject *__pyx_tp_new_4ssh2_10exceptions_AgentConnectionError(PyTypeObject *t, PyObject *a, PyObject *k) { PyObject *o = __pyx_tp_new_4ssh2_10exceptions_AgentError(t, a, k); if (unlikely(!o)) return 0; return o; } -static PyTypeObject __pyx_type_4ssh2_10exceptions_AgentConnectError = { +static PyTypeObject __pyx_type_4ssh2_10exceptions_AgentConnectionError = { PyVarObject_HEAD_INIT(0, 0) - "ssh2.exceptions.AgentConnectError", /*tp_name*/ - sizeof(struct __pyx_obj_4ssh2_10exceptions_AgentConnectError), /*tp_basicsize*/ + "ssh2.exceptions.AgentConnectionError", /*tp_name*/ + sizeof(struct __pyx_obj_4ssh2_10exceptions_AgentConnectionError), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_4ssh2_10exceptions_AgentError, /*tp_dealloc*/ 0, /*tp_print*/ @@ -1208,7 +1208,7 @@ static PyTypeObject __pyx_type_4ssh2_10exceptions_AgentConnectError = { 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_4ssh2_10exceptions_AgentConnectError, /*tp_new*/ + __pyx_tp_new_4ssh2_10exceptions_AgentConnectionError, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -1986,11 +1986,11 @@ PyMODINIT_FUNC PyInit_exceptions(void) __pyx_type_4ssh2_10exceptions_AuthenticationError.tp_print = 0; if (PyObject_SetAttrString(__pyx_m, "AuthenticationError", (PyObject *)&__pyx_type_4ssh2_10exceptions_AuthenticationError) < 0) __PYX_ERR(1, 21, __pyx_L1_error) __pyx_ptype_4ssh2_10exceptions_AuthenticationError = &__pyx_type_4ssh2_10exceptions_AuthenticationError; - __pyx_type_4ssh2_10exceptions_AgentConnectError.tp_base = __pyx_ptype_4ssh2_10exceptions_AgentError; - if (PyType_Ready(&__pyx_type_4ssh2_10exceptions_AgentConnectError) < 0) __PYX_ERR(1, 25, __pyx_L1_error) - __pyx_type_4ssh2_10exceptions_AgentConnectError.tp_print = 0; - if (PyObject_SetAttrString(__pyx_m, "AgentConnectError", (PyObject *)&__pyx_type_4ssh2_10exceptions_AgentConnectError) < 0) __PYX_ERR(1, 25, __pyx_L1_error) - __pyx_ptype_4ssh2_10exceptions_AgentConnectError = &__pyx_type_4ssh2_10exceptions_AgentConnectError; + __pyx_type_4ssh2_10exceptions_AgentConnectionError.tp_base = __pyx_ptype_4ssh2_10exceptions_AgentError; + if (PyType_Ready(&__pyx_type_4ssh2_10exceptions_AgentConnectionError) < 0) __PYX_ERR(1, 25, __pyx_L1_error) + __pyx_type_4ssh2_10exceptions_AgentConnectionError.tp_print = 0; + if (PyObject_SetAttrString(__pyx_m, "AgentConnectionError", (PyObject *)&__pyx_type_4ssh2_10exceptions_AgentConnectionError) < 0) __PYX_ERR(1, 25, __pyx_L1_error) + __pyx_ptype_4ssh2_10exceptions_AgentConnectionError = &__pyx_type_4ssh2_10exceptions_AgentConnectionError; __pyx_type_4ssh2_10exceptions_AgentAuthenticationError.tp_base = __pyx_ptype_4ssh2_10exceptions_AuthenticationError; if (PyType_Ready(&__pyx_type_4ssh2_10exceptions_AgentAuthenticationError) < 0) __PYX_ERR(1, 29, __pyx_L1_error) __pyx_type_4ssh2_10exceptions_AgentAuthenticationError.tp_print = 0; diff --git a/ssh2/exceptions.pxd b/ssh2/exceptions.pxd index 93b542a9..f25211d4 100644 --- a/ssh2/exceptions.pxd +++ b/ssh2/exceptions.pxd @@ -22,7 +22,7 @@ cdef class AuthenticationError(Exception): pass -cdef class AgentConnectError(AgentError): +cdef class AgentConnectionError(AgentError): pass diff --git a/ssh2/fileinfo.c b/ssh2/fileinfo.c new file mode 100644 index 00000000..b9834c95 --- /dev/null +++ b/ssh2/fileinfo.c @@ -0,0 +1,3927 @@ +/* Generated by Cython 0.26 */ + +/* BEGIN: Cython Metadata +{ + "distutils": { + "depends": [], + "extra_compile_args": [ + "-ggdb" + ], + "libraries": [ + "ssh2" + ], + "name": "ssh2.fileinfo", + "sources": [ + "ssh2/fileinfo.pyx" + ] + }, + "module_name": "ssh2.fileinfo" +} +END: Cython Metadata */ + +#define PY_SSIZE_T_CLEAN +#include "Python.h" +#ifndef Py_PYTHON_H + #error Python headers needed to compile C extensions, please install development version of Python. +#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) + #error Cython requires Python 2.6+ or Python 3.2+. +#else +#define CYTHON_ABI "0_26" +#include +#ifndef offsetof + #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif + #ifndef __fastcall + #define __fastcall + #endif +#endif +#ifndef DL_IMPORT + #define DL_IMPORT(t) t +#endif +#ifndef DL_EXPORT + #define DL_EXPORT(t) t +#endif +#define __PYX_COMMA , +#ifndef HAVE_LONG_LONG + #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000) + #define HAVE_LONG_LONG + #endif +#endif +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#ifdef PYPY_VERSION + #define CYTHON_COMPILING_IN_PYPY 1 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 0 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #undef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 +#elif defined(PYSTON_VERSION) + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 1 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 +#else + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 1 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #if PY_MAJOR_VERSION < 3 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #elif !defined(CYTHON_USE_PYLONG_INTERNALS) + #define CYTHON_USE_PYLONG_INTERNALS 1 + #endif + #ifndef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 1 + #endif + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #if PY_VERSION_HEX < 0x030300F0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #elif !defined(CYTHON_USE_UNICODE_WRITER) + #define CYTHON_USE_UNICODE_WRITER 1 + #endif + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #ifndef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 1 + #endif + #ifndef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 1 + #endif +#endif +#if !defined(CYTHON_FAST_PYCCALL) +#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) +#endif +#if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #undef SHIFT + #undef BASE + #undef MASK +#endif +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) + #define Py_OptimizeFlag 0 +#endif +#define __PYX_BUILD_PY_SSIZE_T "n" +#define CYTHON_FORMAT_SSIZE_T "z" +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyClass_Type +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyType_Type +#endif +#ifndef Py_TPFLAGS_CHECKTYPES + #define Py_TPFLAGS_CHECKTYPES 0 +#endif +#ifndef Py_TPFLAGS_HAVE_INDEX + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#ifndef Py_TPFLAGS_HAVE_NEWBUFFER + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#ifndef Py_TPFLAGS_HAVE_FINALIZE + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#if PY_VERSION_HEX < 0x030700A0 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject **args, + Py_ssize_t nargs, PyObject *kwnames); +#else + #define __Pyx_PyCFunctionFast _PyCFunctionFast + #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords +#endif +#if CYTHON_FAST_PYCCALL +#define __Pyx_PyFastCFunction_Check(func)\ + ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS))))) +#else +#define __Pyx_PyFastCFunction_Check(func) 0 +#endif +#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) + #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) +#else + #define CYTHON_PEP393_ENABLED 0 + #define PyUnicode_1BYTE_KIND 1 + #define PyUnicode_2BYTE_KIND 2 + #define PyUnicode_4BYTE_KIND 4 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111) + #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) +#endif +#if CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) +#else + #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ + PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) + #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check) + #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) + #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) + #define PyObject_Malloc(s) PyMem_Malloc(s) + #define PyObject_Free(p) PyMem_Free(p) + #define PyObject_Realloc(p) PyMem_Realloc(p) +#endif +#if CYTHON_COMPILING_IN_PYSTON + #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno) +#else + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) +#endif +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) + #define PyObject_ASCII(o) PyObject_Repr(o) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +#endif +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY + #ifndef PyUnicode_InternFromString + #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) + #endif +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t PyInt_AsLong +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) +#else + #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) +#endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif +#if CYTHON_USE_ASYNC_SLOTS + #if PY_VERSION_HEX >= 0x030500B1 + #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods + #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) + #else + typedef struct { + unaryfunc am_await; + unaryfunc am_aiter; + unaryfunc am_anext; + } __Pyx_PyAsyncMethodsStruct; + #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) + #endif +#else + #define __Pyx_PyType_AsAsync(obj) NULL +#endif +#ifndef CYTHON_RESTRICT + #if defined(__GNUC__) + #define CYTHON_RESTRICT __restrict__ + #elif defined(_MSC_VER) && _MSC_VER >= 1400 + #define CYTHON_RESTRICT __restrict + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_RESTRICT restrict + #else + #define CYTHON_RESTRICT + #endif +#endif +#ifndef CYTHON_UNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +#endif +#ifndef CYTHON_MAYBE_UNUSED_VAR +# if defined(__cplusplus) + template void CYTHON_MAYBE_UNUSED_VAR( const T& ) { } +# else +# define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x) +# endif +#endif +#ifndef CYTHON_NCP_UNUSED +# if CYTHON_COMPILING_IN_CPYTHON +# define CYTHON_NCP_UNUSED +# else +# define CYTHON_NCP_UNUSED CYTHON_UNUSED +# endif +#endif +#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) +#ifdef _MSC_VER + #ifndef _MSC_STDINT_H_ + #if _MSC_VER < 1300 + typedef unsigned char uint8_t; + typedef unsigned int uint32_t; + #else + typedef unsigned __int8 uint8_t; + typedef unsigned __int32 uint32_t; + #endif + #endif +#else + #include +#endif +#ifndef CYTHON_FALLTHROUGH + #ifdef __cplusplus + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #elif __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) || (defined(__GNUC__) && defined(__attribute__)) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif + +#ifndef CYTHON_INLINE + #if defined(__clang__) + #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) + #elif defined(__GNUC__) + #define CYTHON_INLINE __inline__ + #elif defined(_MSC_VER) + #define CYTHON_INLINE __inline + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_INLINE inline + #else + #define CYTHON_INLINE + #endif +#endif + +#if defined(WIN32) || defined(MS_WINDOWS) + #define _USE_MATH_DEFINES +#endif +#include +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif +#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) +#define __Pyx_truncl trunc +#else +#define __Pyx_truncl truncl +#endif + + +#define __PYX_ERR(f_index, lineno, Ln_error) \ +{ \ + __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \ +} + +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif + +#ifndef __PYX_EXTERN_C + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#define __PYX_HAVE__ssh2__fileinfo +#define __PYX_HAVE_API__ssh2__fileinfo +#include +#include +#include +#include +#include "libssh2.h" +#include +#include +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#ifdef PYREX_WITHOUT_ASSERTIONS +#define CYTHON_WITHOUT_ASSERTIONS +#endif + +typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 +#define __PYX_DEFAULT_STRING_ENCODING "" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#define __Pyx_uchar_cast(c) ((unsigned char)c) +#define __Pyx_long_cast(x) ((long)x) +#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ + (sizeof(type) < sizeof(Py_ssize_t)) ||\ + (sizeof(type) > sizeof(Py_ssize_t) &&\ + likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX) &&\ + (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ + v == (type)PY_SSIZE_T_MIN))) ||\ + (sizeof(type) == sizeof(Py_ssize_t) &&\ + (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX))) ) +#if defined (__cplusplus) && __cplusplus >= 201103L + #include + #define __Pyx_sst_abs(value) std::abs(value) +#elif SIZEOF_INT >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) abs(value) +#elif SIZEOF_LONG >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) labs(value) +#elif defined (_MSC_VER) && defined (_M_X64) + #define __Pyx_sst_abs(value) _abs64(value) +#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define __Pyx_sst_abs(value) llabs(value) +#elif defined (__GNUC__) + #define __Pyx_sst_abs(value) __builtin_llabs(value) +#else + #define __Pyx_sst_abs(value) ((value<0) ? -value : value) +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) +#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) +#define __Pyx_PyBytes_FromString PyBytes_FromString +#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) +#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) +#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) +#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) +#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) +#if PY_MAJOR_VERSION < 3 +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) +{ + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#else +#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen +#endif +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) +#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) +#define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False)) +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +#if CYTHON_ASSUME_SAFE_MACROS +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) +#else +#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) +#endif +#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x)) +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + const char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + if (strcmp(default_encoding_c, "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (!ascii_chars_u) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + Py_DECREF(ascii_chars_u); + Py_DECREF(ascii_chars_b); + } + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); + if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + return -1; +} +#endif +#endif + + +/* Test for GCC > 2.95 */ +#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) +#else /* !__GNUC__ or GCC < 2.95 */ + #define likely(x) (x) + #define unlikely(x) (x) +#endif /* __GNUC__ */ +static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } + +static PyObject *__pyx_m; +static PyObject *__pyx_d; +static PyObject *__pyx_b; +static PyObject *__pyx_cython_runtime; +static PyObject *__pyx_empty_tuple; +static PyObject *__pyx_empty_bytes; +static PyObject *__pyx_empty_unicode; +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm= __FILE__; +static const char *__pyx_filename; + + +static const char *__pyx_f[] = { + "ssh2/fileinfo.pyx", + "stringsource", +}; + +/*--- Type declarations ---*/ +struct __pyx_obj_4ssh2_8fileinfo_FileInfo; + +/* "ssh2/fileinfo.pxd":3 + * cimport c_ssh2 + * + * cdef class FileInfo: # <<<<<<<<<<<<<< + * """Representation of stat structure""" + * cdef c_ssh2.libssh2_struct_stat* _stat + */ +struct __pyx_obj_4ssh2_8fileinfo_FileInfo { + PyObject_HEAD + libssh2_struct_stat *_stat; +}; + + +/* --- Runtime support code (head) --- */ +/* Refnanny.proto */ +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, int); + void (*DECREF)(void*, PyObject*, int); + void (*GOTREF)(void*, PyObject*, int); + void (*GIVEREF)(void*, PyObject*, int); + void* (*SetupContext)(const char*, int, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + if (acquire_gil) {\ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + PyGILState_Release(__pyx_gilstate_save);\ + } else {\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) +#endif + #define __Pyx_RefNannyFinishContext()\ + __Pyx_RefNanny->FinishContext(&__pyx_refnanny) + #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #define __Pyx_RefNannyFinishContext() + #define __Pyx_INCREF(r) Py_INCREF(r) + #define __Pyx_DECREF(r) Py_DECREF(r) + #define __Pyx_GOTREF(r) + #define __Pyx_GIVEREF(r) + #define __Pyx_XINCREF(r) Py_XINCREF(r) + #define __Pyx_XDECREF(r) Py_XDECREF(r) + #define __Pyx_XGOTREF(r) + #define __Pyx_XGIVEREF(r) +#endif +#define __Pyx_XDECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_XDECREF(tmp);\ + } while (0) +#define __Pyx_DECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_DECREF(tmp);\ + } while (0) +#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) +#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) + +/* PyObjectGetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +/* GetBuiltinName.proto */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name); + +/* RaiseArgTupleInvalid.proto */ +static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, + Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); + +/* KeywordStringCheck.proto */ +static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed); + +/* NoFastGil.proto */ +#define __Pyx_PyGILState_Ensure PyGILState_Ensure +#define __Pyx_PyGILState_Release PyGILState_Release +#define __Pyx_FastGIL_Remember() +#define __Pyx_FastGIL_Forget() +#define __Pyx_FastGilFuncInit() + +/* ForceInitThreads.proto */ +#ifndef __PYX_FORCE_INIT_THREADS + #define __PYX_FORCE_INIT_THREADS 0 +#endif + +/* PyObjectCall.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + +/* PyThreadStateGet.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; +#define __Pyx_PyThreadState_assign __pyx_tstate = PyThreadState_GET(); +#else +#define __Pyx_PyThreadState_declare +#define __Pyx_PyThreadState_assign +#endif + +/* PyErrFetchRestore.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#else +#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) +#endif + +/* RaiseException.proto */ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); + +/* SetupReduce.proto */ +static int __Pyx_setup_reduce(PyObject* type_obj); + +/* CLineInTraceback.proto */ +static int __Pyx_CLineForTraceback(int c_line); + +/* CodeObjectCache.proto */ +typedef struct { + PyCodeObject* code_object; + int code_line; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); + +/* AddTraceback.proto */ +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_ino_t(ino_t value); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_long(unsigned long value); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_nlink_t(nlink_t value); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uid_t(uid_t value); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_gid_t(gid_t value); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_dev_t(dev_t value); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint64_t(uint64_t value); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_blksize_t(blksize_t value); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_blkcnt_t(blkcnt_t value); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_time_t(time_t value); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +/* CIntFromPy.proto */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +/* CIntFromPy.proto */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +/* CheckBinaryVersion.proto */ +static int __Pyx_check_binary_version(void); + +/* InitStrings.proto */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); + + +/* Module declarations from 'libc.stdint' */ + +/* Module declarations from 'libc.stddef' */ + +/* Module declarations from 'libc.time' */ + +/* Module declarations from 'posix.types' */ + +/* Module declarations from 'ssh2.c_ssh2' */ + +/* Module declarations from 'libc.string' */ + +/* Module declarations from 'libc.stdlib' */ + +/* Module declarations from 'ssh2.fileinfo' */ +static PyTypeObject *__pyx_ptype_4ssh2_8fileinfo_FileInfo = 0; +#define __Pyx_MODULE_NAME "ssh2.fileinfo" +int __pyx_module_is_main_ssh2__fileinfo = 0; + +/* Implementation of 'ssh2.fileinfo' */ +static PyObject *__pyx_builtin_MemoryError; +static PyObject *__pyx_builtin_TypeError; +static const char __pyx_k_main[] = "__main__"; +static const char __pyx_k_test[] = "__test__"; +static const char __pyx_k_TypeError[] = "TypeError"; +static const char __pyx_k_MemoryError[] = "MemoryError"; +static const char __pyx_k_reduce_cython[] = "__reduce_cython__"; +static const char __pyx_k_setstate_cython[] = "__setstate_cython__"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; +static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__"; +static PyObject *__pyx_n_s_MemoryError; +static PyObject *__pyx_n_s_TypeError; +static PyObject *__pyx_n_s_cline_in_traceback; +static PyObject *__pyx_n_s_main; +static PyObject *__pyx_kp_s_no_default___reduce___due_to_non; +static PyObject *__pyx_n_s_reduce_cython; +static PyObject *__pyx_n_s_setstate_cython; +static PyObject *__pyx_n_s_test; +static int __pyx_pf_4ssh2_8fileinfo_8FileInfo___cinit__(struct __pyx_obj_4ssh2_8fileinfo_FileInfo *__pyx_v_self); /* proto */ +static void __pyx_pf_4ssh2_8fileinfo_8FileInfo_2__dealloc__(struct __pyx_obj_4ssh2_8fileinfo_FileInfo *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4ssh2_8fileinfo_8FileInfo_6st_ino___get__(struct __pyx_obj_4ssh2_8fileinfo_FileInfo *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4ssh2_8fileinfo_8FileInfo_7st_mode___get__(struct __pyx_obj_4ssh2_8fileinfo_FileInfo *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4ssh2_8fileinfo_8FileInfo_8st_nlink___get__(struct __pyx_obj_4ssh2_8fileinfo_FileInfo *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4ssh2_8fileinfo_8FileInfo_6st_uid___get__(struct __pyx_obj_4ssh2_8fileinfo_FileInfo *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4ssh2_8fileinfo_8FileInfo_6st_gid___get__(struct __pyx_obj_4ssh2_8fileinfo_FileInfo *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4ssh2_8fileinfo_8FileInfo_7st_rdev___get__(struct __pyx_obj_4ssh2_8fileinfo_FileInfo *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4ssh2_8fileinfo_8FileInfo_7st_size___get__(struct __pyx_obj_4ssh2_8fileinfo_FileInfo *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4ssh2_8fileinfo_8FileInfo_10st_blksize___get__(struct __pyx_obj_4ssh2_8fileinfo_FileInfo *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4ssh2_8fileinfo_8FileInfo_9st_blocks___get__(struct __pyx_obj_4ssh2_8fileinfo_FileInfo *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4ssh2_8fileinfo_8FileInfo_8st_atime___get__(struct __pyx_obj_4ssh2_8fileinfo_FileInfo *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4ssh2_8fileinfo_8FileInfo_8st_mtime___get__(struct __pyx_obj_4ssh2_8fileinfo_FileInfo *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4ssh2_8fileinfo_8FileInfo_8st_ctime___get__(struct __pyx_obj_4ssh2_8fileinfo_FileInfo *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4ssh2_8fileinfo_8FileInfo_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_4ssh2_8fileinfo_FileInfo *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4ssh2_8fileinfo_8FileInfo_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_4ssh2_8fileinfo_FileInfo *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ +static PyObject *__pyx_tp_new_4ssh2_8fileinfo_FileInfo(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tuple_; +static PyObject *__pyx_tuple__2; + +/* "ssh2/fileinfo.pyx":25 + * """Representation of stat structure""" + * + * def __cinit__(self): # <<<<<<<<<<<<<< + * with nogil: + * self._stat = malloc( + */ + +/* Python wrapper */ +static int __pyx_pw_4ssh2_8fileinfo_8FileInfo_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_4ssh2_8fileinfo_8FileInfo_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} + if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; + __pyx_r = __pyx_pf_4ssh2_8fileinfo_8FileInfo___cinit__(((struct __pyx_obj_4ssh2_8fileinfo_FileInfo *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_4ssh2_8fileinfo_8FileInfo___cinit__(struct __pyx_obj_4ssh2_8fileinfo_FileInfo *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("__cinit__", 0); + + /* "ssh2/fileinfo.pyx":26 + * + * def __cinit__(self): + * with nogil: # <<<<<<<<<<<<<< + * self._stat = malloc( + * sizeof(c_ssh2.libssh2_struct_stat)) + */ + { + #ifdef WITH_THREAD + PyThreadState *_save; + Py_UNBLOCK_THREADS + __Pyx_FastGIL_Remember(); + #endif + /*try:*/ { + + /* "ssh2/fileinfo.pyx":27 + * def __cinit__(self): + * with nogil: + * self._stat = malloc( # <<<<<<<<<<<<<< + * sizeof(c_ssh2.libssh2_struct_stat)) + * if self._stat is NULL: + */ + __pyx_v_self->_stat = ((libssh2_struct_stat *)malloc((sizeof(libssh2_struct_stat)))); + + /* "ssh2/fileinfo.pyx":29 + * self._stat = malloc( + * sizeof(c_ssh2.libssh2_struct_stat)) + * if self._stat is NULL: # <<<<<<<<<<<<<< + * with gil: + * raise MemoryError + */ + __pyx_t_1 = ((__pyx_v_self->_stat == NULL) != 0); + if (__pyx_t_1) { + + /* "ssh2/fileinfo.pyx":30 + * sizeof(c_ssh2.libssh2_struct_stat)) + * if self._stat is NULL: + * with gil: # <<<<<<<<<<<<<< + * raise MemoryError + * + */ + { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + /*try:*/ { + + /* "ssh2/fileinfo.pyx":31 + * if self._stat is NULL: + * with gil: + * raise MemoryError # <<<<<<<<<<<<<< + * + * def __dealloc__(self): + */ + PyErr_NoMemory(); __PYX_ERR(0, 31, __pyx_L8_error) + } + + /* "ssh2/fileinfo.pyx":30 + * sizeof(c_ssh2.libssh2_struct_stat)) + * if self._stat is NULL: + * with gil: # <<<<<<<<<<<<<< + * raise MemoryError + * + */ + /*finally:*/ { + __pyx_L8_error: { + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + goto __pyx_L4_error; + } + } + } + + /* "ssh2/fileinfo.pyx":29 + * self._stat = malloc( + * sizeof(c_ssh2.libssh2_struct_stat)) + * if self._stat is NULL: # <<<<<<<<<<<<<< + * with gil: + * raise MemoryError + */ + } + } + + /* "ssh2/fileinfo.pyx":26 + * + * def __cinit__(self): + * with nogil: # <<<<<<<<<<<<<< + * self._stat = malloc( + * sizeof(c_ssh2.libssh2_struct_stat)) + */ + /*finally:*/ { + /*normal exit:*/{ + #ifdef WITH_THREAD + __Pyx_FastGIL_Forget(); + Py_BLOCK_THREADS + #endif + goto __pyx_L5; + } + __pyx_L4_error: { + #ifdef WITH_THREAD + __Pyx_FastGIL_Forget(); + Py_BLOCK_THREADS + #endif + goto __pyx_L1_error; + } + __pyx_L5:; + } + } + + /* "ssh2/fileinfo.pyx":25 + * """Representation of stat structure""" + * + * def __cinit__(self): # <<<<<<<<<<<<<< + * with nogil: + * self._stat = malloc( + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("ssh2.fileinfo.FileInfo.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "ssh2/fileinfo.pyx":33 + * raise MemoryError + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * free(self._stat) + * + */ + +/* Python wrapper */ +static void __pyx_pw_4ssh2_8fileinfo_8FileInfo_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_pw_4ssh2_8fileinfo_8FileInfo_3__dealloc__(PyObject *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); + __pyx_pf_4ssh2_8fileinfo_8FileInfo_2__dealloc__(((struct __pyx_obj_4ssh2_8fileinfo_FileInfo *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_pf_4ssh2_8fileinfo_8FileInfo_2__dealloc__(struct __pyx_obj_4ssh2_8fileinfo_FileInfo *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__", 0); + + /* "ssh2/fileinfo.pyx":34 + * + * def __dealloc__(self): + * free(self._stat) # <<<<<<<<<<<<<< + * + * @property + */ + free(__pyx_v_self->_stat); + + /* "ssh2/fileinfo.pyx":33 + * raise MemoryError + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * free(self._stat) + * + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "ssh2/fileinfo.pyx":37 + * + * @property + * def st_ino(self): # <<<<<<<<<<<<<< + * return self._stat.st_ino + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4ssh2_8fileinfo_8FileInfo_6st_ino_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_4ssh2_8fileinfo_8FileInfo_6st_ino_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_4ssh2_8fileinfo_8FileInfo_6st_ino___get__(((struct __pyx_obj_4ssh2_8fileinfo_FileInfo *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4ssh2_8fileinfo_8FileInfo_6st_ino___get__(struct __pyx_obj_4ssh2_8fileinfo_FileInfo *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "ssh2/fileinfo.pyx":38 + * @property + * def st_ino(self): + * return self._stat.st_ino # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_ino_t(__pyx_v_self->_stat->st_ino); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 38, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "ssh2/fileinfo.pyx":37 + * + * @property + * def st_ino(self): # <<<<<<<<<<<<<< + * return self._stat.st_ino + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("ssh2.fileinfo.FileInfo.st_ino.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "ssh2/fileinfo.pyx":41 + * + * @property + * def st_mode(self): # <<<<<<<<<<<<<< + * return self._stat.st_mode + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4ssh2_8fileinfo_8FileInfo_7st_mode_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_4ssh2_8fileinfo_8FileInfo_7st_mode_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_4ssh2_8fileinfo_8FileInfo_7st_mode___get__(((struct __pyx_obj_4ssh2_8fileinfo_FileInfo *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4ssh2_8fileinfo_8FileInfo_7st_mode___get__(struct __pyx_obj_4ssh2_8fileinfo_FileInfo *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "ssh2/fileinfo.pyx":42 + * @property + * def st_mode(self): + * return self._stat.st_mode # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_unsigned_long(__pyx_v_self->_stat->st_mode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 42, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "ssh2/fileinfo.pyx":41 + * + * @property + * def st_mode(self): # <<<<<<<<<<<<<< + * return self._stat.st_mode + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("ssh2.fileinfo.FileInfo.st_mode.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "ssh2/fileinfo.pyx":45 + * + * @property + * def st_nlink(self): # <<<<<<<<<<<<<< + * return self._stat.st_nlink + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4ssh2_8fileinfo_8FileInfo_8st_nlink_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_4ssh2_8fileinfo_8FileInfo_8st_nlink_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_4ssh2_8fileinfo_8FileInfo_8st_nlink___get__(((struct __pyx_obj_4ssh2_8fileinfo_FileInfo *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4ssh2_8fileinfo_8FileInfo_8st_nlink___get__(struct __pyx_obj_4ssh2_8fileinfo_FileInfo *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "ssh2/fileinfo.pyx":46 + * @property + * def st_nlink(self): + * return self._stat.st_nlink # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_nlink_t(__pyx_v_self->_stat->st_nlink); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 46, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "ssh2/fileinfo.pyx":45 + * + * @property + * def st_nlink(self): # <<<<<<<<<<<<<< + * return self._stat.st_nlink + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("ssh2.fileinfo.FileInfo.st_nlink.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "ssh2/fileinfo.pyx":49 + * + * @property + * def st_uid(self): # <<<<<<<<<<<<<< + * return self._stat.st_uid + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4ssh2_8fileinfo_8FileInfo_6st_uid_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_4ssh2_8fileinfo_8FileInfo_6st_uid_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_4ssh2_8fileinfo_8FileInfo_6st_uid___get__(((struct __pyx_obj_4ssh2_8fileinfo_FileInfo *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4ssh2_8fileinfo_8FileInfo_6st_uid___get__(struct __pyx_obj_4ssh2_8fileinfo_FileInfo *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "ssh2/fileinfo.pyx":50 + * @property + * def st_uid(self): + * return self._stat.st_uid # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_uid_t(__pyx_v_self->_stat->st_uid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 50, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "ssh2/fileinfo.pyx":49 + * + * @property + * def st_uid(self): # <<<<<<<<<<<<<< + * return self._stat.st_uid + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("ssh2.fileinfo.FileInfo.st_uid.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "ssh2/fileinfo.pyx":53 + * + * @property + * def st_gid(self): # <<<<<<<<<<<<<< + * return self._stat.st_gid + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4ssh2_8fileinfo_8FileInfo_6st_gid_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_4ssh2_8fileinfo_8FileInfo_6st_gid_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_4ssh2_8fileinfo_8FileInfo_6st_gid___get__(((struct __pyx_obj_4ssh2_8fileinfo_FileInfo *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4ssh2_8fileinfo_8FileInfo_6st_gid___get__(struct __pyx_obj_4ssh2_8fileinfo_FileInfo *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "ssh2/fileinfo.pyx":54 + * @property + * def st_gid(self): + * return self._stat.st_gid # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_gid_t(__pyx_v_self->_stat->st_gid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 54, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "ssh2/fileinfo.pyx":53 + * + * @property + * def st_gid(self): # <<<<<<<<<<<<<< + * return self._stat.st_gid + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("ssh2.fileinfo.FileInfo.st_gid.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "ssh2/fileinfo.pyx":57 + * + * @property + * def st_rdev(self): # <<<<<<<<<<<<<< + * return self._stat.st_rdev + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4ssh2_8fileinfo_8FileInfo_7st_rdev_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_4ssh2_8fileinfo_8FileInfo_7st_rdev_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_4ssh2_8fileinfo_8FileInfo_7st_rdev___get__(((struct __pyx_obj_4ssh2_8fileinfo_FileInfo *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4ssh2_8fileinfo_8FileInfo_7st_rdev___get__(struct __pyx_obj_4ssh2_8fileinfo_FileInfo *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "ssh2/fileinfo.pyx":58 + * @property + * def st_rdev(self): + * return self._stat.st_rdev # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_dev_t(__pyx_v_self->_stat->st_rdev); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 58, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "ssh2/fileinfo.pyx":57 + * + * @property + * def st_rdev(self): # <<<<<<<<<<<<<< + * return self._stat.st_rdev + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("ssh2.fileinfo.FileInfo.st_rdev.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "ssh2/fileinfo.pyx":61 + * + * @property + * def st_size(self): # <<<<<<<<<<<<<< + * return self._stat.st_size + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4ssh2_8fileinfo_8FileInfo_7st_size_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_4ssh2_8fileinfo_8FileInfo_7st_size_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_4ssh2_8fileinfo_8FileInfo_7st_size___get__(((struct __pyx_obj_4ssh2_8fileinfo_FileInfo *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4ssh2_8fileinfo_8FileInfo_7st_size___get__(struct __pyx_obj_4ssh2_8fileinfo_FileInfo *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "ssh2/fileinfo.pyx":62 + * @property + * def st_size(self): + * return self._stat.st_size # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_uint64_t(__pyx_v_self->_stat->st_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 62, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "ssh2/fileinfo.pyx":61 + * + * @property + * def st_size(self): # <<<<<<<<<<<<<< + * return self._stat.st_size + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("ssh2.fileinfo.FileInfo.st_size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "ssh2/fileinfo.pyx":65 + * + * @property + * def st_blksize(self): # <<<<<<<<<<<<<< + * return self._stat.st_blksize + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4ssh2_8fileinfo_8FileInfo_10st_blksize_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_4ssh2_8fileinfo_8FileInfo_10st_blksize_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_4ssh2_8fileinfo_8FileInfo_10st_blksize___get__(((struct __pyx_obj_4ssh2_8fileinfo_FileInfo *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4ssh2_8fileinfo_8FileInfo_10st_blksize___get__(struct __pyx_obj_4ssh2_8fileinfo_FileInfo *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "ssh2/fileinfo.pyx":66 + * @property + * def st_blksize(self): + * return self._stat.st_blksize # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_blksize_t(__pyx_v_self->_stat->st_blksize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 66, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "ssh2/fileinfo.pyx":65 + * + * @property + * def st_blksize(self): # <<<<<<<<<<<<<< + * return self._stat.st_blksize + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("ssh2.fileinfo.FileInfo.st_blksize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "ssh2/fileinfo.pyx":69 + * + * @property + * def st_blocks(self): # <<<<<<<<<<<<<< + * return self._stat.st_blocks + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4ssh2_8fileinfo_8FileInfo_9st_blocks_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_4ssh2_8fileinfo_8FileInfo_9st_blocks_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_4ssh2_8fileinfo_8FileInfo_9st_blocks___get__(((struct __pyx_obj_4ssh2_8fileinfo_FileInfo *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4ssh2_8fileinfo_8FileInfo_9st_blocks___get__(struct __pyx_obj_4ssh2_8fileinfo_FileInfo *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "ssh2/fileinfo.pyx":70 + * @property + * def st_blocks(self): + * return self._stat.st_blocks # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_blkcnt_t(__pyx_v_self->_stat->st_blocks); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 70, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "ssh2/fileinfo.pyx":69 + * + * @property + * def st_blocks(self): # <<<<<<<<<<<<<< + * return self._stat.st_blocks + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("ssh2.fileinfo.FileInfo.st_blocks.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "ssh2/fileinfo.pyx":73 + * + * @property + * def st_atime(self): # <<<<<<<<<<<<<< + * return self._stat.st_atime + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4ssh2_8fileinfo_8FileInfo_8st_atime_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_4ssh2_8fileinfo_8FileInfo_8st_atime_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_4ssh2_8fileinfo_8FileInfo_8st_atime___get__(((struct __pyx_obj_4ssh2_8fileinfo_FileInfo *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4ssh2_8fileinfo_8FileInfo_8st_atime___get__(struct __pyx_obj_4ssh2_8fileinfo_FileInfo *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "ssh2/fileinfo.pyx":74 + * @property + * def st_atime(self): + * return self._stat.st_atime # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_time_t(__pyx_v_self->_stat->st_atime); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 74, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "ssh2/fileinfo.pyx":73 + * + * @property + * def st_atime(self): # <<<<<<<<<<<<<< + * return self._stat.st_atime + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("ssh2.fileinfo.FileInfo.st_atime.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "ssh2/fileinfo.pyx":77 + * + * @property + * def st_mtime(self): # <<<<<<<<<<<<<< + * return self._stat.st_mtime + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4ssh2_8fileinfo_8FileInfo_8st_mtime_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_4ssh2_8fileinfo_8FileInfo_8st_mtime_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_4ssh2_8fileinfo_8FileInfo_8st_mtime___get__(((struct __pyx_obj_4ssh2_8fileinfo_FileInfo *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4ssh2_8fileinfo_8FileInfo_8st_mtime___get__(struct __pyx_obj_4ssh2_8fileinfo_FileInfo *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "ssh2/fileinfo.pyx":78 + * @property + * def st_mtime(self): + * return self._stat.st_mtime # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_time_t(__pyx_v_self->_stat->st_mtime); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 78, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "ssh2/fileinfo.pyx":77 + * + * @property + * def st_mtime(self): # <<<<<<<<<<<<<< + * return self._stat.st_mtime + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("ssh2.fileinfo.FileInfo.st_mtime.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "ssh2/fileinfo.pyx":81 + * + * @property + * def st_ctime(self): # <<<<<<<<<<<<<< + * return self._stat.st_ctime + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4ssh2_8fileinfo_8FileInfo_8st_ctime_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_4ssh2_8fileinfo_8FileInfo_8st_ctime_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_4ssh2_8fileinfo_8FileInfo_8st_ctime___get__(((struct __pyx_obj_4ssh2_8fileinfo_FileInfo *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4ssh2_8fileinfo_8FileInfo_8st_ctime___get__(struct __pyx_obj_4ssh2_8fileinfo_FileInfo *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "ssh2/fileinfo.pyx":82 + * @property + * def st_ctime(self): + * return self._stat.st_ctime # <<<<<<<<<<<<<< + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_time_t(__pyx_v_self->_stat->st_ctime); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 82, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "ssh2/fileinfo.pyx":81 + * + * @property + * def st_ctime(self): # <<<<<<<<<<<<<< + * return self._stat.st_ctime + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("ssh2.fileinfo.FileInfo.st_ctime.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4ssh2_8fileinfo_8FileInfo_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_4ssh2_8fileinfo_8FileInfo_4__reduce_cython__[] = "FileInfo.__reduce_cython__(self)"; +static PyObject *__pyx_pw_4ssh2_8fileinfo_8FileInfo_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_4ssh2_8fileinfo_8FileInfo_4__reduce_cython__(((struct __pyx_obj_4ssh2_8fileinfo_FileInfo *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4ssh2_8fileinfo_8FileInfo_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_4ssh2_8fileinfo_FileInfo *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__reduce_cython__", 0); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(1, 2, __pyx_L1_error) + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("ssh2.fileinfo.FileInfo.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4ssh2_8fileinfo_8FileInfo_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static char __pyx_doc_4ssh2_8fileinfo_8FileInfo_6__setstate_cython__[] = "FileInfo.__setstate_cython__(self, __pyx_state)"; +static PyObject *__pyx_pw_4ssh2_8fileinfo_8FileInfo_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_4ssh2_8fileinfo_8FileInfo_6__setstate_cython__(((struct __pyx_obj_4ssh2_8fileinfo_FileInfo *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4ssh2_8fileinfo_8FileInfo_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_4ssh2_8fileinfo_FileInfo *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__setstate_cython__", 0); + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(1, 4, __pyx_L1_error) + + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("ssh2.fileinfo.FileInfo.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_tp_new_4ssh2_8fileinfo_FileInfo(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + if (unlikely(__pyx_pw_4ssh2_8fileinfo_8FileInfo_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; + return o; + bad: + Py_DECREF(o); o = 0; + return NULL; +} + +static void __pyx_tp_dealloc_4ssh2_8fileinfo_FileInfo(PyObject *o) { + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + ++Py_REFCNT(o); + __pyx_pw_4ssh2_8fileinfo_8FileInfo_3__dealloc__(o); + --Py_REFCNT(o); + PyErr_Restore(etype, eval, etb); + } + (*Py_TYPE(o)->tp_free)(o); +} + +static PyObject *__pyx_getprop_4ssh2_8fileinfo_8FileInfo_st_ino(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_4ssh2_8fileinfo_8FileInfo_6st_ino_1__get__(o); +} + +static PyObject *__pyx_getprop_4ssh2_8fileinfo_8FileInfo_st_mode(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_4ssh2_8fileinfo_8FileInfo_7st_mode_1__get__(o); +} + +static PyObject *__pyx_getprop_4ssh2_8fileinfo_8FileInfo_st_nlink(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_4ssh2_8fileinfo_8FileInfo_8st_nlink_1__get__(o); +} + +static PyObject *__pyx_getprop_4ssh2_8fileinfo_8FileInfo_st_uid(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_4ssh2_8fileinfo_8FileInfo_6st_uid_1__get__(o); +} + +static PyObject *__pyx_getprop_4ssh2_8fileinfo_8FileInfo_st_gid(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_4ssh2_8fileinfo_8FileInfo_6st_gid_1__get__(o); +} + +static PyObject *__pyx_getprop_4ssh2_8fileinfo_8FileInfo_st_rdev(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_4ssh2_8fileinfo_8FileInfo_7st_rdev_1__get__(o); +} + +static PyObject *__pyx_getprop_4ssh2_8fileinfo_8FileInfo_st_size(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_4ssh2_8fileinfo_8FileInfo_7st_size_1__get__(o); +} + +static PyObject *__pyx_getprop_4ssh2_8fileinfo_8FileInfo_st_blksize(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_4ssh2_8fileinfo_8FileInfo_10st_blksize_1__get__(o); +} + +static PyObject *__pyx_getprop_4ssh2_8fileinfo_8FileInfo_st_blocks(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_4ssh2_8fileinfo_8FileInfo_9st_blocks_1__get__(o); +} + +static PyObject *__pyx_getprop_4ssh2_8fileinfo_8FileInfo_st_atime(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_4ssh2_8fileinfo_8FileInfo_8st_atime_1__get__(o); +} + +static PyObject *__pyx_getprop_4ssh2_8fileinfo_8FileInfo_st_mtime(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_4ssh2_8fileinfo_8FileInfo_8st_mtime_1__get__(o); +} + +static PyObject *__pyx_getprop_4ssh2_8fileinfo_8FileInfo_st_ctime(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_4ssh2_8fileinfo_8FileInfo_8st_ctime_1__get__(o); +} + +static PyMethodDef __pyx_methods_4ssh2_8fileinfo_FileInfo[] = { + {"__reduce_cython__", (PyCFunction)__pyx_pw_4ssh2_8fileinfo_8FileInfo_5__reduce_cython__, METH_NOARGS, __pyx_doc_4ssh2_8fileinfo_8FileInfo_4__reduce_cython__}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_4ssh2_8fileinfo_8FileInfo_7__setstate_cython__, METH_O, __pyx_doc_4ssh2_8fileinfo_8FileInfo_6__setstate_cython__}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_4ssh2_8fileinfo_FileInfo[] = { + {(char *)"st_ino", __pyx_getprop_4ssh2_8fileinfo_8FileInfo_st_ino, 0, (char *)0, 0}, + {(char *)"st_mode", __pyx_getprop_4ssh2_8fileinfo_8FileInfo_st_mode, 0, (char *)0, 0}, + {(char *)"st_nlink", __pyx_getprop_4ssh2_8fileinfo_8FileInfo_st_nlink, 0, (char *)0, 0}, + {(char *)"st_uid", __pyx_getprop_4ssh2_8fileinfo_8FileInfo_st_uid, 0, (char *)0, 0}, + {(char *)"st_gid", __pyx_getprop_4ssh2_8fileinfo_8FileInfo_st_gid, 0, (char *)0, 0}, + {(char *)"st_rdev", __pyx_getprop_4ssh2_8fileinfo_8FileInfo_st_rdev, 0, (char *)0, 0}, + {(char *)"st_size", __pyx_getprop_4ssh2_8fileinfo_8FileInfo_st_size, 0, (char *)0, 0}, + {(char *)"st_blksize", __pyx_getprop_4ssh2_8fileinfo_8FileInfo_st_blksize, 0, (char *)0, 0}, + {(char *)"st_blocks", __pyx_getprop_4ssh2_8fileinfo_8FileInfo_st_blocks, 0, (char *)0, 0}, + {(char *)"st_atime", __pyx_getprop_4ssh2_8fileinfo_8FileInfo_st_atime, 0, (char *)0, 0}, + {(char *)"st_mtime", __pyx_getprop_4ssh2_8fileinfo_8FileInfo_st_mtime, 0, (char *)0, 0}, + {(char *)"st_ctime", __pyx_getprop_4ssh2_8fileinfo_8FileInfo_st_ctime, 0, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_4ssh2_8fileinfo_FileInfo = { + PyVarObject_HEAD_INIT(0, 0) + "ssh2.fileinfo.FileInfo", /*tp_name*/ + sizeof(struct __pyx_obj_4ssh2_8fileinfo_FileInfo), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_4ssh2_8fileinfo_FileInfo, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + "Representation of stat structure", /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_4ssh2_8fileinfo_FileInfo, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_4ssh2_8fileinfo_FileInfo, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_4ssh2_8fileinfo_FileInfo, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyMethodDef __pyx_methods[] = { + {0, 0, 0, 0} +}; + +#if PY_MAJOR_VERSION >= 3 +static struct PyModuleDef __pyx_moduledef = { + #if PY_VERSION_HEX < 0x03020000 + { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, + #else + PyModuleDef_HEAD_INIT, + #endif + "fileinfo", + 0, /* m_doc */ + -1, /* m_size */ + __pyx_methods /* m_methods */, + NULL, /* m_reload */ + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ +}; +#endif + +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1}, + {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, + {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0}, + {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1}, + {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} +}; +static int __Pyx_InitCachedBuiltins(void) { + __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(0, 31, __pyx_L1_error) + __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} + +static int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple_)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple_); + __Pyx_GIVEREF(__pyx_tuple_); + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2); + __Pyx_GIVEREF(__pyx_tuple__2); + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_InitGlobals(void) { + if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + return 0; + __pyx_L1_error:; + return -1; +} + +#if PY_MAJOR_VERSION < 3 +PyMODINIT_FUNC initfileinfo(void); /*proto*/ +PyMODINIT_FUNC initfileinfo(void) +#else +PyMODINIT_FUNC PyInit_fileinfo(void); /*proto*/ +PyMODINIT_FUNC PyInit_fileinfo(void) +#endif +{ + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannyDeclarations + #if CYTHON_REFNANNY + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); + if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); + } + #endif + __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_fileinfo(void)", 0); + if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pyx_CyFunction_USED + if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Coroutine_USED + if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_StopAsyncIteration_USED + if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + #ifdef WITH_THREAD /* Python build with threading support? */ + PyEval_InitThreads(); + #endif + #endif + /*--- Module creation code ---*/ + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4("fileinfo", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + #endif + if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_d); + __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) + #if CYTHON_COMPILING_IN_PYPY + Py_INCREF(__pyx_b); + #endif + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + /*--- Initialize various global constants etc. ---*/ + if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + if (__pyx_module_is_main_ssh2__fileinfo) { + if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) + if (!PyDict_GetItemString(modules, "ssh2.fileinfo")) { + if (unlikely(PyDict_SetItemString(modules, "ssh2.fileinfo", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error) + } + } + #endif + /*--- Builtin init code ---*/ + if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Constants init code ---*/ + if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Global init code ---*/ + /*--- Variable export code ---*/ + /*--- Function export code ---*/ + /*--- Type init code ---*/ + if (PyType_Ready(&__pyx_type_4ssh2_8fileinfo_FileInfo) < 0) __PYX_ERR(0, 22, __pyx_L1_error) + __pyx_type_4ssh2_8fileinfo_FileInfo.tp_print = 0; + if (PyObject_SetAttrString(__pyx_m, "FileInfo", (PyObject *)&__pyx_type_4ssh2_8fileinfo_FileInfo) < 0) __PYX_ERR(0, 22, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_4ssh2_8fileinfo_FileInfo) < 0) __PYX_ERR(0, 22, __pyx_L1_error) + __pyx_ptype_4ssh2_8fileinfo_FileInfo = &__pyx_type_4ssh2_8fileinfo_FileInfo; + /*--- Type import code ---*/ + /*--- Variable import code ---*/ + /*--- Function import code ---*/ + /*--- Execution code ---*/ + #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) + if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + + /* "ssh2/fileinfo.pyx":1 + * # This file is part of ssh2-python. # <<<<<<<<<<<<<< + * # Copyright (C) 2017 Panos Kittenis + * + */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /*--- Wrapped vars code ---*/ + + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + if (__pyx_m) { + if (__pyx_d) { + __Pyx_AddTraceback("init ssh2.fileinfo", 0, __pyx_lineno, __pyx_filename); + } + Py_DECREF(__pyx_m); __pyx_m = 0; + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init ssh2.fileinfo"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if PY_MAJOR_VERSION < 3 + return; + #else + return __pyx_m; + #endif +} + +/* --- Runtime support code --- */ +/* Refnanny */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule((char *)modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif + +/* GetBuiltinName */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); + if (unlikely(!result)) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +/* RaiseArgTupleInvalid */ +static void __Pyx_RaiseArgtupleInvalid( + const char* func_name, + int exact, + Py_ssize_t num_min, + Py_ssize_t num_max, + Py_ssize_t num_found) +{ + Py_ssize_t num_expected; + const char *more_or_less; + if (num_found < num_min) { + num_expected = num_min; + more_or_less = "at least"; + } else { + num_expected = num_max; + more_or_less = "at most"; + } + if (exact) { + more_or_less = "exactly"; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); +} + +/* KeywordStringCheck */ +static CYTHON_INLINE int __Pyx_CheckKeywordStrings( + PyObject *kwdict, + const char* function_name, + int kw_allowed) +{ + PyObject* key = 0; + Py_ssize_t pos = 0; +#if CYTHON_COMPILING_IN_PYPY + if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0)) + goto invalid_keyword; + return 1; +#else + while (PyDict_Next(kwdict, &pos, &key, 0)) { + #if PY_MAJOR_VERSION < 3 + if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) + #endif + if (unlikely(!PyUnicode_Check(key))) + goto invalid_keyword_type; + } + if ((!kw_allowed) && unlikely(key)) + goto invalid_keyword; + return 1; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + return 0; +#endif +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif + return 0; +} + +/* PyObjectCall */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = func->ob_type->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = (*call)(func, arg, kw); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyErrFetchRestore */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +} +#endif + +/* RaiseException */ +#if PY_MAJOR_VERSION < 3 +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, + CYTHON_UNUSED PyObject *cause) { + __Pyx_PyThreadState_declare + Py_XINCREF(type); + if (!value || value == Py_None) + value = NULL; + else + Py_INCREF(value); + if (!tb || tb == Py_None) + tb = NULL; + else { + Py_INCREF(tb); + if (!PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto raise_error; + } + } + if (PyType_Check(type)) { +#if CYTHON_COMPILING_IN_PYPY + if (!value) { + Py_INCREF(Py_None); + value = Py_None; + } +#endif + PyErr_NormalizeException(&type, &value, &tb); + } else { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto raise_error; + } + value = type; + type = (PyObject*) Py_TYPE(type); + Py_INCREF(type); + if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto raise_error; + } + } + __Pyx_PyThreadState_assign + __Pyx_ErrRestore(type, value, tb); + return; +raise_error: + Py_XDECREF(value); + Py_XDECREF(type); + Py_XDECREF(tb); + return; +} +#else +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { + PyObject* owned_instance = NULL; + if (tb == Py_None) { + tb = 0; + } else if (tb && !PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto bad; + } + if (value == Py_None) + value = 0; + if (PyExceptionInstance_Check(type)) { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto bad; + } + value = type; + type = (PyObject*) Py_TYPE(value); + } else if (PyExceptionClass_Check(type)) { + PyObject *instance_class = NULL; + if (value && PyExceptionInstance_Check(value)) { + instance_class = (PyObject*) Py_TYPE(value); + if (instance_class != type) { + int is_subclass = PyObject_IsSubclass(instance_class, type); + if (!is_subclass) { + instance_class = NULL; + } else if (unlikely(is_subclass == -1)) { + goto bad; + } else { + type = instance_class; + } + } + } + if (!instance_class) { + PyObject *args; + if (!value) + args = PyTuple_New(0); + else if (PyTuple_Check(value)) { + Py_INCREF(value); + args = value; + } else + args = PyTuple_Pack(1, value); + if (!args) + goto bad; + owned_instance = PyObject_Call(type, args, NULL); + Py_DECREF(args); + if (!owned_instance) + goto bad; + value = owned_instance; + if (!PyExceptionInstance_Check(value)) { + PyErr_Format(PyExc_TypeError, + "calling %R should have returned an instance of " + "BaseException, not %R", + type, Py_TYPE(value)); + goto bad; + } + } + } else { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto bad; + } +#if PY_VERSION_HEX >= 0x03030000 + if (cause) { +#else + if (cause && cause != Py_None) { +#endif + PyObject *fixed_cause; + if (cause == Py_None) { + fixed_cause = NULL; + } else if (PyExceptionClass_Check(cause)) { + fixed_cause = PyObject_CallObject(cause, NULL); + if (fixed_cause == NULL) + goto bad; + } else if (PyExceptionInstance_Check(cause)) { + fixed_cause = cause; + Py_INCREF(fixed_cause); + } else { + PyErr_SetString(PyExc_TypeError, + "exception causes must derive from " + "BaseException"); + goto bad; + } + PyException_SetCause(value, fixed_cause); + } + PyErr_SetObject(type, value); + if (tb) { +#if CYTHON_COMPILING_IN_PYPY + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); + Py_INCREF(tb); + PyErr_Restore(tmp_type, tmp_value, tb); + Py_XDECREF(tmp_tb); +#else + PyThreadState *tstate = PyThreadState_GET(); + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); + } +#endif + } +bad: + Py_XDECREF(owned_instance); + return; +} +#endif + +/* SetupReduce */ + #define __Pyx_setup_reduce_GET_ATTR_OR_BAD(res, obj, name) res = PyObject_GetAttrString(obj, name); if (res == NULL) goto BAD; +static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) { + int ret; + PyObject *name_attr; + name_attr = PyObject_GetAttrString(meth, "__name__"); + if (name_attr) { + ret = PyObject_RichCompareBool(name_attr, name, Py_EQ); + } else { + ret = -1; + } + if (ret < 0) { + PyErr_Clear(); + ret = 0; + } + Py_XDECREF(name_attr); + return ret; +} +static int __Pyx_setup_reduce(PyObject* type_obj) { + int ret = 0; + PyObject* builtin_object = NULL; + static PyObject *object_reduce = NULL; + static PyObject *object_reduce_ex = NULL; + PyObject *reduce = NULL; + PyObject *reduce_ex = NULL; + PyObject *reduce_cython = NULL; + PyObject *setstate = NULL; + PyObject *setstate_cython = NULL; + if (PyObject_HasAttrString(type_obj, "__getstate__")) goto GOOD; + if (object_reduce_ex == NULL) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(builtin_object, __pyx_b, "object"); + __Pyx_setup_reduce_GET_ATTR_OR_BAD(object_reduce, builtin_object, "__reduce__"); + __Pyx_setup_reduce_GET_ATTR_OR_BAD(object_reduce_ex, builtin_object, "__reduce_ex__"); + } + __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce_ex, type_obj, "__reduce_ex__"); + if (reduce_ex == object_reduce_ex) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce, type_obj, "__reduce__"); + if (object_reduce == reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce_cython, type_obj, "__reduce_cython__"); + ret = PyDict_SetItemString(((PyTypeObject*)type_obj)->tp_dict, "__reduce__", reduce_cython); if (ret < 0) goto BAD; + ret = PyDict_DelItemString(((PyTypeObject*)type_obj)->tp_dict, "__reduce_cython__"); if (ret < 0) goto BAD; + setstate = PyObject_GetAttrString(type_obj, "__setstate__"); + if (!setstate) PyErr_Clear(); + if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(setstate_cython, type_obj, "__setstate_cython__"); + ret = PyDict_SetItemString(((PyTypeObject*)type_obj)->tp_dict, "__setstate__", setstate_cython); if (ret < 0) goto BAD; + ret = PyDict_DelItemString(((PyTypeObject*)type_obj)->tp_dict, "__setstate_cython__"); if (ret < 0) goto BAD; + } + PyType_Modified((PyTypeObject*)type_obj); + } + } + goto GOOD; +BAD: + if (!PyErr_Occurred()) PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name); + ret = -1; +GOOD: + Py_XDECREF(builtin_object); + Py_XDECREF(reduce); + Py_XDECREF(reduce_ex); + Py_XDECREF(reduce_cython); + Py_XDECREF(setstate); + Py_XDECREF(setstate_cython); + return ret; +} + +/* CLineInTraceback */ + static int __Pyx_CLineForTraceback(int c_line) { +#ifdef CYTHON_CLINE_IN_TRACEBACK + return ((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0; +#else + PyObject **cython_runtime_dict; + PyObject *use_cline; + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (unlikely(!cython_runtime_dict)) { + PyObject *ptype, *pvalue, *ptraceback; + PyObject *use_cline_obj; + PyErr_Fetch(&ptype, &pvalue, &ptraceback); + use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); + if (use_cline_obj) { + use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; + Py_DECREF(use_cline_obj); + } else { + use_cline = NULL; + } + PyErr_Restore(ptype, pvalue, ptraceback); + } else { + use_cline = PyDict_GetItem(*_PyObject_GetDictPtr(__pyx_cython_runtime), __pyx_n_s_cline_in_traceback); + } + if (!use_cline) { + c_line = 0; + PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); + } + else if (PyObject_Not(use_cline) != 0) { + c_line = 0; + } + return c_line; +#endif +} + +/* CodeObjectCache */ + static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = start + (end - start) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} + +/* AddTraceback */ + #include "compile.h" +#include "frameobject.h" +#include "traceback.h" +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_srcfile = 0; + PyObject *py_funcname = 0; + #if PY_MAJOR_VERSION < 3 + py_srcfile = PyString_FromString(filename); + #else + py_srcfile = PyUnicode_FromString(filename); + #endif + if (!py_srcfile) goto bad; + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + #else + py_funcname = PyUnicode_FromString(funcname); + #endif + } + if (!py_funcname) goto bad; + py_code = __Pyx_PyCode_New( + 0, + 0, + 0, + 0, + 0, + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + Py_DECREF(py_funcname); + return py_code; +bad: + Py_XDECREF(py_srcfile); + Py_XDECREF(py_funcname); + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyFrameObject *py_frame = 0; + if (c_line) { + c_line = __Pyx_CLineForTraceback(c_line); + } + py_code = __pyx_find_code_object(c_line ? -c_line : py_line); + if (!py_code) { + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) goto bad; + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); + } + py_frame = PyFrame_New( + PyThreadState_GET(), /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + __pyx_d, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + __Pyx_PyFrame_SetLineNumber(py_frame, py_line); + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} + +/* CIntToPy */ + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_ino_t(ino_t value) { + const ino_t neg_one = (ino_t) -1, const_zero = (ino_t) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(ino_t) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(ino_t) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(ino_t) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(ino_t) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(ino_t) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(ino_t), + little, !is_unsigned); + } +} + +/* CIntToPy */ + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_long(unsigned long value) { + const unsigned long neg_one = (unsigned long) -1, const_zero = (unsigned long) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(unsigned long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(unsigned long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(unsigned long) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(unsigned long) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(unsigned long) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(unsigned long), + little, !is_unsigned); + } +} + +/* CIntToPy */ + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_nlink_t(nlink_t value) { + const nlink_t neg_one = (nlink_t) -1, const_zero = (nlink_t) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(nlink_t) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(nlink_t) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(nlink_t) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(nlink_t) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(nlink_t) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(nlink_t), + little, !is_unsigned); + } +} + +/* CIntToPy */ + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uid_t(uid_t value) { + const uid_t neg_one = (uid_t) -1, const_zero = (uid_t) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(uid_t) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(uid_t) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(uid_t) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(uid_t) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(uid_t) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(uid_t), + little, !is_unsigned); + } +} + +/* CIntToPy */ + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_gid_t(gid_t value) { + const gid_t neg_one = (gid_t) -1, const_zero = (gid_t) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(gid_t) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(gid_t) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(gid_t) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(gid_t) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(gid_t) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(gid_t), + little, !is_unsigned); + } +} + +/* CIntToPy */ + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_dev_t(dev_t value) { + const dev_t neg_one = (dev_t) -1, const_zero = (dev_t) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(dev_t) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(dev_t) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(dev_t) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(dev_t) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(dev_t) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(dev_t), + little, !is_unsigned); + } +} + +/* CIntToPy */ + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint64_t(uint64_t value) { + const uint64_t neg_one = (uint64_t) -1, const_zero = (uint64_t) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(uint64_t) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(uint64_t) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(uint64_t) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(uint64_t) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(uint64_t) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(uint64_t), + little, !is_unsigned); + } +} + +/* CIntToPy */ + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_blksize_t(blksize_t value) { + const blksize_t neg_one = (blksize_t) -1, const_zero = (blksize_t) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(blksize_t) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(blksize_t) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(blksize_t) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(blksize_t) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(blksize_t) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(blksize_t), + little, !is_unsigned); + } +} + +/* CIntToPy */ + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_blkcnt_t(blkcnt_t value) { + const blkcnt_t neg_one = (blkcnt_t) -1, const_zero = (blkcnt_t) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(blkcnt_t) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(blkcnt_t) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(blkcnt_t) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(blkcnt_t) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(blkcnt_t) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(blkcnt_t), + little, !is_unsigned); + } +} + +/* CIntToPy */ + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_time_t(time_t value) { + const time_t neg_one = (time_t) -1, const_zero = (time_t) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(time_t) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(time_t) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(time_t) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(time_t) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(time_t) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(time_t), + little, !is_unsigned); + } +} + +/* CIntToPy */ + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + const long neg_one = (long) -1, const_zero = (long) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } +} + +/* CIntFromPyVerify */ + #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) +#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) +#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ + {\ + func_type value = func_value;\ + if (sizeof(target_type) < sizeof(func_type)) {\ + if (unlikely(value != (func_type) (target_type) value)) {\ + func_type zero = 0;\ + if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ + return (target_type) -1;\ + if (is_unsigned && unlikely(value < zero))\ + goto raise_neg_overflow;\ + else\ + goto raise_overflow;\ + }\ + }\ + return (target_type) value;\ + } + +/* CIntFromPy */ + static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + const long neg_one = (long) -1, const_zero = (long) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { + return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { + return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { + return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (long) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) + case -2: + if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + } +#endif + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + long val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to long"); + return (long) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; +} + +/* CIntFromPy */ + static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + const int neg_one = (int) -1, const_zero = (int) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(int) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { + return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { + return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { + return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (int) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(int) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) + case -2: + if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + } +#endif + if (sizeof(int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + int val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to int"); + return (int) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; +} + +/* CheckBinaryVersion */ + static int __Pyx_check_binary_version(void) { + char ctversion[4], rtversion[4]; + PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); + PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); + if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { + char message[200]; + PyOS_snprintf(message, sizeof(message), + "compiletime version %s of module '%.100s' " + "does not match runtime version %s", + ctversion, __Pyx_MODULE_NAME, rtversion); + return PyErr_WarnEx(NULL, message, 1); + } + return 0; +} + +/* InitStrings */ + static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + #if PY_MAJOR_VERSION < 3 + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + #else + if (t->is_unicode | t->is_str) { + if (t->intern) { + *t->p = PyUnicode_InternFromString(t->s); + } else if (t->encoding) { + *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); + } else { + *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); + } + } else { + *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); + } + #endif + if (!*t->p) + return -1; + if (PyObject_Hash(*t->p) == -1) + PyErr_Clear(); + ++t; + } + return 0; +} + +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { + return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); +} +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { +#if PY_VERSION_HEX < 0x03030000 + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +#else + if (__Pyx_PyUnicode_READY(o) == -1) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (PyUnicode_IS_ASCII(o)) { + *length = PyUnicode_GET_LENGTH(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else + return PyUnicode_AsUTF8AndSize(o, length); +#endif +#endif + } else +#endif +#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { +#if CYTHON_USE_TYPE_SLOTS + PyNumberMethods *m; +#endif + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (PyInt_Check(x) || PyLong_Check(x)) +#else + if (PyLong_Check(x)) +#endif + return __Pyx_NewRef(x); +#if CYTHON_USE_TYPE_SLOTS + m = Py_TYPE(x)->tp_as_number; + #if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = PyNumber_Int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = PyNumber_Long(x); + } + #else + if (m && m->nb_int) { + name = "int"; + res = PyNumber_Long(x); + } + #endif +#else + res = PyNumber_Int(x); +#endif + if (res) { +#if PY_MAJOR_VERSION < 3 + if (!PyInt_Check(res) && !PyLong_Check(res)) { +#else + if (!PyLong_Check(res)) { +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type %.200s)", + name, name, Py_TYPE(res)->tp_name); + Py_DECREF(res); + return NULL; + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) { + if (sizeof(Py_ssize_t) >= sizeof(long)) + return PyInt_AS_LONG(b); + else + return PyInt_AsSsize_t(x); + } +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)b)->ob_digit; + const Py_ssize_t size = Py_SIZE(b); + if (likely(__Pyx_sst_abs(size) <= 1)) { + ival = likely(size) ? digits[0] : 0; + if (size == -1) ival = -ival; + return ival; + } else { + switch (size) { + case 2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + } + } + #endif + return PyLong_AsSsize_t(b); + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { + return PyInt_FromSize_t(ival); +} + + +#endif /* Py_PYTHON_H */ diff --git a/ssh2/fileinfo.pxd b/ssh2/fileinfo.pxd new file mode 100644 index 00000000..2b604181 --- /dev/null +++ b/ssh2/fileinfo.pxd @@ -0,0 +1,5 @@ +cimport c_ssh2 + +cdef class FileInfo: + """Representation of stat structure""" + cdef c_ssh2.libssh2_struct_stat* _stat diff --git a/ssh2/fileinfo.pyx b/ssh2/fileinfo.pyx new file mode 100644 index 00000000..3aa65fde --- /dev/null +++ b/ssh2/fileinfo.pyx @@ -0,0 +1,83 @@ +# This file is part of ssh2-python. +# Copyright (C) 2017 Panos Kittenis + +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation, version 2.1. + +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. + +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +from libc.stdlib cimport malloc, free + +cimport c_ssh2 + + +cdef class FileInfo: + """Representation of stat structure""" + + def __cinit__(self): + with nogil: + self._stat = malloc( + sizeof(c_ssh2.libssh2_struct_stat)) + if self._stat is NULL: + with gil: + raise MemoryError + + def __dealloc__(self): + free(self._stat) + + @property + def st_ino(self): + return self._stat.st_ino + + @property + def st_mode(self): + return self._stat.st_mode + + @property + def st_nlink(self): + return self._stat.st_nlink + + @property + def st_uid(self): + return self._stat.st_uid + + @property + def st_gid(self): + return self._stat.st_gid + + @property + def st_rdev(self): + return self._stat.st_rdev + + @property + def st_size(self): + return self._stat.st_size + + @property + def st_blksize(self): + return self._stat.st_blksize + + @property + def st_blocks(self): + return self._stat.st_blocks + + @property + def st_atime(self): + return self._stat.st_atime + + @property + def st_mtime(self): + return self._stat.st_mtime + + @property + def st_ctime(self): + return self._stat.st_ctime + diff --git a/ssh2/listener.c b/ssh2/listener.c index 0add2860..c93ad23c 100644 --- a/ssh2/listener.c +++ b/ssh2/listener.c @@ -3,18 +3,18 @@ /* BEGIN: Cython Metadata { "distutils": { - "depends": [], + "depends": [], "extra_compile_args": [ "-ggdb" - ], + ], "libraries": [ "ssh2" - ], - "name": "ssh2.listener", + ], + "name": "ssh2.listener", "sources": [ "ssh2/listener.pyx" ] - }, + }, "module_name": "ssh2.listener" } END: Cython Metadata */ @@ -488,6 +488,7 @@ static CYTHON_INLINE float __PYX_NAN() { #define __PYX_HAVE__ssh2__listener #define __PYX_HAVE_API__ssh2__listener +#include #include #include #include @@ -972,6 +973,8 @@ static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (** static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); +/* Module declarations from 'libc.stdint' */ + /* Module declarations from 'libc.stddef' */ /* Module declarations from 'libc.time' */ diff --git a/ssh2/pkey.c b/ssh2/pkey.c index 03eb4fb4..2b3991fb 100644 --- a/ssh2/pkey.c +++ b/ssh2/pkey.c @@ -3,18 +3,18 @@ /* BEGIN: Cython Metadata { "distutils": { - "depends": [], + "depends": [], "extra_compile_args": [ "-ggdb" - ], + ], "libraries": [ "ssh2" - ], - "name": "ssh2.pkey", + ], + "name": "ssh2.pkey", "sources": [ "ssh2/pkey.pyx" ] - }, + }, "module_name": "ssh2.pkey" } END: Cython Metadata */ @@ -488,6 +488,7 @@ static CYTHON_INLINE float __PYX_NAN() { #define __PYX_HAVE__ssh2__pkey #define __PYX_HAVE_API__ssh2__pkey +#include #include #include #include @@ -882,6 +883,8 @@ static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *s static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); +/* Module declarations from 'libc.stdint' */ + /* Module declarations from 'libc.stddef' */ /* Module declarations from 'libc.time' */ diff --git a/ssh2/session.c b/ssh2/session.c index e131a8a7..54b2f1ca 100644 --- a/ssh2/session.c +++ b/ssh2/session.c @@ -488,6 +488,7 @@ static CYTHON_INLINE float __PYX_NAN() { #define __PYX_HAVE__ssh2__session #define __PYX_HAVE_API__ssh2__session +#include #include #include #include @@ -495,7 +496,6 @@ static CYTHON_INLINE float __PYX_NAN() { #include #include #include "pythread.h" -#include #include "libssh2_sftp.h" #ifdef _OPENMP #include @@ -707,6 +707,7 @@ static const char *__pyx_f[] = { "ssh2/exceptions.pxd", "ssh2/listener.pxd", "ssh2/sftp.pxd", + "ssh2/fileinfo.pxd", }; /*--- Type declarations ---*/ @@ -714,7 +715,7 @@ struct __pyx_obj_4ssh2_5agent_Agent; struct __pyx_obj_4ssh2_7channel_Channel; struct __pyx_obj_4ssh2_10exceptions_AgentError; struct __pyx_obj_4ssh2_10exceptions_AuthenticationError; -struct __pyx_obj_4ssh2_10exceptions_AgentConnectError; +struct __pyx_obj_4ssh2_10exceptions_AgentConnectionError; struct __pyx_obj_4ssh2_10exceptions_AgentAuthenticationError; struct __pyx_obj_4ssh2_10exceptions_AgentListIdentitiesError; struct __pyx_obj_4ssh2_10exceptions_AgentGetIdentityError; @@ -725,6 +726,7 @@ struct __pyx_obj_4ssh2_10exceptions_SFTPHandleError; struct __pyx_obj_4ssh2_10exceptions_SFTPBufferTooSmall; struct __pyx_obj_4ssh2_8listener_Listener; struct __pyx_obj_4ssh2_4sftp_SFTP; +struct __pyx_obj_4ssh2_8fileinfo_FileInfo; struct __pyx_obj_4ssh2_7session_Session; /* "agent.pxd":24 @@ -782,11 +784,11 @@ struct __pyx_obj_4ssh2_10exceptions_AuthenticationError { /* "exceptions.pxd":25 * * - * cdef class AgentConnectError(AgentError): # <<<<<<<<<<<<<< + * cdef class AgentConnectionError(AgentError): # <<<<<<<<<<<<<< * pass * */ -struct __pyx_obj_4ssh2_10exceptions_AgentConnectError { +struct __pyx_obj_4ssh2_10exceptions_AgentConnectionError { struct __pyx_obj_4ssh2_10exceptions_AgentError __pyx_base; }; @@ -914,6 +916,19 @@ struct __pyx_obj_4ssh2_4sftp_SFTP { }; +/* "fileinfo.pxd":3 + * cimport c_ssh2 + * + * cdef class FileInfo: # <<<<<<<<<<<<<< + * """Representation of stat structure""" + * cdef c_ssh2.libssh2_struct_stat* _stat + */ +struct __pyx_obj_4ssh2_8fileinfo_FileInfo { + PyObject_HEAD + libssh2_struct_stat *_stat; +}; + + /* "ssh2/session.pxd":20 * * @@ -929,7 +944,7 @@ struct __pyx_obj_4ssh2_7session_Session { -/* "ssh2/session.pyx":32 +/* "ssh2/session.pyx":34 * * * cdef class Session: # <<<<<<<<<<<<<< @@ -1133,6 +1148,12 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +/* CIntFromPy.proto */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + /* CIntFromPy.proto */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); @@ -1145,12 +1166,6 @@ static CYTHON_INLINE uint64_t __Pyx_PyInt_As_uint64_t(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE time_t __Pyx_PyInt_As_time_t(PyObject *); -/* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); - -/* CIntFromPy.proto */ -static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); - /* CheckBinaryVersion.proto */ static int __Pyx_check_binary_version(void); @@ -1178,6 +1193,8 @@ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); static LIBSSH2_AGENT *__pyx_f_4ssh2_7session_7Session__agent_init(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self); /* proto*/ static LIBSSH2_AGENT *__pyx_f_4ssh2_7session_7Session_init_connect_agent(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self); /* proto*/ +/* Module declarations from 'libc.stdint' */ + /* Module declarations from 'libc.stddef' */ /* Module declarations from 'libc.time' */ @@ -1269,8 +1286,6 @@ static PyTypeObject *__pyx_ptype_7cpython_7complex_complex = 0; /* Module declarations from 'cpython' */ -/* Module declarations from 'libc.stdint' */ - /* Module declarations from 'ssh2.c_sftp' */ /* Module declarations from 'ssh2.agent' */ @@ -1286,7 +1301,7 @@ static PyObject *(*__pyx_f_4ssh2_7channel_PyChannel)(LIBSSH2_CHANNEL *, struct _ /* Module declarations from 'ssh2.exceptions' */ static PyTypeObject *__pyx_ptype_4ssh2_10exceptions_AgentError = 0; static PyTypeObject *__pyx_ptype_4ssh2_10exceptions_AuthenticationError = 0; -static PyTypeObject *__pyx_ptype_4ssh2_10exceptions_AgentConnectError = 0; +static PyTypeObject *__pyx_ptype_4ssh2_10exceptions_AgentConnectionError = 0; static PyTypeObject *__pyx_ptype_4ssh2_10exceptions_AgentAuthenticationError = 0; static PyTypeObject *__pyx_ptype_4ssh2_10exceptions_AgentListIdentitiesError = 0; static PyTypeObject *__pyx_ptype_4ssh2_10exceptions_AgentGetIdentityError = 0; @@ -1308,6 +1323,9 @@ static PyObject *(*__pyx_f_4ssh2_4sftp_PySFTP)(LIBSSH2_SFTP *, struct __pyx_obj_ static char *(*__pyx_f_4ssh2_5utils_to_bytes)(PyObject *); /*proto*/ static PyObject *(*__pyx_f_4ssh2_5utils_to_str)(char *); /*proto*/ +/* Module declarations from 'ssh2.fileinfo' */ +static PyTypeObject *__pyx_ptype_4ssh2_8fileinfo_FileInfo = 0; + /* Module declarations from 'ssh2.session' */ static PyTypeObject *__pyx_ptype_4ssh2_7session_Session = 0; #define __Pyx_MODULE_NAME "ssh2.session" @@ -1315,7 +1333,6 @@ int __pyx_module_is_main_ssh2__session = 0; /* Implementation of 'ssh2.session' */ static PyObject *__pyx_builtin_MemoryError; -static PyObject *__pyx_builtin_NotImplementedError; static PyObject *__pyx_builtin_TypeError; static const char __pyx_k_[] = ","; static const char __pyx_k__5[] = ""; @@ -1346,7 +1363,6 @@ static const char __pyx_k_queue_maxsize[] = "queue_maxsize"; static const char __pyx_k_reduce_cython[] = "__reduce_cython__"; static const char __pyx_k_setstate_cython[] = "__setstate_cython__"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; -static const char __pyx_k_NotImplementedError[] = "NotImplementedError"; static const char __pyx_k_Unable_to_connect_to_agent[] = "Unable to connect to agent"; static const char __pyx_k_SSH_session_startup_failed_with[] = "SSH session startup failed with error code %s"; static const char __pyx_k_Failure_requesting_identities_fr[] = "Failure requesting identities from agent"; @@ -1355,7 +1371,6 @@ static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __red static PyObject *__pyx_kp_s_; static PyObject *__pyx_kp_s_Failure_requesting_identities_fr; static PyObject *__pyx_n_s_MemoryError; -static PyObject *__pyx_n_s_NotImplementedError; static PyObject *__pyx_kp_s_SSH_session_handshake_failed_wit; static PyObject *__pyx_kp_s_SSH_session_startup_failed_with; static PyObject *__pyx_n_s_TypeError; @@ -1392,28 +1407,31 @@ static void __pyx_pf_4ssh2_7session_7Session_2__dealloc__(struct __pyx_obj_4ssh2 static PyObject *__pyx_pf_4ssh2_7session_7Session_4disconnect(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_4ssh2_7session_7Session_6handshake(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, PyObject *__pyx_v_sock); /* proto */ static PyObject *__pyx_pf_4ssh2_7session_7Session_8startup(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, PyObject *__pyx_v_sock); /* proto */ -static PyObject *__pyx_pf_4ssh2_7session_7Session_10setblocking(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, int __pyx_v_blocking); /* proto */ -static PyObject *__pyx_pf_4ssh2_7session_7Session_12userauth_authenticated(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_4ssh2_7session_7Session_14userauth_list(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, PyObject *__pyx_v_username); /* proto */ -static PyObject *__pyx_pf_4ssh2_7session_7Session_16userauth_publickey_fromfile(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, PyObject *__pyx_v_username, PyObject *__pyx_v_publickey, PyObject *__pyx_v_privatekey, PyObject *__pyx_v_passphrase); /* proto */ -static PyObject *__pyx_pf_4ssh2_7session_7Session_18userauth_publickey(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, PyObject *__pyx_v_username, PyObject *__pyx_v_pubkeydata); /* proto */ -static PyObject *__pyx_pf_4ssh2_7session_7Session_20userauth_hostbased_fromfile(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, PyObject *__pyx_v_username, PyObject *__pyx_v_publickey, PyObject *__pyx_v_privatekey, PyObject *__pyx_v_passphrase, PyObject *__pyx_v_hostname); /* proto */ -static PyObject *__pyx_pf_4ssh2_7session_7Session_22userauth_password(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, PyObject *__pyx_v_username, PyObject *__pyx_v_password); /* proto */ -static PyObject *__pyx_pf_4ssh2_7session_7Session_24agent_init(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_4ssh2_7session_7Session_26agent_auth(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, PyObject *__pyx_v_username); /* proto */ -static PyObject *__pyx_pf_4ssh2_7session_7Session_28open_session(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_4ssh2_7session_7Session_30direct_tcpip_ex(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, PyObject *__pyx_v_host, int __pyx_v_port, PyObject *__pyx_v_shost, int __pyx_v_sport); /* proto */ -static PyObject *__pyx_pf_4ssh2_7session_7Session_32direct_tcpip(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, PyObject *__pyx_v_host, int __pyx_v_port); /* proto */ -static PyObject *__pyx_pf_4ssh2_7session_7Session_34blockdirections(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_4ssh2_7session_7Session_36forward_listen(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, int __pyx_v_port); /* proto */ -static PyObject *__pyx_pf_4ssh2_7session_7Session_38forward_listen_ex(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, PyObject *__pyx_v_host, int __pyx_v_port, int __pyx_v_bound_port, int __pyx_v_queue_maxsize); /* proto */ -static PyObject *__pyx_pf_4ssh2_7session_7Session_40sftp_init(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_4ssh2_7session_7Session_42last_error(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_4ssh2_7session_7Session_44scp_recv(CYTHON_UNUSED struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_path); /* proto */ -static PyObject *__pyx_pf_4ssh2_7session_7Session_46scp_send(CYTHON_UNUSED struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_path, CYTHON_UNUSED int __pyx_v_mode, CYTHON_UNUSED size_t __pyx_v_size); /* proto */ -static PyObject *__pyx_pf_4ssh2_7session_7Session_48scp_send64(CYTHON_UNUSED struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_path, CYTHON_UNUSED int __pyx_v_mode, CYTHON_UNUSED uint64_t __pyx_v_size, CYTHON_UNUSED time_t __pyx_v_mtime, CYTHON_UNUSED time_t __pyx_v_atime); /* proto */ -static PyObject *__pyx_pf_4ssh2_7session_7Session_50__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_4ssh2_7session_7Session_52__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ +static PyObject *__pyx_pf_4ssh2_7session_7Session_10set_blocking(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, int __pyx_v_blocking); /* proto */ +static PyObject *__pyx_pf_4ssh2_7session_7Session_12get_blocking(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4ssh2_7session_7Session_14set_timeout(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, long __pyx_v_timeout); /* proto */ +static PyObject *__pyx_pf_4ssh2_7session_7Session_16get_timeout(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4ssh2_7session_7Session_18userauth_authenticated(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4ssh2_7session_7Session_20userauth_list(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, PyObject *__pyx_v_username); /* proto */ +static PyObject *__pyx_pf_4ssh2_7session_7Session_22userauth_publickey_fromfile(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, PyObject *__pyx_v_username, PyObject *__pyx_v_publickey, PyObject *__pyx_v_privatekey, PyObject *__pyx_v_passphrase); /* proto */ +static PyObject *__pyx_pf_4ssh2_7session_7Session_24userauth_publickey(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, PyObject *__pyx_v_username, PyObject *__pyx_v_pubkeydata); /* proto */ +static PyObject *__pyx_pf_4ssh2_7session_7Session_26userauth_hostbased_fromfile(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, PyObject *__pyx_v_username, PyObject *__pyx_v_publickey, PyObject *__pyx_v_privatekey, PyObject *__pyx_v_passphrase, PyObject *__pyx_v_hostname); /* proto */ +static PyObject *__pyx_pf_4ssh2_7session_7Session_28userauth_password(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, PyObject *__pyx_v_username, PyObject *__pyx_v_password); /* proto */ +static PyObject *__pyx_pf_4ssh2_7session_7Session_30agent_init(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4ssh2_7session_7Session_32agent_auth(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, PyObject *__pyx_v_username); /* proto */ +static PyObject *__pyx_pf_4ssh2_7session_7Session_34open_session(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4ssh2_7session_7Session_36direct_tcpip_ex(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, PyObject *__pyx_v_host, int __pyx_v_port, PyObject *__pyx_v_shost, int __pyx_v_sport); /* proto */ +static PyObject *__pyx_pf_4ssh2_7session_7Session_38direct_tcpip(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, PyObject *__pyx_v_host, int __pyx_v_port); /* proto */ +static PyObject *__pyx_pf_4ssh2_7session_7Session_40blockdirections(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4ssh2_7session_7Session_42forward_listen(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, int __pyx_v_port); /* proto */ +static PyObject *__pyx_pf_4ssh2_7session_7Session_44forward_listen_ex(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, PyObject *__pyx_v_host, int __pyx_v_port, int __pyx_v_bound_port, int __pyx_v_queue_maxsize); /* proto */ +static PyObject *__pyx_pf_4ssh2_7session_7Session_46sftp_init(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4ssh2_7session_7Session_48last_error(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4ssh2_7session_7Session_50scp_recv2(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, PyObject *__pyx_v_path); /* proto */ +static PyObject *__pyx_pf_4ssh2_7session_7Session_52scp_send(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, PyObject *__pyx_v_path, int __pyx_v_mode, size_t __pyx_v_size); /* proto */ +static PyObject *__pyx_pf_4ssh2_7session_7Session_54scp_send64(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, PyObject *__pyx_v_path, int __pyx_v_mode, uint64_t __pyx_v_size, time_t __pyx_v_mtime, time_t __pyx_v_atime); /* proto */ +static PyObject *__pyx_pf_4ssh2_7session_7Session_56__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4ssh2_7session_7Session_58__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_tp_new_4ssh2_7session_Session(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tuple__2; static PyObject *__pyx_tuple__3; @@ -1421,7 +1439,7 @@ static PyObject *__pyx_tuple__4; static PyObject *__pyx_tuple__6; static PyObject *__pyx_tuple__7; -/* "ssh2/session.pyx":36 +/* "ssh2/session.pyx":38 * """LibSSH2 Session class providing session functions""" * * def __cinit__(self): # <<<<<<<<<<<<<< @@ -1451,7 +1469,7 @@ static int __pyx_pf_4ssh2_7session_7Session___cinit__(struct __pyx_obj_4ssh2_7se int __pyx_t_1; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "ssh2/session.pyx":37 + /* "ssh2/session.pyx":39 * * def __cinit__(self): * with nogil: # <<<<<<<<<<<<<< @@ -1466,7 +1484,7 @@ static int __pyx_pf_4ssh2_7session_7Session___cinit__(struct __pyx_obj_4ssh2_7se #endif /*try:*/ { - /* "ssh2/session.pyx":38 + /* "ssh2/session.pyx":40 * def __cinit__(self): * with nogil: * self._session = c_ssh2.libssh2_session_init() # <<<<<<<<<<<<<< @@ -1475,7 +1493,7 @@ static int __pyx_pf_4ssh2_7session_7Session___cinit__(struct __pyx_obj_4ssh2_7se */ __pyx_v_self->_session = libssh2_session_init(); - /* "ssh2/session.pyx":39 + /* "ssh2/session.pyx":41 * with nogil: * self._session = c_ssh2.libssh2_session_init() * if self._session is NULL: # <<<<<<<<<<<<<< @@ -1485,7 +1503,7 @@ static int __pyx_pf_4ssh2_7session_7Session___cinit__(struct __pyx_obj_4ssh2_7se __pyx_t_1 = ((__pyx_v_self->_session == NULL) != 0); if (__pyx_t_1) { - /* "ssh2/session.pyx":40 + /* "ssh2/session.pyx":42 * self._session = c_ssh2.libssh2_session_init() * if self._session is NULL: * with gil: # <<<<<<<<<<<<<< @@ -1498,17 +1516,17 @@ static int __pyx_pf_4ssh2_7session_7Session___cinit__(struct __pyx_obj_4ssh2_7se #endif /*try:*/ { - /* "ssh2/session.pyx":41 + /* "ssh2/session.pyx":43 * if self._session is NULL: * with gil: * raise MemoryError # <<<<<<<<<<<<<< * * def __dealloc__(self): */ - PyErr_NoMemory(); __PYX_ERR(0, 41, __pyx_L8_error) + PyErr_NoMemory(); __PYX_ERR(0, 43, __pyx_L8_error) } - /* "ssh2/session.pyx":40 + /* "ssh2/session.pyx":42 * self._session = c_ssh2.libssh2_session_init() * if self._session is NULL: * with gil: # <<<<<<<<<<<<<< @@ -1525,7 +1543,7 @@ static int __pyx_pf_4ssh2_7session_7Session___cinit__(struct __pyx_obj_4ssh2_7se } } - /* "ssh2/session.pyx":39 + /* "ssh2/session.pyx":41 * with nogil: * self._session = c_ssh2.libssh2_session_init() * if self._session is NULL: # <<<<<<<<<<<<<< @@ -1535,7 +1553,7 @@ static int __pyx_pf_4ssh2_7session_7Session___cinit__(struct __pyx_obj_4ssh2_7se } } - /* "ssh2/session.pyx":37 + /* "ssh2/session.pyx":39 * * def __cinit__(self): * with nogil: # <<<<<<<<<<<<<< @@ -1561,7 +1579,7 @@ static int __pyx_pf_4ssh2_7session_7Session___cinit__(struct __pyx_obj_4ssh2_7se } } - /* "ssh2/session.pyx":36 + /* "ssh2/session.pyx":38 * """LibSSH2 Session class providing session functions""" * * def __cinit__(self): # <<<<<<<<<<<<<< @@ -1580,7 +1598,7 @@ static int __pyx_pf_4ssh2_7session_7Session___cinit__(struct __pyx_obj_4ssh2_7se return __pyx_r; } -/* "ssh2/session.pyx":43 +/* "ssh2/session.pyx":45 * raise MemoryError * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -1603,7 +1621,7 @@ static void __pyx_pf_4ssh2_7session_7Session_2__dealloc__(struct __pyx_obj_4ssh2 __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "ssh2/session.pyx":44 + /* "ssh2/session.pyx":46 * * def __dealloc__(self): * with nogil: # <<<<<<<<<<<<<< @@ -1618,7 +1636,7 @@ static void __pyx_pf_4ssh2_7session_7Session_2__dealloc__(struct __pyx_obj_4ssh2 #endif /*try:*/ { - /* "ssh2/session.pyx":45 + /* "ssh2/session.pyx":47 * def __dealloc__(self): * with nogil: * c_ssh2.libssh2_session_disconnect( # <<<<<<<<<<<<<< @@ -1627,7 +1645,7 @@ static void __pyx_pf_4ssh2_7session_7Session_2__dealloc__(struct __pyx_obj_4ssh2 */ libssh2_session_disconnect(__pyx_v_self->_session, ((char const *)"end")); - /* "ssh2/session.pyx":47 + /* "ssh2/session.pyx":49 * c_ssh2.libssh2_session_disconnect( * self._session, "end") * c_ssh2.libssh2_session_free(self._session) # <<<<<<<<<<<<<< @@ -1637,7 +1655,7 @@ static void __pyx_pf_4ssh2_7session_7Session_2__dealloc__(struct __pyx_obj_4ssh2 libssh2_session_free(__pyx_v_self->_session); } - /* "ssh2/session.pyx":44 + /* "ssh2/session.pyx":46 * * def __dealloc__(self): * with nogil: # <<<<<<<<<<<<<< @@ -1656,7 +1674,7 @@ static void __pyx_pf_4ssh2_7session_7Session_2__dealloc__(struct __pyx_obj_4ssh2 } } - /* "ssh2/session.pyx":43 + /* "ssh2/session.pyx":45 * raise MemoryError * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -1668,7 +1686,7 @@ static void __pyx_pf_4ssh2_7session_7Session_2__dealloc__(struct __pyx_obj_4ssh2 __Pyx_RefNannyFinishContext(); } -/* "ssh2/session.pyx":49 +/* "ssh2/session.pyx":51 * c_ssh2.libssh2_session_free(self._session) * * def disconnect(self): # <<<<<<<<<<<<<< @@ -1695,7 +1713,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_4disconnect(struct __pyx_obj_4 __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("disconnect", 0); - /* "ssh2/session.pyx":50 + /* "ssh2/session.pyx":52 * * def disconnect(self): * with nogil: # <<<<<<<<<<<<<< @@ -1710,7 +1728,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_4disconnect(struct __pyx_obj_4 #endif /*try:*/ { - /* "ssh2/session.pyx":51 + /* "ssh2/session.pyx":53 * def disconnect(self): * with nogil: * c_ssh2.libssh2_session_disconnect(self._session, "end") # <<<<<<<<<<<<<< @@ -1720,7 +1738,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_4disconnect(struct __pyx_obj_4 libssh2_session_disconnect(__pyx_v_self->_session, ((char const *)"end")); } - /* "ssh2/session.pyx":50 + /* "ssh2/session.pyx":52 * * def disconnect(self): * with nogil: # <<<<<<<<<<<<<< @@ -1739,7 +1757,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_4disconnect(struct __pyx_obj_4 } } - /* "ssh2/session.pyx":49 + /* "ssh2/session.pyx":51 * c_ssh2.libssh2_session_free(self._session) * * def disconnect(self): # <<<<<<<<<<<<<< @@ -1754,7 +1772,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_4disconnect(struct __pyx_obj_4 return __pyx_r; } -/* "ssh2/session.pyx":53 +/* "ssh2/session.pyx":55 * c_ssh2.libssh2_session_disconnect(self._session, "end") * * def handshake(self, sock not None): # <<<<<<<<<<<<<< @@ -1770,7 +1788,7 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_7handshake(PyObject *__pyx_v_s __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("handshake (wrapper)", 0); if (unlikely(((PyObject *)__pyx_v_sock) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "sock"); __PYX_ERR(0, 53, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "sock"); __PYX_ERR(0, 55, __pyx_L1_error) } __pyx_r = __pyx_pf_4ssh2_7session_7Session_6handshake(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), ((PyObject *)__pyx_v_sock)); @@ -1795,17 +1813,17 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_6handshake(struct __pyx_obj_4s PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("handshake", 0); - /* "ssh2/session.pyx":54 + /* "ssh2/session.pyx":56 * * def handshake(self, sock not None): * cdef int _sock = PyObject_AsFileDescriptor(sock) # <<<<<<<<<<<<<< * cdef int rc * with nogil: */ - __pyx_t_1 = PyObject_AsFileDescriptor(__pyx_v_sock); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 54, __pyx_L1_error) + __pyx_t_1 = PyObject_AsFileDescriptor(__pyx_v_sock); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 56, __pyx_L1_error) __pyx_v__sock = __pyx_t_1; - /* "ssh2/session.pyx":56 + /* "ssh2/session.pyx":58 * cdef int _sock = PyObject_AsFileDescriptor(sock) * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -1820,7 +1838,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_6handshake(struct __pyx_obj_4s #endif /*try:*/ { - /* "ssh2/session.pyx":57 + /* "ssh2/session.pyx":59 * cdef int rc * with nogil: * rc = c_ssh2.libssh2_session_handshake(self._session, _sock) # <<<<<<<<<<<<<< @@ -1829,7 +1847,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_6handshake(struct __pyx_obj_4s */ __pyx_v_rc = libssh2_session_handshake(__pyx_v_self->_session, __pyx_v__sock); - /* "ssh2/session.pyx":58 + /* "ssh2/session.pyx":60 * with nogil: * rc = c_ssh2.libssh2_session_handshake(self._session, _sock) * if rc != 0 and rc != c_ssh2._LIBSSH2_ERROR_EAGAIN: # <<<<<<<<<<<<<< @@ -1847,7 +1865,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_6handshake(struct __pyx_obj_4s __pyx_L7_bool_binop_done:; if (__pyx_t_2) { - /* "ssh2/session.pyx":59 + /* "ssh2/session.pyx":61 * rc = c_ssh2.libssh2_session_handshake(self._session, _sock) * if rc != 0 and rc != c_ssh2._LIBSSH2_ERROR_EAGAIN: * with gil: # <<<<<<<<<<<<<< @@ -1860,24 +1878,24 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_6handshake(struct __pyx_obj_4s #endif /*try:*/ { - /* "ssh2/session.pyx":62 + /* "ssh2/session.pyx":64 * raise SessionHandshakeError( * "SSH session handshake failed with error code %s", * rc) # <<<<<<<<<<<<<< * return rc * */ - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 62, __pyx_L10_error) + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 64, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_4); - /* "ssh2/session.pyx":60 + /* "ssh2/session.pyx":62 * if rc != 0 and rc != c_ssh2._LIBSSH2_ERROR_EAGAIN: * with gil: * raise SessionHandshakeError( # <<<<<<<<<<<<<< * "SSH session handshake failed with error code %s", * rc) */ - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 60, __pyx_L10_error) + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 62, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_kp_s_SSH_session_handshake_failed_wit); __Pyx_GIVEREF(__pyx_kp_s_SSH_session_handshake_failed_wit); @@ -1885,15 +1903,15 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_6handshake(struct __pyx_obj_4s __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4ssh2_10exceptions_SessionHandshakeError), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 60, __pyx_L10_error) + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4ssh2_10exceptions_SessionHandshakeError), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 62, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(0, 60, __pyx_L10_error) + __PYX_ERR(0, 62, __pyx_L10_error) } - /* "ssh2/session.pyx":59 + /* "ssh2/session.pyx":61 * rc = c_ssh2.libssh2_session_handshake(self._session, _sock) * if rc != 0 and rc != c_ssh2._LIBSSH2_ERROR_EAGAIN: * with gil: # <<<<<<<<<<<<<< @@ -1910,7 +1928,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_6handshake(struct __pyx_obj_4s } } - /* "ssh2/session.pyx":58 + /* "ssh2/session.pyx":60 * with nogil: * rc = c_ssh2.libssh2_session_handshake(self._session, _sock) * if rc != 0 and rc != c_ssh2._LIBSSH2_ERROR_EAGAIN: # <<<<<<<<<<<<<< @@ -1920,7 +1938,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_6handshake(struct __pyx_obj_4s } } - /* "ssh2/session.pyx":56 + /* "ssh2/session.pyx":58 * cdef int _sock = PyObject_AsFileDescriptor(sock) * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -1946,7 +1964,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_6handshake(struct __pyx_obj_4s } } - /* "ssh2/session.pyx":63 + /* "ssh2/session.pyx":65 * "SSH session handshake failed with error code %s", * rc) * return rc # <<<<<<<<<<<<<< @@ -1954,13 +1972,13 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_6handshake(struct __pyx_obj_4s * def startup(self, sock): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 63, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":53 + /* "ssh2/session.pyx":55 * c_ssh2.libssh2_session_disconnect(self._session, "end") * * def handshake(self, sock not None): # <<<<<<<<<<<<<< @@ -1980,7 +1998,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_6handshake(struct __pyx_obj_4s return __pyx_r; } -/* "ssh2/session.pyx":65 +/* "ssh2/session.pyx":67 * return rc * * def startup(self, sock): # <<<<<<<<<<<<<< @@ -2014,17 +2032,17 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_8startup(struct __pyx_obj_4ssh PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("startup", 0); - /* "ssh2/session.pyx":67 + /* "ssh2/session.pyx":69 * def startup(self, sock): * """Deprecated - use self.handshake""" * cdef int _sock = PyObject_AsFileDescriptor(sock) # <<<<<<<<<<<<<< * cdef int rc * with nogil: */ - __pyx_t_1 = PyObject_AsFileDescriptor(__pyx_v_sock); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 67, __pyx_L1_error) + __pyx_t_1 = PyObject_AsFileDescriptor(__pyx_v_sock); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 69, __pyx_L1_error) __pyx_v__sock = __pyx_t_1; - /* "ssh2/session.pyx":69 + /* "ssh2/session.pyx":71 * cdef int _sock = PyObject_AsFileDescriptor(sock) * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -2039,7 +2057,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_8startup(struct __pyx_obj_4ssh #endif /*try:*/ { - /* "ssh2/session.pyx":70 + /* "ssh2/session.pyx":72 * cdef int rc * with nogil: * rc = c_ssh2.libssh2_session_startup(self._session, _sock) # <<<<<<<<<<<<<< @@ -2048,7 +2066,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_8startup(struct __pyx_obj_4ssh */ __pyx_v_rc = libssh2_session_startup(__pyx_v_self->_session, __pyx_v__sock); - /* "ssh2/session.pyx":71 + /* "ssh2/session.pyx":73 * with nogil: * rc = c_ssh2.libssh2_session_startup(self._session, _sock) * if rc != 0 and rc != c_ssh2._LIBSSH2_ERROR_EAGAIN: # <<<<<<<<<<<<<< @@ -2066,7 +2084,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_8startup(struct __pyx_obj_4ssh __pyx_L7_bool_binop_done:; if (__pyx_t_2) { - /* "ssh2/session.pyx":72 + /* "ssh2/session.pyx":74 * rc = c_ssh2.libssh2_session_startup(self._session, _sock) * if rc != 0 and rc != c_ssh2._LIBSSH2_ERROR_EAGAIN: * with gil: # <<<<<<<<<<<<<< @@ -2079,24 +2097,24 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_8startup(struct __pyx_obj_4ssh #endif /*try:*/ { - /* "ssh2/session.pyx":75 + /* "ssh2/session.pyx":77 * raise SessionStartupError( * "SSH session startup failed with error code %s", * rc) # <<<<<<<<<<<<<< * return rc * */ - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 75, __pyx_L10_error) + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 77, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_4); - /* "ssh2/session.pyx":73 + /* "ssh2/session.pyx":75 * if rc != 0 and rc != c_ssh2._LIBSSH2_ERROR_EAGAIN: * with gil: * raise SessionStartupError( # <<<<<<<<<<<<<< * "SSH session startup failed with error code %s", * rc) */ - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 73, __pyx_L10_error) + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 75, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_kp_s_SSH_session_startup_failed_with); __Pyx_GIVEREF(__pyx_kp_s_SSH_session_startup_failed_with); @@ -2104,15 +2122,15 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_8startup(struct __pyx_obj_4ssh __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4ssh2_10exceptions_SessionStartupError), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 73, __pyx_L10_error) + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4ssh2_10exceptions_SessionStartupError), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 75, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(0, 73, __pyx_L10_error) + __PYX_ERR(0, 75, __pyx_L10_error) } - /* "ssh2/session.pyx":72 + /* "ssh2/session.pyx":74 * rc = c_ssh2.libssh2_session_startup(self._session, _sock) * if rc != 0 and rc != c_ssh2._LIBSSH2_ERROR_EAGAIN: * with gil: # <<<<<<<<<<<<<< @@ -2129,7 +2147,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_8startup(struct __pyx_obj_4ssh } } - /* "ssh2/session.pyx":71 + /* "ssh2/session.pyx":73 * with nogil: * rc = c_ssh2.libssh2_session_startup(self._session, _sock) * if rc != 0 and rc != c_ssh2._LIBSSH2_ERROR_EAGAIN: # <<<<<<<<<<<<<< @@ -2139,7 +2157,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_8startup(struct __pyx_obj_4ssh } } - /* "ssh2/session.pyx":69 + /* "ssh2/session.pyx":71 * cdef int _sock = PyObject_AsFileDescriptor(sock) * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -2165,21 +2183,21 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_8startup(struct __pyx_obj_4ssh } } - /* "ssh2/session.pyx":76 + /* "ssh2/session.pyx":78 * "SSH session startup failed with error code %s", * rc) * return rc # <<<<<<<<<<<<<< * - * def setblocking(self, bint blocking): + * def set_blocking(self, bint blocking): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 76, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":65 + /* "ssh2/session.pyx":67 * return rc * * def startup(self, sock): # <<<<<<<<<<<<<< @@ -2199,44 +2217,44 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_8startup(struct __pyx_obj_4ssh return __pyx_r; } -/* "ssh2/session.pyx":78 +/* "ssh2/session.pyx":80 * return rc * - * def setblocking(self, bint blocking): # <<<<<<<<<<<<<< + * def set_blocking(self, bint blocking): # <<<<<<<<<<<<<< * """Set session blocking mode on/off. * */ /* Python wrapper */ -static PyObject *__pyx_pw_4ssh2_7session_7Session_11setblocking(PyObject *__pyx_v_self, PyObject *__pyx_arg_blocking); /*proto*/ -static char __pyx_doc_4ssh2_7session_7Session_10setblocking[] = "Session.setblocking(self, bool blocking)\nSet session blocking mode on/off.\n\n :param blocking: ``False`` for non-blocking, ``True`` for blocking.\n Session default is blocking unless set otherwise.\n :type blocking: bool"; -static PyObject *__pyx_pw_4ssh2_7session_7Session_11setblocking(PyObject *__pyx_v_self, PyObject *__pyx_arg_blocking) { +static PyObject *__pyx_pw_4ssh2_7session_7Session_11set_blocking(PyObject *__pyx_v_self, PyObject *__pyx_arg_blocking); /*proto*/ +static char __pyx_doc_4ssh2_7session_7Session_10set_blocking[] = "Session.set_blocking(self, bool blocking)\nSet session blocking mode on/off.\n\n :param blocking: ``False`` for non-blocking, ``True`` for blocking.\n Session default is blocking unless set otherwise.\n :type blocking: bool"; +static PyObject *__pyx_pw_4ssh2_7session_7Session_11set_blocking(PyObject *__pyx_v_self, PyObject *__pyx_arg_blocking) { int __pyx_v_blocking; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("setblocking (wrapper)", 0); + __Pyx_RefNannySetupContext("set_blocking (wrapper)", 0); assert(__pyx_arg_blocking); { - __pyx_v_blocking = __Pyx_PyObject_IsTrue(__pyx_arg_blocking); if (unlikely((__pyx_v_blocking == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 78, __pyx_L3_error) + __pyx_v_blocking = __Pyx_PyObject_IsTrue(__pyx_arg_blocking); if (unlikely((__pyx_v_blocking == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 80, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - __Pyx_AddTraceback("ssh2.session.Session.setblocking", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("ssh2.session.Session.set_blocking", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_4ssh2_7session_7Session_10setblocking(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), ((int)__pyx_v_blocking)); + __pyx_r = __pyx_pf_4ssh2_7session_7Session_10set_blocking(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), ((int)__pyx_v_blocking)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_4ssh2_7session_7Session_10setblocking(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, int __pyx_v_blocking) { +static PyObject *__pyx_pf_4ssh2_7session_7Session_10set_blocking(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, int __pyx_v_blocking) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("setblocking", 0); + __Pyx_RefNannySetupContext("set_blocking", 0); - /* "ssh2/session.pyx":84 + /* "ssh2/session.pyx":86 * Session default is blocking unless set otherwise. * :type blocking: bool""" * with nogil: # <<<<<<<<<<<<<< @@ -2251,7 +2269,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_10setblocking(struct __pyx_obj #endif /*try:*/ { - /* "ssh2/session.pyx":85 + /* "ssh2/session.pyx":87 * :type blocking: bool""" * with nogil: * c_ssh2.libssh2_session_set_blocking( # <<<<<<<<<<<<<< @@ -2261,7 +2279,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_10setblocking(struct __pyx_obj libssh2_session_set_blocking(__pyx_v_self->_session, __pyx_v_blocking); } - /* "ssh2/session.pyx":84 + /* "ssh2/session.pyx":86 * Session default is blocking unless set otherwise. * :type blocking: bool""" * with nogil: # <<<<<<<<<<<<<< @@ -2280,10 +2298,10 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_10setblocking(struct __pyx_obj } } - /* "ssh2/session.pyx":78 + /* "ssh2/session.pyx":80 * return rc * - * def setblocking(self, bint blocking): # <<<<<<<<<<<<<< + * def set_blocking(self, bint blocking): # <<<<<<<<<<<<<< * """Set session blocking mode on/off. * */ @@ -2295,41 +2313,41 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_10setblocking(struct __pyx_obj return __pyx_r; } -/* "ssh2/session.pyx":88 +/* "ssh2/session.pyx":90 * self._session, blocking) * - * def userauth_authenticated(self): # <<<<<<<<<<<<<< - * """True/False for is user authenticated or not. + * def get_blocking(self): # <<<<<<<<<<<<<< + * """Get session blocking mode enabled True/False. * */ /* Python wrapper */ -static PyObject *__pyx_pw_4ssh2_7session_7Session_13userauth_authenticated(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static char __pyx_doc_4ssh2_7session_7Session_12userauth_authenticated[] = "Session.userauth_authenticated(self)\nTrue/False for is user authenticated or not.\n\n :rtype: bool"; -static PyObject *__pyx_pw_4ssh2_7session_7Session_13userauth_authenticated(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { +static PyObject *__pyx_pw_4ssh2_7session_7Session_13get_blocking(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_4ssh2_7session_7Session_12get_blocking[] = "Session.get_blocking(self)\nGet session blocking mode enabled True/False.\n\n :rtype: bool"; +static PyObject *__pyx_pw_4ssh2_7session_7Session_13get_blocking(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("userauth_authenticated (wrapper)", 0); - __pyx_r = __pyx_pf_4ssh2_7session_7Session_12userauth_authenticated(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self)); + __Pyx_RefNannySetupContext("get_blocking (wrapper)", 0); + __pyx_r = __pyx_pf_4ssh2_7session_7Session_12get_blocking(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_4ssh2_7session_7Session_12userauth_authenticated(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self) { +static PyObject *__pyx_pf_4ssh2_7session_7Session_12get_blocking(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self) { int __pyx_v_rc; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("userauth_authenticated", 0); + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + __Pyx_RefNannySetupContext("get_blocking", 0); - /* "ssh2/session.pyx":93 + /* "ssh2/session.pyx":95 * :rtype: bool""" - * cdef bint rc + * cdef int rc * with nogil: # <<<<<<<<<<<<<< - * rc = c_ssh2.libssh2_userauth_authenticated(self._session) + * rc = c_ssh2.libssh2_session_get_blocking(self._session) * return bool(rc) */ { @@ -2340,21 +2358,21 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_12userauth_authenticated(struc #endif /*try:*/ { - /* "ssh2/session.pyx":94 - * cdef bint rc + /* "ssh2/session.pyx":96 + * cdef int rc * with nogil: - * rc = c_ssh2.libssh2_userauth_authenticated(self._session) # <<<<<<<<<<<<<< + * rc = c_ssh2.libssh2_session_get_blocking(self._session) # <<<<<<<<<<<<<< * return bool(rc) * */ - __pyx_v_rc = libssh2_userauth_authenticated(__pyx_v_self->_session); + __pyx_v_rc = libssh2_session_get_blocking(__pyx_v_self->_session); } - /* "ssh2/session.pyx":93 + /* "ssh2/session.pyx":95 * :rtype: bool""" - * cdef bint rc + * cdef int rc * with nogil: # <<<<<<<<<<<<<< - * rc = c_ssh2.libssh2_userauth_authenticated(self._session) + * rc = c_ssh2.libssh2_session_get_blocking(self._session) * return bool(rc) */ /*finally:*/ { @@ -2369,33 +2387,36 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_12userauth_authenticated(struc } } - /* "ssh2/session.pyx":95 + /* "ssh2/session.pyx":97 * with nogil: - * rc = c_ssh2.libssh2_userauth_authenticated(self._session) + * rc = c_ssh2.libssh2_session_get_blocking(self._session) * return bool(rc) # <<<<<<<<<<<<<< * - * def userauth_list(self, username not None): + * def set_timeout(self, long timeout): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_v_rc; - __pyx_t_2 = __Pyx_PyBool_FromLong((!(!__pyx_t_1))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 95, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 97, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":88 + /* "ssh2/session.pyx":90 * self._session, blocking) * - * def userauth_authenticated(self): # <<<<<<<<<<<<<< - * """True/False for is user authenticated or not. + * def get_blocking(self): # <<<<<<<<<<<<<< + * """Get session blocking mode enabled True/False. * */ /* function exit code */ __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("ssh2.session.Session.userauth_authenticated", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("ssh2.session.Session.get_blocking", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -2403,73 +2424,49 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_12userauth_authenticated(struc return __pyx_r; } -/* "ssh2/session.pyx":97 +/* "ssh2/session.pyx":99 * return bool(rc) * - * def userauth_list(self, username not None): # <<<<<<<<<<<<<< - * """Retrieve available authentication method list. - * + * def set_timeout(self, long timeout): # <<<<<<<<<<<<<< + * """Set the timeout in milliseconds for how long a blocking the libssh2 + * function calls may wait until they consider the situation an error and */ /* Python wrapper */ -static PyObject *__pyx_pw_4ssh2_7session_7Session_15userauth_list(PyObject *__pyx_v_self, PyObject *__pyx_v_username); /*proto*/ -static char __pyx_doc_4ssh2_7session_7Session_14userauth_list[] = "Session.userauth_list(self, username)\nRetrieve available authentication method list.\n\n :rtype: list"; -static PyObject *__pyx_pw_4ssh2_7session_7Session_15userauth_list(PyObject *__pyx_v_self, PyObject *__pyx_v_username) { +static PyObject *__pyx_pw_4ssh2_7session_7Session_15set_timeout(PyObject *__pyx_v_self, PyObject *__pyx_arg_timeout); /*proto*/ +static char __pyx_doc_4ssh2_7session_7Session_14set_timeout[] = "Session.set_timeout(self, long timeout)\nSet the timeout in milliseconds for how long a blocking the libssh2\n function calls may wait until they consider the situation an error and\n return :py:class:`ssh2.error_codes.LIBSSH2_ERROR_TIMEOUT`.\n\n By default or if you set the timeout to zero, libssh2 has no timeout \n for blocking functions.\n :param timeout: Milliseconds to wait before timeout."; +static PyObject *__pyx_pw_4ssh2_7session_7Session_15set_timeout(PyObject *__pyx_v_self, PyObject *__pyx_arg_timeout) { + long __pyx_v_timeout; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("userauth_list (wrapper)", 0); - if (unlikely(((PyObject *)__pyx_v_username) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "username"); __PYX_ERR(0, 97, __pyx_L1_error) + __Pyx_RefNannySetupContext("set_timeout (wrapper)", 0); + assert(__pyx_arg_timeout); { + __pyx_v_timeout = __Pyx_PyInt_As_long(__pyx_arg_timeout); if (unlikely((__pyx_v_timeout == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 99, __pyx_L3_error) } - __pyx_r = __pyx_pf_4ssh2_7session_7Session_14userauth_list(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), ((PyObject *)__pyx_v_username)); + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("ssh2.session.Session.set_timeout", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_4ssh2_7session_7Session_14set_timeout(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), ((long)__pyx_v_timeout)); /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_4ssh2_7session_7Session_14userauth_list(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, PyObject *__pyx_v_username) { - char *__pyx_v__username; - size_t __pyx_v_username_len; - char *__pyx_v__auth; - PyObject *__pyx_v_auth = 0; +static PyObject *__pyx_pf_4ssh2_7session_7Session_14set_timeout(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, long __pyx_v_timeout) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - size_t __pyx_t_1; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - __Pyx_RefNannySetupContext("userauth_list", 0); - - /* "ssh2/session.pyx":101 - * - * :rtype: list""" - * cdef char *_username = to_bytes(username) # <<<<<<<<<<<<<< - * cdef size_t username_len = len(_username) - * cdef char *_auth - */ - __pyx_v__username = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_username); - - /* "ssh2/session.pyx":102 - * :rtype: list""" - * cdef char *_username = to_bytes(username) - * cdef size_t username_len = len(_username) # <<<<<<<<<<<<<< - * cdef char *_auth - * cdef str auth - */ - __pyx_t_1 = strlen(__pyx_v__username); - __pyx_v_username_len = __pyx_t_1; + __Pyx_RefNannySetupContext("set_timeout", 0); - /* "ssh2/session.pyx":105 - * cdef char *_auth - * cdef str auth + /* "ssh2/session.pyx":107 + * for blocking functions. + * :param timeout: Milliseconds to wait before timeout.""" * with nogil: # <<<<<<<<<<<<<< - * _auth = c_ssh2.libssh2_userauth_list( - * self._session, _username, username_len) + * c_ssh2.libssh2_session_set_timeout(self._session, timeout) + * */ { #ifdef WITH_THREAD @@ -2479,22 +2476,22 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_14userauth_list(struct __pyx_o #endif /*try:*/ { - /* "ssh2/session.pyx":106 - * cdef str auth + /* "ssh2/session.pyx":108 + * :param timeout: Milliseconds to wait before timeout.""" * with nogil: - * _auth = c_ssh2.libssh2_userauth_list( # <<<<<<<<<<<<<< - * self._session, _username, username_len) - * if _auth is NULL: + * c_ssh2.libssh2_session_set_timeout(self._session, timeout) # <<<<<<<<<<<<<< + * + * def get_timeout(self): */ - __pyx_v__auth = libssh2_userauth_list(__pyx_v_self->_session, __pyx_v__username, __pyx_v_username_len); + libssh2_session_set_timeout(__pyx_v_self->_session, __pyx_v_timeout); } - /* "ssh2/session.pyx":105 - * cdef char *_auth - * cdef str auth + /* "ssh2/session.pyx":107 + * for blocking functions. + * :param timeout: Milliseconds to wait before timeout.""" * with nogil: # <<<<<<<<<<<<<< - * _auth = c_ssh2.libssh2_userauth_list( - * self._session, _username, username_len) + * c_ssh2.libssh2_session_set_timeout(self._session, timeout) + * */ /*finally:*/ { /*normal exit:*/{ @@ -2508,115 +2505,449 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_14userauth_list(struct __pyx_o } } - /* "ssh2/session.pyx":108 - * _auth = c_ssh2.libssh2_userauth_list( - * self._session, _username, username_len) - * if _auth is NULL: # <<<<<<<<<<<<<< - * return - * auth = to_str(_auth) + /* "ssh2/session.pyx":99 + * return bool(rc) + * + * def set_timeout(self, long timeout): # <<<<<<<<<<<<<< + * """Set the timeout in milliseconds for how long a blocking the libssh2 + * function calls may wait until they consider the situation an error and */ - __pyx_t_2 = ((__pyx_v__auth == NULL) != 0); - if (__pyx_t_2) { - /* "ssh2/session.pyx":109 - * self._session, _username, username_len) - * if _auth is NULL: - * return # <<<<<<<<<<<<<< - * auth = to_str(_auth) - * return auth.split(',') + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "ssh2/session.pyx":110 + * c_ssh2.libssh2_session_set_timeout(self._session, timeout) + * + * def get_timeout(self): # <<<<<<<<<<<<<< + * """Get current session timeout setting""" + * cdef long timeout */ - __Pyx_XDECREF(__pyx_r); - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - /* "ssh2/session.pyx":108 - * _auth = c_ssh2.libssh2_userauth_list( - * self._session, _username, username_len) - * if _auth is NULL: # <<<<<<<<<<<<<< - * return - * auth = to_str(_auth) +/* Python wrapper */ +static PyObject *__pyx_pw_4ssh2_7session_7Session_17get_timeout(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_4ssh2_7session_7Session_16get_timeout[] = "Session.get_timeout(self)\nGet current session timeout setting"; +static PyObject *__pyx_pw_4ssh2_7session_7Session_17get_timeout(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_timeout (wrapper)", 0); + __pyx_r = __pyx_pf_4ssh2_7session_7Session_16get_timeout(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4ssh2_7session_7Session_16get_timeout(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self) { + long __pyx_v_timeout; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("get_timeout", 0); + + /* "ssh2/session.pyx":113 + * """Get current session timeout setting""" + * cdef long timeout + * with nogil: # <<<<<<<<<<<<<< + * timeout = c_ssh2.libssh2_session_get_timeout(self._session) + * return timeout */ - } + { + #ifdef WITH_THREAD + PyThreadState *_save; + Py_UNBLOCK_THREADS + __Pyx_FastGIL_Remember(); + #endif + /*try:*/ { - /* "ssh2/session.pyx":110 - * if _auth is NULL: - * return - * auth = to_str(_auth) # <<<<<<<<<<<<<< - * return auth.split(',') + /* "ssh2/session.pyx":114 + * cdef long timeout + * with nogil: + * timeout = c_ssh2.libssh2_session_get_timeout(self._session) # <<<<<<<<<<<<<< + * return timeout * */ - __pyx_t_3 = __pyx_f_4ssh2_5utils_to_str(__pyx_v__auth); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 110, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (!(likely(PyString_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(0, 110, __pyx_L1_error) - __pyx_v_auth = ((PyObject*)__pyx_t_3); - __pyx_t_3 = 0; + __pyx_v_timeout = libssh2_session_get_timeout(__pyx_v_self->_session); + } - /* "ssh2/session.pyx":111 - * return - * auth = to_str(_auth) - * return auth.split(',') # <<<<<<<<<<<<<< + /* "ssh2/session.pyx":113 + * """Get current session timeout setting""" + * cdef long timeout + * with nogil: # <<<<<<<<<<<<<< + * timeout = c_ssh2.libssh2_session_get_timeout(self._session) + * return timeout + */ + /*finally:*/ { + /*normal exit:*/{ + #ifdef WITH_THREAD + __Pyx_FastGIL_Forget(); + Py_BLOCK_THREADS + #endif + goto __pyx_L5; + } + __pyx_L5:; + } + } + + /* "ssh2/session.pyx":115 + * with nogil: + * timeout = c_ssh2.libssh2_session_get_timeout(self._session) + * return timeout # <<<<<<<<<<<<<< * - * def userauth_publickey_fromfile(self, username not None, + * def userauth_authenticated(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_auth, __pyx_n_s_split); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 111, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 111, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_timeout); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 115, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":97 - * return bool(rc) - * - * def userauth_list(self, username not None): # <<<<<<<<<<<<<< - * """Retrieve available authentication method list. + /* "ssh2/session.pyx":110 + * c_ssh2.libssh2_session_set_timeout(self._session, timeout) * + * def get_timeout(self): # <<<<<<<<<<<<<< + * """Get current session timeout setting""" + * cdef long timeout */ /* function exit code */ __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("ssh2.session.Session.userauth_list", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("ssh2.session.Session.get_timeout", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; - __Pyx_XDECREF(__pyx_v_auth); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "ssh2/session.pyx":113 - * return auth.split(',') +/* "ssh2/session.pyx":117 + * return timeout + * + * def userauth_authenticated(self): # <<<<<<<<<<<<<< + * """True/False for is user authenticated or not. * - * def userauth_publickey_fromfile(self, username not None, # <<<<<<<<<<<<<< - * publickey not None, - * privatekey not None, */ /* Python wrapper */ -static PyObject *__pyx_pw_4ssh2_7session_7Session_17userauth_publickey_fromfile(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_4ssh2_7session_7Session_16userauth_publickey_fromfile[] = "Session.userauth_publickey_fromfile(self, username, publickey, privatekey, passphrase)\nAuthenticate with public key from file.\n\n :rtype: int"; -static PyObject *__pyx_pw_4ssh2_7session_7Session_17userauth_publickey_fromfile(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_username = 0; - PyObject *__pyx_v_publickey = 0; - PyObject *__pyx_v_privatekey = 0; - PyObject *__pyx_v_passphrase = 0; +static PyObject *__pyx_pw_4ssh2_7session_7Session_19userauth_authenticated(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_4ssh2_7session_7Session_18userauth_authenticated[] = "Session.userauth_authenticated(self)\nTrue/False for is user authenticated or not.\n\n :rtype: bool"; +static PyObject *__pyx_pw_4ssh2_7session_7Session_19userauth_authenticated(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("userauth_publickey_fromfile (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_username,&__pyx_n_s_publickey,&__pyx_n_s_privatekey,&__pyx_n_s_passphrase,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - CYTHON_FALLTHROUGH; + __Pyx_RefNannySetupContext("userauth_authenticated (wrapper)", 0); + __pyx_r = __pyx_pf_4ssh2_7session_7Session_18userauth_authenticated(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4ssh2_7session_7Session_18userauth_authenticated(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self) { + int __pyx_v_rc; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("userauth_authenticated", 0); + + /* "ssh2/session.pyx":122 + * :rtype: bool""" + * cdef bint rc + * with nogil: # <<<<<<<<<<<<<< + * rc = c_ssh2.libssh2_userauth_authenticated(self._session) + * return bool(rc) + */ + { + #ifdef WITH_THREAD + PyThreadState *_save; + Py_UNBLOCK_THREADS + __Pyx_FastGIL_Remember(); + #endif + /*try:*/ { + + /* "ssh2/session.pyx":123 + * cdef bint rc + * with nogil: + * rc = c_ssh2.libssh2_userauth_authenticated(self._session) # <<<<<<<<<<<<<< + * return bool(rc) + * + */ + __pyx_v_rc = libssh2_userauth_authenticated(__pyx_v_self->_session); + } + + /* "ssh2/session.pyx":122 + * :rtype: bool""" + * cdef bint rc + * with nogil: # <<<<<<<<<<<<<< + * rc = c_ssh2.libssh2_userauth_authenticated(self._session) + * return bool(rc) + */ + /*finally:*/ { + /*normal exit:*/{ + #ifdef WITH_THREAD + __Pyx_FastGIL_Forget(); + Py_BLOCK_THREADS + #endif + goto __pyx_L5; + } + __pyx_L5:; + } + } + + /* "ssh2/session.pyx":124 + * with nogil: + * rc = c_ssh2.libssh2_userauth_authenticated(self._session) + * return bool(rc) # <<<<<<<<<<<<<< + * + * def userauth_list(self, username not None): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_v_rc; + __pyx_t_2 = __Pyx_PyBool_FromLong((!(!__pyx_t_1))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 124, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "ssh2/session.pyx":117 + * return timeout + * + * def userauth_authenticated(self): # <<<<<<<<<<<<<< + * """True/False for is user authenticated or not. + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("ssh2.session.Session.userauth_authenticated", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "ssh2/session.pyx":126 + * return bool(rc) + * + * def userauth_list(self, username not None): # <<<<<<<<<<<<<< + * """Retrieve available authentication method list. + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4ssh2_7session_7Session_21userauth_list(PyObject *__pyx_v_self, PyObject *__pyx_v_username); /*proto*/ +static char __pyx_doc_4ssh2_7session_7Session_20userauth_list[] = "Session.userauth_list(self, username)\nRetrieve available authentication method list.\n\n :rtype: list"; +static PyObject *__pyx_pw_4ssh2_7session_7Session_21userauth_list(PyObject *__pyx_v_self, PyObject *__pyx_v_username) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("userauth_list (wrapper)", 0); + if (unlikely(((PyObject *)__pyx_v_username) == Py_None)) { + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "username"); __PYX_ERR(0, 126, __pyx_L1_error) + } + __pyx_r = __pyx_pf_4ssh2_7session_7Session_20userauth_list(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), ((PyObject *)__pyx_v_username)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4ssh2_7session_7Session_20userauth_list(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, PyObject *__pyx_v_username) { + char *__pyx_v__username; + size_t __pyx_v_username_len; + char *__pyx_v__auth; + PyObject *__pyx_v_auth = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + size_t __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __Pyx_RefNannySetupContext("userauth_list", 0); + + /* "ssh2/session.pyx":130 + * + * :rtype: list""" + * cdef char *_username = to_bytes(username) # <<<<<<<<<<<<<< + * cdef size_t username_len = len(_username) + * cdef char *_auth + */ + __pyx_v__username = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_username); + + /* "ssh2/session.pyx":131 + * :rtype: list""" + * cdef char *_username = to_bytes(username) + * cdef size_t username_len = len(_username) # <<<<<<<<<<<<<< + * cdef char *_auth + * cdef str auth + */ + __pyx_t_1 = strlen(__pyx_v__username); + __pyx_v_username_len = __pyx_t_1; + + /* "ssh2/session.pyx":134 + * cdef char *_auth + * cdef str auth + * with nogil: # <<<<<<<<<<<<<< + * _auth = c_ssh2.libssh2_userauth_list( + * self._session, _username, username_len) + */ + { + #ifdef WITH_THREAD + PyThreadState *_save; + Py_UNBLOCK_THREADS + __Pyx_FastGIL_Remember(); + #endif + /*try:*/ { + + /* "ssh2/session.pyx":135 + * cdef str auth + * with nogil: + * _auth = c_ssh2.libssh2_userauth_list( # <<<<<<<<<<<<<< + * self._session, _username, username_len) + * if _auth is NULL: + */ + __pyx_v__auth = libssh2_userauth_list(__pyx_v_self->_session, __pyx_v__username, __pyx_v_username_len); + } + + /* "ssh2/session.pyx":134 + * cdef char *_auth + * cdef str auth + * with nogil: # <<<<<<<<<<<<<< + * _auth = c_ssh2.libssh2_userauth_list( + * self._session, _username, username_len) + */ + /*finally:*/ { + /*normal exit:*/{ + #ifdef WITH_THREAD + __Pyx_FastGIL_Forget(); + Py_BLOCK_THREADS + #endif + goto __pyx_L5; + } + __pyx_L5:; + } + } + + /* "ssh2/session.pyx":137 + * _auth = c_ssh2.libssh2_userauth_list( + * self._session, _username, username_len) + * if _auth is NULL: # <<<<<<<<<<<<<< + * return + * auth = to_str(_auth) + */ + __pyx_t_2 = ((__pyx_v__auth == NULL) != 0); + if (__pyx_t_2) { + + /* "ssh2/session.pyx":138 + * self._session, _username, username_len) + * if _auth is NULL: + * return # <<<<<<<<<<<<<< + * auth = to_str(_auth) + * return auth.split(',') + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + /* "ssh2/session.pyx":137 + * _auth = c_ssh2.libssh2_userauth_list( + * self._session, _username, username_len) + * if _auth is NULL: # <<<<<<<<<<<<<< + * return + * auth = to_str(_auth) + */ + } + + /* "ssh2/session.pyx":139 + * if _auth is NULL: + * return + * auth = to_str(_auth) # <<<<<<<<<<<<<< + * return auth.split(',') + * + */ + __pyx_t_3 = __pyx_f_4ssh2_5utils_to_str(__pyx_v__auth); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 139, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (!(likely(PyString_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(0, 139, __pyx_L1_error) + __pyx_v_auth = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "ssh2/session.pyx":140 + * return + * auth = to_str(_auth) + * return auth.split(',') # <<<<<<<<<<<<<< + * + * def userauth_publickey_fromfile(self, username not None, + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_auth, __pyx_n_s_split); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 140, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 140, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "ssh2/session.pyx":126 + * return bool(rc) + * + * def userauth_list(self, username not None): # <<<<<<<<<<<<<< + * """Retrieve available authentication method list. + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("ssh2.session.Session.userauth_list", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_auth); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "ssh2/session.pyx":142 + * return auth.split(',') + * + * def userauth_publickey_fromfile(self, username not None, # <<<<<<<<<<<<<< + * publickey not None, + * privatekey not None, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4ssh2_7session_7Session_23userauth_publickey_fromfile(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_4ssh2_7session_7Session_22userauth_publickey_fromfile[] = "Session.userauth_publickey_fromfile(self, username, publickey, privatekey, passphrase)\nAuthenticate with public key from file.\n\n :rtype: int"; +static PyObject *__pyx_pw_4ssh2_7session_7Session_23userauth_publickey_fromfile(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_username = 0; + PyObject *__pyx_v_publickey = 0; + PyObject *__pyx_v_privatekey = 0; + PyObject *__pyx_v_passphrase = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("userauth_publickey_fromfile (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_username,&__pyx_n_s_publickey,&__pyx_n_s_privatekey,&__pyx_n_s_passphrase,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); @@ -2635,23 +2966,23 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_17userauth_publickey_fromfile( case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_publickey)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("userauth_publickey_fromfile", 1, 4, 4, 1); __PYX_ERR(0, 113, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("userauth_publickey_fromfile", 1, 4, 4, 1); __PYX_ERR(0, 142, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_privatekey)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("userauth_publickey_fromfile", 1, 4, 4, 2); __PYX_ERR(0, 113, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("userauth_publickey_fromfile", 1, 4, 4, 2); __PYX_ERR(0, 142, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_passphrase)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("userauth_publickey_fromfile", 1, 4, 4, 3); __PYX_ERR(0, 113, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("userauth_publickey_fromfile", 1, 4, 4, 3); __PYX_ERR(0, 142, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "userauth_publickey_fromfile") < 0)) __PYX_ERR(0, 113, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "userauth_publickey_fromfile") < 0)) __PYX_ERR(0, 142, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; @@ -2668,25 +2999,25 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_17userauth_publickey_fromfile( } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("userauth_publickey_fromfile", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 113, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("userauth_publickey_fromfile", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 142, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.session.Session.userauth_publickey_fromfile", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(((PyObject *)__pyx_v_username) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "username"); __PYX_ERR(0, 113, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "username"); __PYX_ERR(0, 142, __pyx_L1_error) } if (unlikely(((PyObject *)__pyx_v_publickey) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "publickey"); __PYX_ERR(0, 114, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "publickey"); __PYX_ERR(0, 143, __pyx_L1_error) } if (unlikely(((PyObject *)__pyx_v_privatekey) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "privatekey"); __PYX_ERR(0, 115, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "privatekey"); __PYX_ERR(0, 144, __pyx_L1_error) } if (unlikely(((PyObject *)__pyx_v_passphrase) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "passphrase"); __PYX_ERR(0, 116, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "passphrase"); __PYX_ERR(0, 145, __pyx_L1_error) } - __pyx_r = __pyx_pf_4ssh2_7session_7Session_16userauth_publickey_fromfile(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), __pyx_v_username, __pyx_v_publickey, __pyx_v_privatekey, __pyx_v_passphrase); + __pyx_r = __pyx_pf_4ssh2_7session_7Session_22userauth_publickey_fromfile(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), __pyx_v_username, __pyx_v_publickey, __pyx_v_privatekey, __pyx_v_passphrase); /* function exit code */ goto __pyx_L0; @@ -2697,7 +3028,7 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_17userauth_publickey_fromfile( return __pyx_r; } -static PyObject *__pyx_pf_4ssh2_7session_7Session_16userauth_publickey_fromfile(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, PyObject *__pyx_v_username, PyObject *__pyx_v_publickey, PyObject *__pyx_v_privatekey, PyObject *__pyx_v_passphrase) { +static PyObject *__pyx_pf_4ssh2_7session_7Session_22userauth_publickey_fromfile(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, PyObject *__pyx_v_username, PyObject *__pyx_v_publickey, PyObject *__pyx_v_privatekey, PyObject *__pyx_v_passphrase) { int __pyx_v_rc; char *__pyx_v__username; char *__pyx_v__publickey; @@ -2708,7 +3039,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_16userauth_publickey_fromfile( PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("userauth_publickey_fromfile", 0); - /* "ssh2/session.pyx":121 + /* "ssh2/session.pyx":150 * :rtype: int""" * cdef int rc * cdef char *_username = to_bytes(username) # <<<<<<<<<<<<<< @@ -2717,7 +3048,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_16userauth_publickey_fromfile( */ __pyx_v__username = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_username); - /* "ssh2/session.pyx":122 + /* "ssh2/session.pyx":151 * cdef int rc * cdef char *_username = to_bytes(username) * cdef char *_publickey = to_bytes(publickey) # <<<<<<<<<<<<<< @@ -2726,7 +3057,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_16userauth_publickey_fromfile( */ __pyx_v__publickey = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_publickey); - /* "ssh2/session.pyx":123 + /* "ssh2/session.pyx":152 * cdef char *_username = to_bytes(username) * cdef char *_publickey = to_bytes(publickey) * cdef char *_privatekey = to_bytes(privatekey) # <<<<<<<<<<<<<< @@ -2735,7 +3066,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_16userauth_publickey_fromfile( */ __pyx_v__privatekey = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_privatekey); - /* "ssh2/session.pyx":124 + /* "ssh2/session.pyx":153 * cdef char *_publickey = to_bytes(publickey) * cdef char *_privatekey = to_bytes(privatekey) * cdef char *_passphrase = to_bytes(passphrase) # <<<<<<<<<<<<<< @@ -2744,7 +3075,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_16userauth_publickey_fromfile( */ __pyx_v__passphrase = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_passphrase); - /* "ssh2/session.pyx":125 + /* "ssh2/session.pyx":154 * cdef char *_privatekey = to_bytes(privatekey) * cdef char *_passphrase = to_bytes(passphrase) * with nogil: # <<<<<<<<<<<<<< @@ -2759,7 +3090,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_16userauth_publickey_fromfile( #endif /*try:*/ { - /* "ssh2/session.pyx":126 + /* "ssh2/session.pyx":155 * cdef char *_passphrase = to_bytes(passphrase) * with nogil: * rc = c_ssh2.libssh2_userauth_publickey_fromfile( # <<<<<<<<<<<<<< @@ -2769,7 +3100,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_16userauth_publickey_fromfile( __pyx_v_rc = libssh2_userauth_publickey_fromfile(__pyx_v_self->_session, __pyx_v__username, __pyx_v__publickey, __pyx_v__privatekey, __pyx_v__passphrase); } - /* "ssh2/session.pyx":125 + /* "ssh2/session.pyx":154 * cdef char *_privatekey = to_bytes(privatekey) * cdef char *_passphrase = to_bytes(passphrase) * with nogil: # <<<<<<<<<<<<<< @@ -2788,7 +3119,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_16userauth_publickey_fromfile( } } - /* "ssh2/session.pyx":128 + /* "ssh2/session.pyx":157 * rc = c_ssh2.libssh2_userauth_publickey_fromfile( * self._session, _username, _publickey, _privatekey, _passphrase) * return rc # <<<<<<<<<<<<<< @@ -2796,13 +3127,13 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_16userauth_publickey_fromfile( * def userauth_publickey(self, username not None, */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 128, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":113 + /* "ssh2/session.pyx":142 * return auth.split(',') * * def userauth_publickey_fromfile(self, username not None, # <<<<<<<<<<<<<< @@ -2821,7 +3152,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_16userauth_publickey_fromfile( return __pyx_r; } -/* "ssh2/session.pyx":130 +/* "ssh2/session.pyx":159 * return rc * * def userauth_publickey(self, username not None, # <<<<<<<<<<<<<< @@ -2830,9 +3161,9 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_16userauth_publickey_fromfile( */ /* Python wrapper */ -static PyObject *__pyx_pw_4ssh2_7session_7Session_19userauth_publickey(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_4ssh2_7session_7Session_18userauth_publickey[] = "Session.userauth_publickey(self, username, bytes pubkeydata)\nPerform public key authentication with provided public key data\n\n :param username: User name to authenticate as\n :type username: str\n :param pubkeydata: Public key data\n :type pubkeydata: bytes\n\n :rtype: int\n "; -static PyObject *__pyx_pw_4ssh2_7session_7Session_19userauth_publickey(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_pw_4ssh2_7session_7Session_25userauth_publickey(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_4ssh2_7session_7Session_24userauth_publickey[] = "Session.userauth_publickey(self, username, bytes pubkeydata)\nPerform public key authentication with provided public key data\n\n :param username: User name to authenticate as\n :type username: str\n :param pubkeydata: Public key data\n :type pubkeydata: bytes\n\n :rtype: int\n "; +static PyObject *__pyx_pw_4ssh2_7session_7Session_25userauth_publickey(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_username = 0; PyObject *__pyx_v_pubkeydata = 0; PyObject *__pyx_r = 0; @@ -2861,11 +3192,11 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_19userauth_publickey(PyObject case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pubkeydata)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("userauth_publickey", 1, 2, 2, 1); __PYX_ERR(0, 130, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("userauth_publickey", 1, 2, 2, 1); __PYX_ERR(0, 159, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "userauth_publickey") < 0)) __PYX_ERR(0, 130, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "userauth_publickey") < 0)) __PYX_ERR(0, 159, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -2878,17 +3209,17 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_19userauth_publickey(PyObject } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("userauth_publickey", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 130, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("userauth_publickey", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 159, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.session.Session.userauth_publickey", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(((PyObject *)__pyx_v_username) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "username"); __PYX_ERR(0, 130, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "username"); __PYX_ERR(0, 159, __pyx_L1_error) } - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pubkeydata), (&PyBytes_Type), 0, "pubkeydata", 1))) __PYX_ERR(0, 131, __pyx_L1_error) - __pyx_r = __pyx_pf_4ssh2_7session_7Session_18userauth_publickey(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), __pyx_v_username, __pyx_v_pubkeydata); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pubkeydata), (&PyBytes_Type), 0, "pubkeydata", 1))) __PYX_ERR(0, 160, __pyx_L1_error) + __pyx_r = __pyx_pf_4ssh2_7session_7Session_24userauth_publickey(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), __pyx_v_username, __pyx_v_pubkeydata); /* function exit code */ goto __pyx_L0; @@ -2899,7 +3230,7 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_19userauth_publickey(PyObject return __pyx_r; } -static PyObject *__pyx_pf_4ssh2_7session_7Session_18userauth_publickey(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, PyObject *__pyx_v_username, PyObject *__pyx_v_pubkeydata) { +static PyObject *__pyx_pf_4ssh2_7session_7Session_24userauth_publickey(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, PyObject *__pyx_v_username, PyObject *__pyx_v_pubkeydata) { int __pyx_v_rc; char *__pyx_v__username; unsigned char *__pyx_v__pubkeydata; @@ -2911,7 +3242,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_18userauth_publickey(struct __ PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("userauth_publickey", 0); - /* "ssh2/session.pyx":142 + /* "ssh2/session.pyx":171 * """ * cdef int rc * cdef char *_username = to_bytes(username) # <<<<<<<<<<<<<< @@ -2920,27 +3251,27 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_18userauth_publickey(struct __ */ __pyx_v__username = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_username); - /* "ssh2/session.pyx":143 + /* "ssh2/session.pyx":172 * cdef int rc * cdef char *_username = to_bytes(username) * cdef unsigned char *_pubkeydata = pubkeydata # <<<<<<<<<<<<<< * cdef size_t pubkeydata_len = len(pubkeydata) * with nogil: */ - __pyx_t_1 = __Pyx_PyObject_AsWritableUString(__pyx_v_pubkeydata); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(0, 143, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_AsWritableUString(__pyx_v_pubkeydata); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(0, 172, __pyx_L1_error) __pyx_v__pubkeydata = __pyx_t_1; - /* "ssh2/session.pyx":144 + /* "ssh2/session.pyx":173 * cdef char *_username = to_bytes(username) * cdef unsigned char *_pubkeydata = pubkeydata * cdef size_t pubkeydata_len = len(pubkeydata) # <<<<<<<<<<<<<< * with nogil: * rc = c_ssh2.libssh2_userauth_publickey( */ - __pyx_t_2 = PyBytes_GET_SIZE(__pyx_v_pubkeydata); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 144, __pyx_L1_error) + __pyx_t_2 = PyBytes_GET_SIZE(__pyx_v_pubkeydata); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 173, __pyx_L1_error) __pyx_v_pubkeydata_len = __pyx_t_2; - /* "ssh2/session.pyx":145 + /* "ssh2/session.pyx":174 * cdef unsigned char *_pubkeydata = pubkeydata * cdef size_t pubkeydata_len = len(pubkeydata) * with nogil: # <<<<<<<<<<<<<< @@ -2955,7 +3286,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_18userauth_publickey(struct __ #endif /*try:*/ { - /* "ssh2/session.pyx":146 + /* "ssh2/session.pyx":175 * cdef size_t pubkeydata_len = len(pubkeydata) * with nogil: * rc = c_ssh2.libssh2_userauth_publickey( # <<<<<<<<<<<<<< @@ -2965,7 +3296,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_18userauth_publickey(struct __ __pyx_v_rc = libssh2_userauth_publickey(__pyx_v_self->_session, __pyx_v__username, __pyx_v__pubkeydata, __pyx_v_pubkeydata_len, NULL, NULL); } - /* "ssh2/session.pyx":145 + /* "ssh2/session.pyx":174 * cdef unsigned char *_pubkeydata = pubkeydata * cdef size_t pubkeydata_len = len(pubkeydata) * with nogil: # <<<<<<<<<<<<<< @@ -2984,7 +3315,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_18userauth_publickey(struct __ } } - /* "ssh2/session.pyx":149 + /* "ssh2/session.pyx":178 * self._session, _username, _pubkeydata, * pubkeydata_len, NULL, NULL) * return rc # <<<<<<<<<<<<<< @@ -2992,13 +3323,13 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_18userauth_publickey(struct __ * def userauth_hostbased_fromfile(self, */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 149, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 178, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":130 + /* "ssh2/session.pyx":159 * return rc * * def userauth_publickey(self, username not None, # <<<<<<<<<<<<<< @@ -3017,7 +3348,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_18userauth_publickey(struct __ return __pyx_r; } -/* "ssh2/session.pyx":151 +/* "ssh2/session.pyx":180 * return rc * * def userauth_hostbased_fromfile(self, # <<<<<<<<<<<<<< @@ -3026,9 +3357,9 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_18userauth_publickey(struct __ */ /* Python wrapper */ -static PyObject *__pyx_pw_4ssh2_7session_7Session_21userauth_hostbased_fromfile(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_4ssh2_7session_7Session_20userauth_hostbased_fromfile[] = "Session.userauth_hostbased_fromfile(self, username, publickey, privatekey, passphrase, hostname)"; -static PyObject *__pyx_pw_4ssh2_7session_7Session_21userauth_hostbased_fromfile(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_pw_4ssh2_7session_7Session_27userauth_hostbased_fromfile(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_4ssh2_7session_7Session_26userauth_hostbased_fromfile[] = "Session.userauth_hostbased_fromfile(self, username, publickey, privatekey, passphrase, hostname)"; +static PyObject *__pyx_pw_4ssh2_7session_7Session_27userauth_hostbased_fromfile(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_username = 0; PyObject *__pyx_v_publickey = 0; PyObject *__pyx_v_privatekey = 0; @@ -3066,29 +3397,29 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_21userauth_hostbased_fromfile( case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_publickey)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("userauth_hostbased_fromfile", 1, 5, 5, 1); __PYX_ERR(0, 151, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("userauth_hostbased_fromfile", 1, 5, 5, 1); __PYX_ERR(0, 180, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_privatekey)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("userauth_hostbased_fromfile", 1, 5, 5, 2); __PYX_ERR(0, 151, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("userauth_hostbased_fromfile", 1, 5, 5, 2); __PYX_ERR(0, 180, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_passphrase)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("userauth_hostbased_fromfile", 1, 5, 5, 3); __PYX_ERR(0, 151, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("userauth_hostbased_fromfile", 1, 5, 5, 3); __PYX_ERR(0, 180, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_hostname)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("userauth_hostbased_fromfile", 1, 5, 5, 4); __PYX_ERR(0, 151, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("userauth_hostbased_fromfile", 1, 5, 5, 4); __PYX_ERR(0, 180, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "userauth_hostbased_fromfile") < 0)) __PYX_ERR(0, 151, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "userauth_hostbased_fromfile") < 0)) __PYX_ERR(0, 180, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 5) { goto __pyx_L5_argtuple_error; @@ -3107,28 +3438,28 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_21userauth_hostbased_fromfile( } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("userauth_hostbased_fromfile", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 151, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("userauth_hostbased_fromfile", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 180, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.session.Session.userauth_hostbased_fromfile", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(((PyObject *)__pyx_v_username) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "username"); __PYX_ERR(0, 152, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "username"); __PYX_ERR(0, 181, __pyx_L1_error) } if (unlikely(((PyObject *)__pyx_v_publickey) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "publickey"); __PYX_ERR(0, 153, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "publickey"); __PYX_ERR(0, 182, __pyx_L1_error) } if (unlikely(((PyObject *)__pyx_v_privatekey) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "privatekey"); __PYX_ERR(0, 154, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "privatekey"); __PYX_ERR(0, 183, __pyx_L1_error) } if (unlikely(((PyObject *)__pyx_v_passphrase) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "passphrase"); __PYX_ERR(0, 155, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "passphrase"); __PYX_ERR(0, 184, __pyx_L1_error) } if (unlikely(((PyObject *)__pyx_v_hostname) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "hostname"); __PYX_ERR(0, 156, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "hostname"); __PYX_ERR(0, 185, __pyx_L1_error) } - __pyx_r = __pyx_pf_4ssh2_7session_7Session_20userauth_hostbased_fromfile(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), __pyx_v_username, __pyx_v_publickey, __pyx_v_privatekey, __pyx_v_passphrase, __pyx_v_hostname); + __pyx_r = __pyx_pf_4ssh2_7session_7Session_26userauth_hostbased_fromfile(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), __pyx_v_username, __pyx_v_publickey, __pyx_v_privatekey, __pyx_v_passphrase, __pyx_v_hostname); /* function exit code */ goto __pyx_L0; @@ -3139,7 +3470,7 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_21userauth_hostbased_fromfile( return __pyx_r; } -static PyObject *__pyx_pf_4ssh2_7session_7Session_20userauth_hostbased_fromfile(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, PyObject *__pyx_v_username, PyObject *__pyx_v_publickey, PyObject *__pyx_v_privatekey, PyObject *__pyx_v_passphrase, PyObject *__pyx_v_hostname) { +static PyObject *__pyx_pf_4ssh2_7session_7Session_26userauth_hostbased_fromfile(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, PyObject *__pyx_v_username, PyObject *__pyx_v_publickey, PyObject *__pyx_v_privatekey, PyObject *__pyx_v_passphrase, PyObject *__pyx_v_hostname) { int __pyx_v_rc; char *__pyx_v__username; char *__pyx_v__publickey; @@ -3151,7 +3482,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_20userauth_hostbased_fromfile( PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("userauth_hostbased_fromfile", 0); - /* "ssh2/session.pyx":158 + /* "ssh2/session.pyx":187 * hostname not None): * cdef int rc * cdef char *_username = to_bytes(username) # <<<<<<<<<<<<<< @@ -3160,7 +3491,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_20userauth_hostbased_fromfile( */ __pyx_v__username = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_username); - /* "ssh2/session.pyx":159 + /* "ssh2/session.pyx":188 * cdef int rc * cdef char *_username = to_bytes(username) * cdef char *_publickey = to_bytes(publickey) # <<<<<<<<<<<<<< @@ -3169,7 +3500,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_20userauth_hostbased_fromfile( */ __pyx_v__publickey = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_publickey); - /* "ssh2/session.pyx":160 + /* "ssh2/session.pyx":189 * cdef char *_username = to_bytes(username) * cdef char *_publickey = to_bytes(publickey) * cdef char *_privatekey = to_bytes(privatekey) # <<<<<<<<<<<<<< @@ -3178,7 +3509,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_20userauth_hostbased_fromfile( */ __pyx_v__privatekey = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_privatekey); - /* "ssh2/session.pyx":161 + /* "ssh2/session.pyx":190 * cdef char *_publickey = to_bytes(publickey) * cdef char *_privatekey = to_bytes(privatekey) * cdef char *_passphrase = to_bytes(passphrase) # <<<<<<<<<<<<<< @@ -3187,7 +3518,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_20userauth_hostbased_fromfile( */ __pyx_v__passphrase = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_passphrase); - /* "ssh2/session.pyx":162 + /* "ssh2/session.pyx":191 * cdef char *_privatekey = to_bytes(privatekey) * cdef char *_passphrase = to_bytes(passphrase) * cdef char *_hostname = to_bytes(hostname) # <<<<<<<<<<<<<< @@ -3196,7 +3527,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_20userauth_hostbased_fromfile( */ __pyx_v__hostname = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_hostname); - /* "ssh2/session.pyx":163 + /* "ssh2/session.pyx":192 * cdef char *_passphrase = to_bytes(passphrase) * cdef char *_hostname = to_bytes(hostname) * with nogil: # <<<<<<<<<<<<<< @@ -3211,7 +3542,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_20userauth_hostbased_fromfile( #endif /*try:*/ { - /* "ssh2/session.pyx":164 + /* "ssh2/session.pyx":193 * cdef char *_hostname = to_bytes(hostname) * with nogil: * rc = c_ssh2.libssh2_userauth_hostbased_fromfile( # <<<<<<<<<<<<<< @@ -3221,7 +3552,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_20userauth_hostbased_fromfile( __pyx_v_rc = libssh2_userauth_hostbased_fromfile(__pyx_v_self->_session, __pyx_v__username, __pyx_v__publickey, __pyx_v__privatekey, __pyx_v__passphrase, __pyx_v__hostname); } - /* "ssh2/session.pyx":163 + /* "ssh2/session.pyx":192 * cdef char *_passphrase = to_bytes(passphrase) * cdef char *_hostname = to_bytes(hostname) * with nogil: # <<<<<<<<<<<<<< @@ -3240,7 +3571,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_20userauth_hostbased_fromfile( } } - /* "ssh2/session.pyx":167 + /* "ssh2/session.pyx":196 * self._session, _username, _publickey, * _privatekey, _passphrase, _hostname) * return rc # <<<<<<<<<<<<<< @@ -3248,13 +3579,13 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_20userauth_hostbased_fromfile( * # def userauth_publickey_frommemory(self, */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 167, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":151 + /* "ssh2/session.pyx":180 * return rc * * def userauth_hostbased_fromfile(self, # <<<<<<<<<<<<<< @@ -3273,7 +3604,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_20userauth_hostbased_fromfile( return __pyx_r; } -/* "ssh2/session.pyx":185 +/* "ssh2/session.pyx":214 * # return rc * * def userauth_password(self, username not None, password not None): # <<<<<<<<<<<<<< @@ -3282,9 +3613,9 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_20userauth_hostbased_fromfile( */ /* Python wrapper */ -static PyObject *__pyx_pw_4ssh2_7session_7Session_23userauth_password(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_4ssh2_7session_7Session_22userauth_password[] = "Session.userauth_password(self, username, password)\nPerform password authentication\n\n :param username: User name to authenticate.\n :type username: str\n :param password: Password\n :type password: str"; -static PyObject *__pyx_pw_4ssh2_7session_7Session_23userauth_password(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_pw_4ssh2_7session_7Session_29userauth_password(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_4ssh2_7session_7Session_28userauth_password[] = "Session.userauth_password(self, username, password)\nPerform password authentication\n\n :param username: User name to authenticate.\n :type username: str\n :param password: Password\n :type password: str"; +static PyObject *__pyx_pw_4ssh2_7session_7Session_29userauth_password(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_username = 0; PyObject *__pyx_v_password = 0; PyObject *__pyx_r = 0; @@ -3313,11 +3644,11 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_23userauth_password(PyObject * case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_password)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("userauth_password", 1, 2, 2, 1); __PYX_ERR(0, 185, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("userauth_password", 1, 2, 2, 1); __PYX_ERR(0, 214, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "userauth_password") < 0)) __PYX_ERR(0, 185, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "userauth_password") < 0)) __PYX_ERR(0, 214, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -3330,19 +3661,19 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_23userauth_password(PyObject * } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("userauth_password", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 185, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("userauth_password", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 214, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.session.Session.userauth_password", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(((PyObject *)__pyx_v_username) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "username"); __PYX_ERR(0, 185, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "username"); __PYX_ERR(0, 214, __pyx_L1_error) } if (unlikely(((PyObject *)__pyx_v_password) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "password"); __PYX_ERR(0, 185, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "password"); __PYX_ERR(0, 214, __pyx_L1_error) } - __pyx_r = __pyx_pf_4ssh2_7session_7Session_22userauth_password(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), __pyx_v_username, __pyx_v_password); + __pyx_r = __pyx_pf_4ssh2_7session_7Session_28userauth_password(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), __pyx_v_username, __pyx_v_password); /* function exit code */ goto __pyx_L0; @@ -3353,7 +3684,7 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_23userauth_password(PyObject * return __pyx_r; } -static PyObject *__pyx_pf_4ssh2_7session_7Session_22userauth_password(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, PyObject *__pyx_v_username, PyObject *__pyx_v_password) { +static PyObject *__pyx_pf_4ssh2_7session_7Session_28userauth_password(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, PyObject *__pyx_v_username, PyObject *__pyx_v_password) { int __pyx_v_rc; char const *__pyx_v__username; char const *__pyx_v__password; @@ -3362,7 +3693,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_22userauth_password(struct __p PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("userauth_password", 0); - /* "ssh2/session.pyx":193 + /* "ssh2/session.pyx":222 * :type password: str""" * cdef int rc * cdef const char *_username = to_bytes(username) # <<<<<<<<<<<<<< @@ -3371,7 +3702,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_22userauth_password(struct __p */ __pyx_v__username = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_username); - /* "ssh2/session.pyx":194 + /* "ssh2/session.pyx":223 * cdef int rc * cdef const char *_username = to_bytes(username) * cdef const char *_password = to_bytes(password) # <<<<<<<<<<<<<< @@ -3380,7 +3711,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_22userauth_password(struct __p */ __pyx_v__password = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_password); - /* "ssh2/session.pyx":195 + /* "ssh2/session.pyx":224 * cdef const char *_username = to_bytes(username) * cdef const char *_password = to_bytes(password) * with nogil: # <<<<<<<<<<<<<< @@ -3395,7 +3726,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_22userauth_password(struct __p #endif /*try:*/ { - /* "ssh2/session.pyx":196 + /* "ssh2/session.pyx":225 * cdef const char *_password = to_bytes(password) * with nogil: * rc = c_ssh2.libssh2_userauth_password( # <<<<<<<<<<<<<< @@ -3405,7 +3736,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_22userauth_password(struct __p __pyx_v_rc = libssh2_userauth_password(__pyx_v_self->_session, __pyx_v__username, __pyx_v__password); } - /* "ssh2/session.pyx":195 + /* "ssh2/session.pyx":224 * cdef const char *_username = to_bytes(username) * cdef const char *_password = to_bytes(password) * with nogil: # <<<<<<<<<<<<<< @@ -3424,7 +3755,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_22userauth_password(struct __p } } - /* "ssh2/session.pyx":198 + /* "ssh2/session.pyx":227 * rc = c_ssh2.libssh2_userauth_password( * self._session, _username, _password) * return rc # <<<<<<<<<<<<<< @@ -3432,13 +3763,13 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_22userauth_password(struct __p * def agent_init(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 198, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":185 + /* "ssh2/session.pyx":214 * # return rc * * def userauth_password(self, username not None, password not None): # <<<<<<<<<<<<<< @@ -3457,7 +3788,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_22userauth_password(struct __p return __pyx_r; } -/* "ssh2/session.pyx":200 +/* "ssh2/session.pyx":229 * return rc * * def agent_init(self): # <<<<<<<<<<<<<< @@ -3466,20 +3797,20 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_22userauth_password(struct __p */ /* Python wrapper */ -static PyObject *__pyx_pw_4ssh2_7session_7Session_25agent_init(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static char __pyx_doc_4ssh2_7session_7Session_24agent_init[] = "Session.agent_init(self)\nInitialise SSH agent.\n\n :rtype: :py:class:`ssh2.agent.Agent`\n "; -static PyObject *__pyx_pw_4ssh2_7session_7Session_25agent_init(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { +static PyObject *__pyx_pw_4ssh2_7session_7Session_31agent_init(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_4ssh2_7session_7Session_30agent_init[] = "Session.agent_init(self)\nInitialise SSH agent.\n\n :rtype: :py:class:`ssh2.agent.Agent`\n "; +static PyObject *__pyx_pw_4ssh2_7session_7Session_31agent_init(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("agent_init (wrapper)", 0); - __pyx_r = __pyx_pf_4ssh2_7session_7Session_24agent_init(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self)); + __pyx_r = __pyx_pf_4ssh2_7session_7Session_30agent_init(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_4ssh2_7session_7Session_24agent_init(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self) { +static PyObject *__pyx_pf_4ssh2_7session_7Session_30agent_init(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self) { LIBSSH2_AGENT *__pyx_v_agent; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -3487,7 +3818,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_24agent_init(struct __pyx_obj_ PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("agent_init", 0); - /* "ssh2/session.pyx":205 + /* "ssh2/session.pyx":234 * :rtype: :py:class:`ssh2.agent.Agent` * """ * cdef c_ssh2.LIBSSH2_AGENT *agent = self._agent_init() # <<<<<<<<<<<<<< @@ -3496,7 +3827,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_24agent_init(struct __pyx_obj_ */ __pyx_v_agent = ((struct __pyx_vtabstruct_4ssh2_7session_Session *)__pyx_v_self->__pyx_vtab)->_agent_init(__pyx_v_self); - /* "ssh2/session.pyx":206 + /* "ssh2/session.pyx":235 * """ * cdef c_ssh2.LIBSSH2_AGENT *agent = self._agent_init() * if agent is NULL: # <<<<<<<<<<<<<< @@ -3506,7 +3837,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_24agent_init(struct __pyx_obj_ __pyx_t_1 = ((__pyx_v_agent == NULL) != 0); if (__pyx_t_1) { - /* "ssh2/session.pyx":207 + /* "ssh2/session.pyx":236 * cdef c_ssh2.LIBSSH2_AGENT *agent = self._agent_init() * if agent is NULL: * return # <<<<<<<<<<<<<< @@ -3517,7 +3848,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_24agent_init(struct __pyx_obj_ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "ssh2/session.pyx":206 + /* "ssh2/session.pyx":235 * """ * cdef c_ssh2.LIBSSH2_AGENT *agent = self._agent_init() * if agent is NULL: # <<<<<<<<<<<<<< @@ -3526,7 +3857,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_24agent_init(struct __pyx_obj_ */ } - /* "ssh2/session.pyx":208 + /* "ssh2/session.pyx":237 * if agent is NULL: * return * return PyAgent(agent, self) # <<<<<<<<<<<<<< @@ -3534,13 +3865,13 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_24agent_init(struct __pyx_obj_ * cdef c_ssh2.LIBSSH2_AGENT * _agent_init(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __pyx_f_4ssh2_5agent_PyAgent(__pyx_v_agent, __pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 208, __pyx_L1_error) + __pyx_t_2 = __pyx_f_4ssh2_5agent_PyAgent(__pyx_v_agent, __pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":200 + /* "ssh2/session.pyx":229 * return rc * * def agent_init(self): # <<<<<<<<<<<<<< @@ -3559,7 +3890,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_24agent_init(struct __pyx_obj_ return __pyx_r; } -/* "ssh2/session.pyx":210 +/* "ssh2/session.pyx":239 * return PyAgent(agent, self) * * cdef c_ssh2.LIBSSH2_AGENT * _agent_init(self): # <<<<<<<<<<<<<< @@ -3574,7 +3905,7 @@ static LIBSSH2_AGENT *__pyx_f_4ssh2_7session_7Session__agent_init(struct __pyx_o int __pyx_t_1; __Pyx_RefNannySetupContext("_agent_init", 0); - /* "ssh2/session.pyx":212 + /* "ssh2/session.pyx":241 * cdef c_ssh2.LIBSSH2_AGENT * _agent_init(self): * cdef c_ssh2.LIBSSH2_AGENT *agent * with nogil: # <<<<<<<<<<<<<< @@ -3589,7 +3920,7 @@ static LIBSSH2_AGENT *__pyx_f_4ssh2_7session_7Session__agent_init(struct __pyx_o #endif /*try:*/ { - /* "ssh2/session.pyx":213 + /* "ssh2/session.pyx":242 * cdef c_ssh2.LIBSSH2_AGENT *agent * with nogil: * agent = c_ssh2.libssh2_agent_init(self._session) # <<<<<<<<<<<<<< @@ -3598,7 +3929,7 @@ static LIBSSH2_AGENT *__pyx_f_4ssh2_7session_7Session__agent_init(struct __pyx_o */ __pyx_v_agent = libssh2_agent_init(__pyx_v_self->_session); - /* "ssh2/session.pyx":214 + /* "ssh2/session.pyx":243 * with nogil: * agent = c_ssh2.libssh2_agent_init(self._session) * if agent is NULL: # <<<<<<<<<<<<<< @@ -3608,7 +3939,7 @@ static LIBSSH2_AGENT *__pyx_f_4ssh2_7session_7Session__agent_init(struct __pyx_o __pyx_t_1 = ((__pyx_v_agent == NULL) != 0); if (__pyx_t_1) { - /* "ssh2/session.pyx":215 + /* "ssh2/session.pyx":244 * agent = c_ssh2.libssh2_agent_init(self._session) * if agent is NULL: * with gil: # <<<<<<<<<<<<<< @@ -3621,17 +3952,17 @@ static LIBSSH2_AGENT *__pyx_f_4ssh2_7session_7Session__agent_init(struct __pyx_o #endif /*try:*/ { - /* "ssh2/session.pyx":216 + /* "ssh2/session.pyx":245 * if agent is NULL: * with gil: * raise MemoryError # <<<<<<<<<<<<<< * return agent * */ - PyErr_NoMemory(); __PYX_ERR(0, 216, __pyx_L8_error) + PyErr_NoMemory(); __PYX_ERR(0, 245, __pyx_L8_error) } - /* "ssh2/session.pyx":215 + /* "ssh2/session.pyx":244 * agent = c_ssh2.libssh2_agent_init(self._session) * if agent is NULL: * with gil: # <<<<<<<<<<<<<< @@ -3648,7 +3979,7 @@ static LIBSSH2_AGENT *__pyx_f_4ssh2_7session_7Session__agent_init(struct __pyx_o } } - /* "ssh2/session.pyx":214 + /* "ssh2/session.pyx":243 * with nogil: * agent = c_ssh2.libssh2_agent_init(self._session) * if agent is NULL: # <<<<<<<<<<<<<< @@ -3657,7 +3988,7 @@ static LIBSSH2_AGENT *__pyx_f_4ssh2_7session_7Session__agent_init(struct __pyx_o */ } - /* "ssh2/session.pyx":217 + /* "ssh2/session.pyx":246 * with gil: * raise MemoryError * return agent # <<<<<<<<<<<<<< @@ -3668,7 +3999,7 @@ static LIBSSH2_AGENT *__pyx_f_4ssh2_7session_7Session__agent_init(struct __pyx_o goto __pyx_L3_return; } - /* "ssh2/session.pyx":212 + /* "ssh2/session.pyx":241 * cdef c_ssh2.LIBSSH2_AGENT * _agent_init(self): * cdef c_ssh2.LIBSSH2_AGENT *agent * with nogil: # <<<<<<<<<<<<<< @@ -3693,7 +4024,7 @@ static LIBSSH2_AGENT *__pyx_f_4ssh2_7session_7Session__agent_init(struct __pyx_o } } - /* "ssh2/session.pyx":210 + /* "ssh2/session.pyx":239 * return PyAgent(agent, self) * * cdef c_ssh2.LIBSSH2_AGENT * _agent_init(self): # <<<<<<<<<<<<<< @@ -3710,7 +4041,7 @@ static LIBSSH2_AGENT *__pyx_f_4ssh2_7session_7Session__agent_init(struct __pyx_o return __pyx_r; } -/* "ssh2/session.pyx":219 +/* "ssh2/session.pyx":248 * return agent * * cdef c_ssh2.LIBSSH2_AGENT * init_connect_agent(self) nogil except NULL: # <<<<<<<<<<<<<< @@ -3732,7 +4063,7 @@ static LIBSSH2_AGENT *__pyx_f_4ssh2_7session_7Session_init_connect_agent(struct __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif - /* "ssh2/session.pyx":220 + /* "ssh2/session.pyx":249 * * cdef c_ssh2.LIBSSH2_AGENT * init_connect_agent(self) nogil except NULL: * agent = c_ssh2.libssh2_agent_init(self._session) # <<<<<<<<<<<<<< @@ -3742,7 +4073,7 @@ static LIBSSH2_AGENT *__pyx_f_4ssh2_7session_7Session_init_connect_agent(struct /*try:*/ { __pyx_v_agent = libssh2_agent_init(__pyx_v_self->_session); - /* "ssh2/session.pyx":221 + /* "ssh2/session.pyx":250 * cdef c_ssh2.LIBSSH2_AGENT * init_connect_agent(self) nogil except NULL: * agent = c_ssh2.libssh2_agent_init(self._session) * if agent is NULL: # <<<<<<<<<<<<<< @@ -3752,7 +4083,7 @@ static LIBSSH2_AGENT *__pyx_f_4ssh2_7session_7Session_init_connect_agent(struct __pyx_t_1 = ((__pyx_v_agent == NULL) != 0); if (__pyx_t_1) { - /* "ssh2/session.pyx":222 + /* "ssh2/session.pyx":251 * agent = c_ssh2.libssh2_agent_init(self._session) * if agent is NULL: * with gil: # <<<<<<<<<<<<<< @@ -3765,17 +4096,17 @@ static LIBSSH2_AGENT *__pyx_f_4ssh2_7session_7Session_init_connect_agent(struct #endif /*try:*/ { - /* "ssh2/session.pyx":223 + /* "ssh2/session.pyx":252 * if agent is NULL: * with gil: * raise MemoryError # <<<<<<<<<<<<<< * if c_ssh2.libssh2_agent_connect(agent) != 0: * c_ssh2.libssh2_agent_free(agent) */ - PyErr_NoMemory(); __PYX_ERR(0, 223, __pyx_L8_error) + PyErr_NoMemory(); __PYX_ERR(0, 252, __pyx_L8_error) } - /* "ssh2/session.pyx":222 + /* "ssh2/session.pyx":251 * agent = c_ssh2.libssh2_agent_init(self._session) * if agent is NULL: * with gil: # <<<<<<<<<<<<<< @@ -3792,7 +4123,7 @@ static LIBSSH2_AGENT *__pyx_f_4ssh2_7session_7Session_init_connect_agent(struct } } - /* "ssh2/session.pyx":221 + /* "ssh2/session.pyx":250 * cdef c_ssh2.LIBSSH2_AGENT * init_connect_agent(self) nogil except NULL: * agent = c_ssh2.libssh2_agent_init(self._session) * if agent is NULL: # <<<<<<<<<<<<<< @@ -3801,7 +4132,7 @@ static LIBSSH2_AGENT *__pyx_f_4ssh2_7session_7Session_init_connect_agent(struct */ } - /* "ssh2/session.pyx":224 + /* "ssh2/session.pyx":253 * with gil: * raise MemoryError * if c_ssh2.libssh2_agent_connect(agent) != 0: # <<<<<<<<<<<<<< @@ -3811,20 +4142,20 @@ static LIBSSH2_AGENT *__pyx_f_4ssh2_7session_7Session_init_connect_agent(struct __pyx_t_1 = ((libssh2_agent_connect(__pyx_v_agent) != 0) != 0); if (__pyx_t_1) { - /* "ssh2/session.pyx":225 + /* "ssh2/session.pyx":254 * raise MemoryError * if c_ssh2.libssh2_agent_connect(agent) != 0: * c_ssh2.libssh2_agent_free(agent) # <<<<<<<<<<<<<< * with gil: - * raise AgentConnectError("Unable to connect to agent") + * raise AgentConnectionError("Unable to connect to agent") */ libssh2_agent_free(__pyx_v_agent); - /* "ssh2/session.pyx":226 + /* "ssh2/session.pyx":255 * if c_ssh2.libssh2_agent_connect(agent) != 0: * c_ssh2.libssh2_agent_free(agent) * with gil: # <<<<<<<<<<<<<< - * raise AgentConnectError("Unable to connect to agent") + * raise AgentConnectionError("Unable to connect to agent") * return agent */ { @@ -3833,25 +4164,25 @@ static LIBSSH2_AGENT *__pyx_f_4ssh2_7session_7Session_init_connect_agent(struct #endif /*try:*/ { - /* "ssh2/session.pyx":227 + /* "ssh2/session.pyx":256 * c_ssh2.libssh2_agent_free(agent) * with gil: - * raise AgentConnectError("Unable to connect to agent") # <<<<<<<<<<<<<< + * raise AgentConnectionError("Unable to connect to agent") # <<<<<<<<<<<<<< * return agent * */ - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4ssh2_10exceptions_AgentConnectError), __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 227, __pyx_L12_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4ssh2_10exceptions_AgentConnectionError), __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 256, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 227, __pyx_L12_error) + __PYX_ERR(0, 256, __pyx_L12_error) } - /* "ssh2/session.pyx":226 + /* "ssh2/session.pyx":255 * if c_ssh2.libssh2_agent_connect(agent) != 0: * c_ssh2.libssh2_agent_free(agent) * with gil: # <<<<<<<<<<<<<< - * raise AgentConnectError("Unable to connect to agent") + * raise AgentConnectionError("Unable to connect to agent") * return agent */ /*finally:*/ { @@ -3864,7 +4195,7 @@ static LIBSSH2_AGENT *__pyx_f_4ssh2_7session_7Session_init_connect_agent(struct } } - /* "ssh2/session.pyx":224 + /* "ssh2/session.pyx":253 * with gil: * raise MemoryError * if c_ssh2.libssh2_agent_connect(agent) != 0: # <<<<<<<<<<<<<< @@ -3873,9 +4204,9 @@ static LIBSSH2_AGENT *__pyx_f_4ssh2_7session_7Session_init_connect_agent(struct */ } - /* "ssh2/session.pyx":228 + /* "ssh2/session.pyx":257 * with gil: - * raise AgentConnectError("Unable to connect to agent") + * raise AgentConnectionError("Unable to connect to agent") * return agent # <<<<<<<<<<<<<< * * def agent_auth(self, username not None): @@ -3884,7 +4215,7 @@ static LIBSSH2_AGENT *__pyx_f_4ssh2_7session_7Session_init_connect_agent(struct goto __pyx_L3_return; } - /* "ssh2/session.pyx":220 + /* "ssh2/session.pyx":249 * * cdef c_ssh2.LIBSSH2_AGENT * init_connect_agent(self) nogil except NULL: * agent = c_ssh2.libssh2_agent_init(self._session) # <<<<<<<<<<<<<< @@ -3906,7 +4237,7 @@ static LIBSSH2_AGENT *__pyx_f_4ssh2_7session_7Session_init_connect_agent(struct } } - /* "ssh2/session.pyx":219 + /* "ssh2/session.pyx":248 * return agent * * cdef c_ssh2.LIBSSH2_AGENT * init_connect_agent(self) nogil except NULL: # <<<<<<<<<<<<<< @@ -3928,7 +4259,7 @@ static LIBSSH2_AGENT *__pyx_f_4ssh2_7session_7Session_init_connect_agent(struct return __pyx_r; } -/* "ssh2/session.pyx":230 +/* "ssh2/session.pyx":259 * return agent * * def agent_auth(self, username not None): # <<<<<<<<<<<<<< @@ -3937,16 +4268,16 @@ static LIBSSH2_AGENT *__pyx_f_4ssh2_7session_7Session_init_connect_agent(struct */ /* Python wrapper */ -static PyObject *__pyx_pw_4ssh2_7session_7Session_27agent_auth(PyObject *__pyx_v_self, PyObject *__pyx_v_username); /*proto*/ -static char __pyx_doc_4ssh2_7session_7Session_26agent_auth[] = "Session.agent_auth(self, username)\nConvenience function for performing user authentication via SSH Agent.\n\n Initialises, connects to, gets list of identities from and attempts\n authentication with each identity from SSH agent.\n\n Note that agent connections cannot be used in non-blocking mode -\n clients should call `setblocking(0)` _after_ calling this function.\n\n On completion, or any errors, agent is disconnected and resources freed.\n\n All steps are performed in C space which makes this function perform\n better than calling the individual Agent class functions from\n Python.\n\n :raises: :py:class:`MemoryError` on error initialising agent\n :raises: :py:class:`ssh2.exceptions.AgentConnectError` on error\n connecting to agent\n :raises: :py:class:`ssh2.exceptions.AgentListIdentitiesError` on error\n getting identities from agent\n :raises: :py:class:`ssh2.exceptions.AgentAuthenticationFailure` on no\n successful authentication with\n all available identities\n :raises: :py:class:`ssh2.exceptions.AgentGetIdentityError` on error\n getting known identity from agent\n\n :rtype: None\n "; -static PyObject *__pyx_pw_4ssh2_7session_7Session_27agent_auth(PyObject *__pyx_v_self, PyObject *__pyx_v_username) { +static PyObject *__pyx_pw_4ssh2_7session_7Session_33agent_auth(PyObject *__pyx_v_self, PyObject *__pyx_v_username); /*proto*/ +static char __pyx_doc_4ssh2_7session_7Session_32agent_auth[] = "Session.agent_auth(self, username)\nConvenience function for performing user authentication via SSH Agent.\n\n Initialises, connects to, gets list of identities from and attempts\n authentication with each identity from SSH agent.\n\n Note that agent connections cannot be used in non-blocking mode -\n clients should call `setblocking(0)` _after_ calling this function.\n\n On completion, or any errors, agent is disconnected and resources freed.\n\n All steps are performed in C space which makes this function perform\n better than calling the individual Agent class functions from\n Python.\n\n :raises: :py:class:`MemoryError` on error initialising agent\n :raises: :py:class:`ssh2.exceptions.AgentConnectError` on error\n connecting to agent\n :raises: :py:class:`ssh2.exceptions.AgentListIdentitiesError` on error\n getting identities from agent\n :raises: :py:class:`ssh2.exceptions.AgentAuthenticationFailure` on no\n successful authentication with\n all available identities\n :raises: :py:class:`ssh2.exceptions.AgentGetIdentityError` on error\n getting known identity from agent\n\n :rtype: None\n "; +static PyObject *__pyx_pw_4ssh2_7session_7Session_33agent_auth(PyObject *__pyx_v_self, PyObject *__pyx_v_username) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("agent_auth (wrapper)", 0); if (unlikely(((PyObject *)__pyx_v_username) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "username"); __PYX_ERR(0, 230, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "username"); __PYX_ERR(0, 259, __pyx_L1_error) } - __pyx_r = __pyx_pf_4ssh2_7session_7Session_26agent_auth(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), ((PyObject *)__pyx_v_username)); + __pyx_r = __pyx_pf_4ssh2_7session_7Session_32agent_auth(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), ((PyObject *)__pyx_v_username)); /* function exit code */ goto __pyx_L0; @@ -3957,7 +4288,7 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_27agent_auth(PyObject *__pyx_v return __pyx_r; } -static PyObject *__pyx_pf_4ssh2_7session_7Session_26agent_auth(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, PyObject *__pyx_v_username) { +static PyObject *__pyx_pf_4ssh2_7session_7Session_32agent_auth(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, PyObject *__pyx_v_username) { char *__pyx_v__username; LIBSSH2_AGENT *__pyx_v_agent; struct libssh2_agent_publickey *__pyx_v_identity; @@ -3970,7 +4301,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_26agent_auth(struct __pyx_obj_ int __pyx_t_4; __Pyx_RefNannySetupContext("agent_auth", 0); - /* "ssh2/session.pyx":258 + /* "ssh2/session.pyx":287 * :rtype: None * """ * cdef char *_username = to_bytes(username) # <<<<<<<<<<<<<< @@ -3979,7 +4310,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_26agent_auth(struct __pyx_obj_ */ __pyx_v__username = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_username); - /* "ssh2/session.pyx":259 + /* "ssh2/session.pyx":288 * """ * cdef char *_username = to_bytes(username) * cdef c_ssh2.LIBSSH2_AGENT *agent = NULL # <<<<<<<<<<<<<< @@ -3988,7 +4319,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_26agent_auth(struct __pyx_obj_ */ __pyx_v_agent = NULL; - /* "ssh2/session.pyx":260 + /* "ssh2/session.pyx":289 * cdef char *_username = to_bytes(username) * cdef c_ssh2.LIBSSH2_AGENT *agent = NULL * cdef c_ssh2.libssh2_agent_publickey *identity = NULL # <<<<<<<<<<<<<< @@ -3997,7 +4328,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_26agent_auth(struct __pyx_obj_ */ __pyx_v_identity = NULL; - /* "ssh2/session.pyx":261 + /* "ssh2/session.pyx":290 * cdef c_ssh2.LIBSSH2_AGENT *agent = NULL * cdef c_ssh2.libssh2_agent_publickey *identity = NULL * cdef c_ssh2.libssh2_agent_publickey *prev = NULL # <<<<<<<<<<<<<< @@ -4006,7 +4337,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_26agent_auth(struct __pyx_obj_ */ __pyx_v_prev = NULL; - /* "ssh2/session.pyx":262 + /* "ssh2/session.pyx":291 * cdef c_ssh2.libssh2_agent_publickey *identity = NULL * cdef c_ssh2.libssh2_agent_publickey *prev = NULL * with nogil: # <<<<<<<<<<<<<< @@ -4021,17 +4352,17 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_26agent_auth(struct __pyx_obj_ #endif /*try:*/ { - /* "ssh2/session.pyx":263 + /* "ssh2/session.pyx":292 * cdef c_ssh2.libssh2_agent_publickey *prev = NULL * with nogil: * agent = self.init_connect_agent() # <<<<<<<<<<<<<< * if c_ssh2.libssh2_agent_list_identities(agent) != 0: * clear_agent(agent) */ - __pyx_t_1 = ((struct __pyx_vtabstruct_4ssh2_7session_Session *)__pyx_v_self->__pyx_vtab)->init_connect_agent(__pyx_v_self); if (unlikely(__pyx_t_1 == NULL)) __PYX_ERR(0, 263, __pyx_L4_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_4ssh2_7session_Session *)__pyx_v_self->__pyx_vtab)->init_connect_agent(__pyx_v_self); if (unlikely(__pyx_t_1 == NULL)) __PYX_ERR(0, 292, __pyx_L4_error) __pyx_v_agent = __pyx_t_1; - /* "ssh2/session.pyx":264 + /* "ssh2/session.pyx":293 * with nogil: * agent = self.init_connect_agent() * if c_ssh2.libssh2_agent_list_identities(agent) != 0: # <<<<<<<<<<<<<< @@ -4041,7 +4372,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_26agent_auth(struct __pyx_obj_ __pyx_t_2 = ((libssh2_agent_list_identities(__pyx_v_agent) != 0) != 0); if (__pyx_t_2) { - /* "ssh2/session.pyx":265 + /* "ssh2/session.pyx":294 * agent = self.init_connect_agent() * if c_ssh2.libssh2_agent_list_identities(agent) != 0: * clear_agent(agent) # <<<<<<<<<<<<<< @@ -4050,7 +4381,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_26agent_auth(struct __pyx_obj_ */ __pyx_f_4ssh2_5agent_clear_agent(__pyx_v_agent); - /* "ssh2/session.pyx":266 + /* "ssh2/session.pyx":295 * if c_ssh2.libssh2_agent_list_identities(agent) != 0: * clear_agent(agent) * with gil: # <<<<<<<<<<<<<< @@ -4063,21 +4394,21 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_26agent_auth(struct __pyx_obj_ #endif /*try:*/ { - /* "ssh2/session.pyx":267 + /* "ssh2/session.pyx":296 * clear_agent(agent) * with gil: * raise AgentListIdentitiesError( # <<<<<<<<<<<<<< * "Failure requesting identities from agent") * while 1: */ - __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4ssh2_10exceptions_AgentListIdentitiesError), __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 267, __pyx_L8_error) + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4ssh2_10exceptions_AgentListIdentitiesError), __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 296, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 267, __pyx_L8_error) + __PYX_ERR(0, 296, __pyx_L8_error) } - /* "ssh2/session.pyx":266 + /* "ssh2/session.pyx":295 * if c_ssh2.libssh2_agent_list_identities(agent) != 0: * clear_agent(agent) * with gil: # <<<<<<<<<<<<<< @@ -4094,7 +4425,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_26agent_auth(struct __pyx_obj_ } } - /* "ssh2/session.pyx":264 + /* "ssh2/session.pyx":293 * with nogil: * agent = self.init_connect_agent() * if c_ssh2.libssh2_agent_list_identities(agent) != 0: # <<<<<<<<<<<<<< @@ -4103,7 +4434,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_26agent_auth(struct __pyx_obj_ */ } - /* "ssh2/session.pyx":269 + /* "ssh2/session.pyx":298 * raise AgentListIdentitiesError( * "Failure requesting identities from agent") * while 1: # <<<<<<<<<<<<<< @@ -4112,16 +4443,16 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_26agent_auth(struct __pyx_obj_ */ while (1) { - /* "ssh2/session.pyx":270 + /* "ssh2/session.pyx":299 * "Failure requesting identities from agent") * while 1: * auth_identity(_username, agent, &identity, prev) # <<<<<<<<<<<<<< * if c_ssh2.libssh2_agent_userauth( * agent, _username, identity) == 0: */ - __pyx_t_4 = __pyx_f_4ssh2_5agent_auth_identity(__pyx_v__username, __pyx_v_agent, (&__pyx_v_identity), __pyx_v_prev); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 270, __pyx_L4_error) + __pyx_t_4 = __pyx_f_4ssh2_5agent_auth_identity(__pyx_v__username, __pyx_v_agent, (&__pyx_v_identity), __pyx_v_prev); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 299, __pyx_L4_error) - /* "ssh2/session.pyx":272 + /* "ssh2/session.pyx":301 * auth_identity(_username, agent, &identity, prev) * if c_ssh2.libssh2_agent_userauth( * agent, _username, identity) == 0: # <<<<<<<<<<<<<< @@ -4130,7 +4461,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_26agent_auth(struct __pyx_obj_ */ __pyx_t_2 = ((libssh2_agent_userauth(__pyx_v_agent, __pyx_v__username, __pyx_v_identity) == 0) != 0); - /* "ssh2/session.pyx":271 + /* "ssh2/session.pyx":300 * while 1: * auth_identity(_username, agent, &identity, prev) * if c_ssh2.libssh2_agent_userauth( # <<<<<<<<<<<<<< @@ -4139,7 +4470,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_26agent_auth(struct __pyx_obj_ */ if (__pyx_t_2) { - /* "ssh2/session.pyx":273 + /* "ssh2/session.pyx":302 * if c_ssh2.libssh2_agent_userauth( * agent, _username, identity) == 0: * break # <<<<<<<<<<<<<< @@ -4148,7 +4479,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_26agent_auth(struct __pyx_obj_ */ goto __pyx_L11_break; - /* "ssh2/session.pyx":271 + /* "ssh2/session.pyx":300 * while 1: * auth_identity(_username, agent, &identity, prev) * if c_ssh2.libssh2_agent_userauth( # <<<<<<<<<<<<<< @@ -4157,7 +4488,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_26agent_auth(struct __pyx_obj_ */ } - /* "ssh2/session.pyx":274 + /* "ssh2/session.pyx":303 * agent, _username, identity) == 0: * break * prev = identity # <<<<<<<<<<<<<< @@ -4168,7 +4499,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_26agent_auth(struct __pyx_obj_ } __pyx_L11_break:; - /* "ssh2/session.pyx":275 + /* "ssh2/session.pyx":304 * break * prev = identity * clear_agent(agent) # <<<<<<<<<<<<<< @@ -4178,7 +4509,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_26agent_auth(struct __pyx_obj_ __pyx_f_4ssh2_5agent_clear_agent(__pyx_v_agent); } - /* "ssh2/session.pyx":262 + /* "ssh2/session.pyx":291 * cdef c_ssh2.libssh2_agent_publickey *identity = NULL * cdef c_ssh2.libssh2_agent_publickey *prev = NULL * with nogil: # <<<<<<<<<<<<<< @@ -4204,7 +4535,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_26agent_auth(struct __pyx_obj_ } } - /* "ssh2/session.pyx":230 + /* "ssh2/session.pyx":259 * return agent * * def agent_auth(self, username not None): # <<<<<<<<<<<<<< @@ -4225,7 +4556,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_26agent_auth(struct __pyx_obj_ return __pyx_r; } -/* "ssh2/session.pyx":277 +/* "ssh2/session.pyx":306 * clear_agent(agent) * * def open_session(self): # <<<<<<<<<<<<<< @@ -4234,20 +4565,20 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_26agent_auth(struct __pyx_obj_ */ /* Python wrapper */ -static PyObject *__pyx_pw_4ssh2_7session_7Session_29open_session(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static char __pyx_doc_4ssh2_7session_7Session_28open_session[] = "Session.open_session(self)\nOpen new channel session.\n\n :rtype: :py:class:`ssh2.channel.Channel`\n "; -static PyObject *__pyx_pw_4ssh2_7session_7Session_29open_session(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { +static PyObject *__pyx_pw_4ssh2_7session_7Session_35open_session(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_4ssh2_7session_7Session_34open_session[] = "Session.open_session(self)\nOpen new channel session.\n\n :rtype: :py:class:`ssh2.channel.Channel`\n "; +static PyObject *__pyx_pw_4ssh2_7session_7Session_35open_session(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("open_session (wrapper)", 0); - __pyx_r = __pyx_pf_4ssh2_7session_7Session_28open_session(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self)); + __pyx_r = __pyx_pf_4ssh2_7session_7Session_34open_session(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_4ssh2_7session_7Session_28open_session(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self) { +static PyObject *__pyx_pf_4ssh2_7session_7Session_34open_session(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self) { LIBSSH2_CHANNEL *__pyx_v_channel; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -4255,7 +4586,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_28open_session(struct __pyx_ob PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("open_session", 0); - /* "ssh2/session.pyx":283 + /* "ssh2/session.pyx":312 * """ * cdef c_ssh2.LIBSSH2_CHANNEL *channel * with nogil: # <<<<<<<<<<<<<< @@ -4270,7 +4601,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_28open_session(struct __pyx_ob #endif /*try:*/ { - /* "ssh2/session.pyx":284 + /* "ssh2/session.pyx":313 * cdef c_ssh2.LIBSSH2_CHANNEL *channel * with nogil: * channel = c_ssh2.libssh2_channel_open_session( # <<<<<<<<<<<<<< @@ -4279,7 +4610,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_28open_session(struct __pyx_ob */ __pyx_v_channel = libssh2_channel_open_session(__pyx_v_self->_session); - /* "ssh2/session.pyx":286 + /* "ssh2/session.pyx":315 * channel = c_ssh2.libssh2_channel_open_session( * self._session) * if channel is NULL: # <<<<<<<<<<<<<< @@ -4289,7 +4620,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_28open_session(struct __pyx_ob __pyx_t_1 = ((__pyx_v_channel == NULL) != 0); if (__pyx_t_1) { - /* "ssh2/session.pyx":287 + /* "ssh2/session.pyx":316 * self._session) * if channel is NULL: * with gil: # <<<<<<<<<<<<<< @@ -4302,7 +4633,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_28open_session(struct __pyx_ob #endif /*try:*/ { - /* "ssh2/session.pyx":288 + /* "ssh2/session.pyx":317 * if channel is NULL: * with gil: * return None # <<<<<<<<<<<<<< @@ -4315,7 +4646,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_28open_session(struct __pyx_ob goto __pyx_L7_return; } - /* "ssh2/session.pyx":287 + /* "ssh2/session.pyx":316 * self._session) * if channel is NULL: * with gil: # <<<<<<<<<<<<<< @@ -4332,7 +4663,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_28open_session(struct __pyx_ob } } - /* "ssh2/session.pyx":286 + /* "ssh2/session.pyx":315 * channel = c_ssh2.libssh2_channel_open_session( * self._session) * if channel is NULL: # <<<<<<<<<<<<<< @@ -4342,7 +4673,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_28open_session(struct __pyx_ob } } - /* "ssh2/session.pyx":283 + /* "ssh2/session.pyx":312 * """ * cdef c_ssh2.LIBSSH2_CHANNEL *channel * with nogil: # <<<<<<<<<<<<<< @@ -4368,7 +4699,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_28open_session(struct __pyx_ob } } - /* "ssh2/session.pyx":289 + /* "ssh2/session.pyx":318 * with gil: * return None * return PyChannel(channel, self) # <<<<<<<<<<<<<< @@ -4376,13 +4707,13 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_28open_session(struct __pyx_ob * def direct_tcpip_ex(self, host not None, int port, */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __pyx_f_4ssh2_7channel_PyChannel(__pyx_v_channel, __pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 289, __pyx_L1_error) + __pyx_t_2 = __pyx_f_4ssh2_7channel_PyChannel(__pyx_v_channel, __pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":277 + /* "ssh2/session.pyx":306 * clear_agent(agent) * * def open_session(self): # <<<<<<<<<<<<<< @@ -4401,7 +4732,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_28open_session(struct __pyx_ob return __pyx_r; } -/* "ssh2/session.pyx":291 +/* "ssh2/session.pyx":320 * return PyChannel(channel, self) * * def direct_tcpip_ex(self, host not None, int port, # <<<<<<<<<<<<<< @@ -4410,9 +4741,9 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_28open_session(struct __pyx_ob */ /* Python wrapper */ -static PyObject *__pyx_pw_4ssh2_7session_7Session_31direct_tcpip_ex(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_4ssh2_7session_7Session_30direct_tcpip_ex[] = "Session.direct_tcpip_ex(self, host, int port, shost, int sport)"; -static PyObject *__pyx_pw_4ssh2_7session_7Session_31direct_tcpip_ex(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_pw_4ssh2_7session_7Session_37direct_tcpip_ex(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_4ssh2_7session_7Session_36direct_tcpip_ex[] = "Session.direct_tcpip_ex(self, host, int port, shost, int sport)"; +static PyObject *__pyx_pw_4ssh2_7session_7Session_37direct_tcpip_ex(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_host = 0; int __pyx_v_port; PyObject *__pyx_v_shost = 0; @@ -4447,23 +4778,23 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_31direct_tcpip_ex(PyObject *__ case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_port)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("direct_tcpip_ex", 1, 4, 4, 1); __PYX_ERR(0, 291, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("direct_tcpip_ex", 1, 4, 4, 1); __PYX_ERR(0, 320, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_shost)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("direct_tcpip_ex", 1, 4, 4, 2); __PYX_ERR(0, 291, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("direct_tcpip_ex", 1, 4, 4, 2); __PYX_ERR(0, 320, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_sport)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("direct_tcpip_ex", 1, 4, 4, 3); __PYX_ERR(0, 291, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("direct_tcpip_ex", 1, 4, 4, 3); __PYX_ERR(0, 320, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "direct_tcpip_ex") < 0)) __PYX_ERR(0, 291, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "direct_tcpip_ex") < 0)) __PYX_ERR(0, 320, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; @@ -4474,25 +4805,25 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_31direct_tcpip_ex(PyObject *__ values[3] = PyTuple_GET_ITEM(__pyx_args, 3); } __pyx_v_host = values[0]; - __pyx_v_port = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_port == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 291, __pyx_L3_error) + __pyx_v_port = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_port == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 320, __pyx_L3_error) __pyx_v_shost = values[2]; - __pyx_v_sport = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_sport == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 292, __pyx_L3_error) + __pyx_v_sport = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_sport == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 321, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("direct_tcpip_ex", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 291, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("direct_tcpip_ex", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 320, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.session.Session.direct_tcpip_ex", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(((PyObject *)__pyx_v_host) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "host"); __PYX_ERR(0, 291, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "host"); __PYX_ERR(0, 320, __pyx_L1_error) } if (unlikely(((PyObject *)__pyx_v_shost) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "shost"); __PYX_ERR(0, 292, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "shost"); __PYX_ERR(0, 321, __pyx_L1_error) } - __pyx_r = __pyx_pf_4ssh2_7session_7Session_30direct_tcpip_ex(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), __pyx_v_host, __pyx_v_port, __pyx_v_shost, __pyx_v_sport); + __pyx_r = __pyx_pf_4ssh2_7session_7Session_36direct_tcpip_ex(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), __pyx_v_host, __pyx_v_port, __pyx_v_shost, __pyx_v_sport); /* function exit code */ goto __pyx_L0; @@ -4503,7 +4834,7 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_31direct_tcpip_ex(PyObject *__ return __pyx_r; } -static PyObject *__pyx_pf_4ssh2_7session_7Session_30direct_tcpip_ex(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, PyObject *__pyx_v_host, int __pyx_v_port, PyObject *__pyx_v_shost, int __pyx_v_sport) { +static PyObject *__pyx_pf_4ssh2_7session_7Session_36direct_tcpip_ex(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, PyObject *__pyx_v_host, int __pyx_v_port, PyObject *__pyx_v_shost, int __pyx_v_sport) { LIBSSH2_CHANNEL *__pyx_v_channel; char *__pyx_v__host; char *__pyx_v__shost; @@ -4513,7 +4844,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_30direct_tcpip_ex(struct __pyx PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("direct_tcpip_ex", 0); - /* "ssh2/session.pyx":294 + /* "ssh2/session.pyx":323 * shost not None, int sport): * cdef c_ssh2.LIBSSH2_CHANNEL *channel * cdef char *_host = to_bytes(host) # <<<<<<<<<<<<<< @@ -4522,7 +4853,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_30direct_tcpip_ex(struct __pyx */ __pyx_v__host = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_host); - /* "ssh2/session.pyx":295 + /* "ssh2/session.pyx":324 * cdef c_ssh2.LIBSSH2_CHANNEL *channel * cdef char *_host = to_bytes(host) * cdef char *_shost = to_bytes(shost) # <<<<<<<<<<<<<< @@ -4531,7 +4862,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_30direct_tcpip_ex(struct __pyx */ __pyx_v__shost = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_shost); - /* "ssh2/session.pyx":296 + /* "ssh2/session.pyx":325 * cdef char *_host = to_bytes(host) * cdef char *_shost = to_bytes(shost) * with nogil: # <<<<<<<<<<<<<< @@ -4546,7 +4877,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_30direct_tcpip_ex(struct __pyx #endif /*try:*/ { - /* "ssh2/session.pyx":297 + /* "ssh2/session.pyx":326 * cdef char *_shost = to_bytes(shost) * with nogil: * channel = c_ssh2.libssh2_channel_direct_tcpip_ex( # <<<<<<<<<<<<<< @@ -4555,7 +4886,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_30direct_tcpip_ex(struct __pyx */ __pyx_v_channel = libssh2_channel_direct_tcpip_ex(__pyx_v_self->_session, __pyx_v__host, __pyx_v_port, __pyx_v__shost, __pyx_v_sport); - /* "ssh2/session.pyx":299 + /* "ssh2/session.pyx":328 * channel = c_ssh2.libssh2_channel_direct_tcpip_ex( * self._session, _host, port, _shost, sport) * if channel is NULL: # <<<<<<<<<<<<<< @@ -4565,7 +4896,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_30direct_tcpip_ex(struct __pyx __pyx_t_1 = ((__pyx_v_channel == NULL) != 0); if (__pyx_t_1) { - /* "ssh2/session.pyx":300 + /* "ssh2/session.pyx":329 * self._session, _host, port, _shost, sport) * if channel is NULL: * with gil: # <<<<<<<<<<<<<< @@ -4578,7 +4909,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_30direct_tcpip_ex(struct __pyx #endif /*try:*/ { - /* "ssh2/session.pyx":301 + /* "ssh2/session.pyx":330 * if channel is NULL: * with gil: * return # <<<<<<<<<<<<<< @@ -4590,7 +4921,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_30direct_tcpip_ex(struct __pyx goto __pyx_L7_return; } - /* "ssh2/session.pyx":300 + /* "ssh2/session.pyx":329 * self._session, _host, port, _shost, sport) * if channel is NULL: * with gil: # <<<<<<<<<<<<<< @@ -4607,7 +4938,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_30direct_tcpip_ex(struct __pyx } } - /* "ssh2/session.pyx":299 + /* "ssh2/session.pyx":328 * channel = c_ssh2.libssh2_channel_direct_tcpip_ex( * self._session, _host, port, _shost, sport) * if channel is NULL: # <<<<<<<<<<<<<< @@ -4617,7 +4948,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_30direct_tcpip_ex(struct __pyx } } - /* "ssh2/session.pyx":296 + /* "ssh2/session.pyx":325 * cdef char *_host = to_bytes(host) * cdef char *_shost = to_bytes(shost) * with nogil: # <<<<<<<<<<<<<< @@ -4643,7 +4974,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_30direct_tcpip_ex(struct __pyx } } - /* "ssh2/session.pyx":302 + /* "ssh2/session.pyx":331 * with gil: * return * return PyChannel(channel, self) # <<<<<<<<<<<<<< @@ -4651,13 +4982,13 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_30direct_tcpip_ex(struct __pyx * def direct_tcpip(self, host not None, int port): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __pyx_f_4ssh2_7channel_PyChannel(__pyx_v_channel, __pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 302, __pyx_L1_error) + __pyx_t_2 = __pyx_f_4ssh2_7channel_PyChannel(__pyx_v_channel, __pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":291 + /* "ssh2/session.pyx":320 * return PyChannel(channel, self) * * def direct_tcpip_ex(self, host not None, int port, # <<<<<<<<<<<<<< @@ -4676,7 +5007,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_30direct_tcpip_ex(struct __pyx return __pyx_r; } -/* "ssh2/session.pyx":304 +/* "ssh2/session.pyx":333 * return PyChannel(channel, self) * * def direct_tcpip(self, host not None, int port): # <<<<<<<<<<<<<< @@ -4685,9 +5016,9 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_30direct_tcpip_ex(struct __pyx */ /* Python wrapper */ -static PyObject *__pyx_pw_4ssh2_7session_7Session_33direct_tcpip(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_4ssh2_7session_7Session_32direct_tcpip[] = "Session.direct_tcpip(self, host, int port)"; -static PyObject *__pyx_pw_4ssh2_7session_7Session_33direct_tcpip(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_pw_4ssh2_7session_7Session_39direct_tcpip(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_4ssh2_7session_7Session_38direct_tcpip[] = "Session.direct_tcpip(self, host, int port)"; +static PyObject *__pyx_pw_4ssh2_7session_7Session_39direct_tcpip(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_host = 0; int __pyx_v_port; PyObject *__pyx_r = 0; @@ -4716,11 +5047,11 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_33direct_tcpip(PyObject *__pyx case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_port)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("direct_tcpip", 1, 2, 2, 1); __PYX_ERR(0, 304, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("direct_tcpip", 1, 2, 2, 1); __PYX_ERR(0, 333, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "direct_tcpip") < 0)) __PYX_ERR(0, 304, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "direct_tcpip") < 0)) __PYX_ERR(0, 333, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -4729,20 +5060,20 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_33direct_tcpip(PyObject *__pyx values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_host = values[0]; - __pyx_v_port = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_port == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 304, __pyx_L3_error) + __pyx_v_port = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_port == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 333, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("direct_tcpip", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 304, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("direct_tcpip", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 333, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.session.Session.direct_tcpip", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(((PyObject *)__pyx_v_host) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "host"); __PYX_ERR(0, 304, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "host"); __PYX_ERR(0, 333, __pyx_L1_error) } - __pyx_r = __pyx_pf_4ssh2_7session_7Session_32direct_tcpip(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), __pyx_v_host, __pyx_v_port); + __pyx_r = __pyx_pf_4ssh2_7session_7Session_38direct_tcpip(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), __pyx_v_host, __pyx_v_port); /* function exit code */ goto __pyx_L0; @@ -4753,7 +5084,7 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_33direct_tcpip(PyObject *__pyx return __pyx_r; } -static PyObject *__pyx_pf_4ssh2_7session_7Session_32direct_tcpip(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, PyObject *__pyx_v_host, int __pyx_v_port) { +static PyObject *__pyx_pf_4ssh2_7session_7Session_38direct_tcpip(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, PyObject *__pyx_v_host, int __pyx_v_port) { LIBSSH2_CHANNEL *__pyx_v_channel; char *__pyx_v__host; PyObject *__pyx_r = NULL; @@ -4762,7 +5093,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_32direct_tcpip(struct __pyx_ob PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("direct_tcpip", 0); - /* "ssh2/session.pyx":306 + /* "ssh2/session.pyx":335 * def direct_tcpip(self, host not None, int port): * cdef c_ssh2.LIBSSH2_CHANNEL *channel * cdef char *_host = to_bytes(host) # <<<<<<<<<<<<<< @@ -4771,7 +5102,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_32direct_tcpip(struct __pyx_ob */ __pyx_v__host = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_host); - /* "ssh2/session.pyx":307 + /* "ssh2/session.pyx":336 * cdef c_ssh2.LIBSSH2_CHANNEL *channel * cdef char *_host = to_bytes(host) * with nogil: # <<<<<<<<<<<<<< @@ -4786,7 +5117,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_32direct_tcpip(struct __pyx_ob #endif /*try:*/ { - /* "ssh2/session.pyx":308 + /* "ssh2/session.pyx":337 * cdef char *_host = to_bytes(host) * with nogil: * channel = c_ssh2.libssh2_channel_direct_tcpip( # <<<<<<<<<<<<<< @@ -4795,7 +5126,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_32direct_tcpip(struct __pyx_ob */ __pyx_v_channel = libssh2_channel_direct_tcpip(__pyx_v_self->_session, __pyx_v__host, __pyx_v_port); - /* "ssh2/session.pyx":310 + /* "ssh2/session.pyx":339 * channel = c_ssh2.libssh2_channel_direct_tcpip( * self._session, _host, port) * if channel is NULL: # <<<<<<<<<<<<<< @@ -4805,7 +5136,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_32direct_tcpip(struct __pyx_ob __pyx_t_1 = ((__pyx_v_channel == NULL) != 0); if (__pyx_t_1) { - /* "ssh2/session.pyx":311 + /* "ssh2/session.pyx":340 * self._session, _host, port) * if channel is NULL: * with gil: # <<<<<<<<<<<<<< @@ -4818,7 +5149,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_32direct_tcpip(struct __pyx_ob #endif /*try:*/ { - /* "ssh2/session.pyx":312 + /* "ssh2/session.pyx":341 * if channel is NULL: * with gil: * return # <<<<<<<<<<<<<< @@ -4830,7 +5161,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_32direct_tcpip(struct __pyx_ob goto __pyx_L7_return; } - /* "ssh2/session.pyx":311 + /* "ssh2/session.pyx":340 * self._session, _host, port) * if channel is NULL: * with gil: # <<<<<<<<<<<<<< @@ -4847,7 +5178,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_32direct_tcpip(struct __pyx_ob } } - /* "ssh2/session.pyx":310 + /* "ssh2/session.pyx":339 * channel = c_ssh2.libssh2_channel_direct_tcpip( * self._session, _host, port) * if channel is NULL: # <<<<<<<<<<<<<< @@ -4857,7 +5188,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_32direct_tcpip(struct __pyx_ob } } - /* "ssh2/session.pyx":307 + /* "ssh2/session.pyx":336 * cdef c_ssh2.LIBSSH2_CHANNEL *channel * cdef char *_host = to_bytes(host) * with nogil: # <<<<<<<<<<<<<< @@ -4883,7 +5214,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_32direct_tcpip(struct __pyx_ob } } - /* "ssh2/session.pyx":313 + /* "ssh2/session.pyx":342 * with gil: * return * return PyChannel(channel, self) # <<<<<<<<<<<<<< @@ -4891,13 +5222,13 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_32direct_tcpip(struct __pyx_ob * def blockdirections(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __pyx_f_4ssh2_7channel_PyChannel(__pyx_v_channel, __pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 313, __pyx_L1_error) + __pyx_t_2 = __pyx_f_4ssh2_7channel_PyChannel(__pyx_v_channel, __pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 342, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":304 + /* "ssh2/session.pyx":333 * return PyChannel(channel, self) * * def direct_tcpip(self, host not None, int port): # <<<<<<<<<<<<<< @@ -4916,7 +5247,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_32direct_tcpip(struct __pyx_ob return __pyx_r; } -/* "ssh2/session.pyx":315 +/* "ssh2/session.pyx":344 * return PyChannel(channel, self) * * def blockdirections(self): # <<<<<<<<<<<<<< @@ -4925,27 +5256,27 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_32direct_tcpip(struct __pyx_ob */ /* Python wrapper */ -static PyObject *__pyx_pw_4ssh2_7session_7Session_35blockdirections(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static char __pyx_doc_4ssh2_7session_7Session_34blockdirections[] = "Session.blockdirections(self)"; -static PyObject *__pyx_pw_4ssh2_7session_7Session_35blockdirections(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { +static PyObject *__pyx_pw_4ssh2_7session_7Session_41blockdirections(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_4ssh2_7session_7Session_40blockdirections[] = "Session.blockdirections(self)"; +static PyObject *__pyx_pw_4ssh2_7session_7Session_41blockdirections(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("blockdirections (wrapper)", 0); - __pyx_r = __pyx_pf_4ssh2_7session_7Session_34blockdirections(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self)); + __pyx_r = __pyx_pf_4ssh2_7session_7Session_40blockdirections(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_4ssh2_7session_7Session_34blockdirections(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self) { +static PyObject *__pyx_pf_4ssh2_7session_7Session_40blockdirections(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self) { int __pyx_v_rc; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("blockdirections", 0); - /* "ssh2/session.pyx":317 + /* "ssh2/session.pyx":346 * def blockdirections(self): * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -4960,7 +5291,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_34blockdirections(struct __pyx #endif /*try:*/ { - /* "ssh2/session.pyx":318 + /* "ssh2/session.pyx":347 * cdef int rc * with nogil: * rc = c_ssh2.libssh2_session_block_directions( # <<<<<<<<<<<<<< @@ -4970,7 +5301,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_34blockdirections(struct __pyx __pyx_v_rc = libssh2_session_block_directions(__pyx_v_self->_session); } - /* "ssh2/session.pyx":317 + /* "ssh2/session.pyx":346 * def blockdirections(self): * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -4989,7 +5320,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_34blockdirections(struct __pyx } } - /* "ssh2/session.pyx":320 + /* "ssh2/session.pyx":349 * rc = c_ssh2.libssh2_session_block_directions( * self._session) * return rc # <<<<<<<<<<<<<< @@ -4997,13 +5328,13 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_34blockdirections(struct __pyx * def forward_listen(self, int port): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 320, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 349, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":315 + /* "ssh2/session.pyx":344 * return PyChannel(channel, self) * * def blockdirections(self): # <<<<<<<<<<<<<< @@ -5022,7 +5353,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_34blockdirections(struct __pyx return __pyx_r; } -/* "ssh2/session.pyx":322 +/* "ssh2/session.pyx":351 * return rc * * def forward_listen(self, int port): # <<<<<<<<<<<<<< @@ -5031,15 +5362,15 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_34blockdirections(struct __pyx */ /* Python wrapper */ -static PyObject *__pyx_pw_4ssh2_7session_7Session_37forward_listen(PyObject *__pyx_v_self, PyObject *__pyx_arg_port); /*proto*/ -static char __pyx_doc_4ssh2_7session_7Session_36forward_listen[] = "Session.forward_listen(self, int port)"; -static PyObject *__pyx_pw_4ssh2_7session_7Session_37forward_listen(PyObject *__pyx_v_self, PyObject *__pyx_arg_port) { +static PyObject *__pyx_pw_4ssh2_7session_7Session_43forward_listen(PyObject *__pyx_v_self, PyObject *__pyx_arg_port); /*proto*/ +static char __pyx_doc_4ssh2_7session_7Session_42forward_listen[] = "Session.forward_listen(self, int port)"; +static PyObject *__pyx_pw_4ssh2_7session_7Session_43forward_listen(PyObject *__pyx_v_self, PyObject *__pyx_arg_port) { int __pyx_v_port; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("forward_listen (wrapper)", 0); assert(__pyx_arg_port); { - __pyx_v_port = __Pyx_PyInt_As_int(__pyx_arg_port); if (unlikely((__pyx_v_port == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 322, __pyx_L3_error) + __pyx_v_port = __Pyx_PyInt_As_int(__pyx_arg_port); if (unlikely((__pyx_v_port == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 351, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -5047,14 +5378,14 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_37forward_listen(PyObject *__p __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_4ssh2_7session_7Session_36forward_listen(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), ((int)__pyx_v_port)); + __pyx_r = __pyx_pf_4ssh2_7session_7Session_42forward_listen(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), ((int)__pyx_v_port)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_4ssh2_7session_7Session_36forward_listen(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, int __pyx_v_port) { +static PyObject *__pyx_pf_4ssh2_7session_7Session_42forward_listen(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, int __pyx_v_port) { LIBSSH2_LISTENER *__pyx_v_listener; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -5062,7 +5393,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_36forward_listen(struct __pyx_ PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("forward_listen", 0); - /* "ssh2/session.pyx":324 + /* "ssh2/session.pyx":353 * def forward_listen(self, int port): * cdef c_ssh2.LIBSSH2_LISTENER *listener * with nogil: # <<<<<<<<<<<<<< @@ -5077,7 +5408,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_36forward_listen(struct __pyx_ #endif /*try:*/ { - /* "ssh2/session.pyx":325 + /* "ssh2/session.pyx":354 * cdef c_ssh2.LIBSSH2_LISTENER *listener * with nogil: * listener = c_ssh2.libssh2_channel_forward_listen( # <<<<<<<<<<<<<< @@ -5087,7 +5418,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_36forward_listen(struct __pyx_ __pyx_v_listener = libssh2_channel_forward_listen(__pyx_v_self->_session, __pyx_v_port); } - /* "ssh2/session.pyx":324 + /* "ssh2/session.pyx":353 * def forward_listen(self, int port): * cdef c_ssh2.LIBSSH2_LISTENER *listener * with nogil: # <<<<<<<<<<<<<< @@ -5106,7 +5437,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_36forward_listen(struct __pyx_ } } - /* "ssh2/session.pyx":327 + /* "ssh2/session.pyx":356 * listener = c_ssh2.libssh2_channel_forward_listen( * self._session, port) * if listener is NULL: # <<<<<<<<<<<<<< @@ -5116,7 +5447,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_36forward_listen(struct __pyx_ __pyx_t_1 = ((__pyx_v_listener == NULL) != 0); if (__pyx_t_1) { - /* "ssh2/session.pyx":328 + /* "ssh2/session.pyx":357 * self._session, port) * if listener is NULL: * return # <<<<<<<<<<<<<< @@ -5127,7 +5458,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_36forward_listen(struct __pyx_ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "ssh2/session.pyx":327 + /* "ssh2/session.pyx":356 * listener = c_ssh2.libssh2_channel_forward_listen( * self._session, port) * if listener is NULL: # <<<<<<<<<<<<<< @@ -5136,7 +5467,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_36forward_listen(struct __pyx_ */ } - /* "ssh2/session.pyx":329 + /* "ssh2/session.pyx":358 * if listener is NULL: * return * return PyListener(listener, self) # <<<<<<<<<<<<<< @@ -5144,13 +5475,13 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_36forward_listen(struct __pyx_ * def forward_listen_ex(self, host not None, int port, */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __pyx_f_4ssh2_8listener_PyListener(__pyx_v_listener, __pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 329, __pyx_L1_error) + __pyx_t_2 = __pyx_f_4ssh2_8listener_PyListener(__pyx_v_listener, __pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 358, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":322 + /* "ssh2/session.pyx":351 * return rc * * def forward_listen(self, int port): # <<<<<<<<<<<<<< @@ -5169,7 +5500,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_36forward_listen(struct __pyx_ return __pyx_r; } -/* "ssh2/session.pyx":331 +/* "ssh2/session.pyx":360 * return PyListener(listener, self) * * def forward_listen_ex(self, host not None, int port, # <<<<<<<<<<<<<< @@ -5178,9 +5509,9 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_36forward_listen(struct __pyx_ */ /* Python wrapper */ -static PyObject *__pyx_pw_4ssh2_7session_7Session_39forward_listen_ex(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_4ssh2_7session_7Session_38forward_listen_ex[] = "Session.forward_listen_ex(self, host, int port, int bound_port, int queue_maxsize)"; -static PyObject *__pyx_pw_4ssh2_7session_7Session_39forward_listen_ex(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_pw_4ssh2_7session_7Session_45forward_listen_ex(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_4ssh2_7session_7Session_44forward_listen_ex[] = "Session.forward_listen_ex(self, host, int port, int bound_port, int queue_maxsize)"; +static PyObject *__pyx_pw_4ssh2_7session_7Session_45forward_listen_ex(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_host = 0; int __pyx_v_port; int __pyx_v_bound_port; @@ -5215,23 +5546,23 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_39forward_listen_ex(PyObject * case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_port)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("forward_listen_ex", 1, 4, 4, 1); __PYX_ERR(0, 331, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("forward_listen_ex", 1, 4, 4, 1); __PYX_ERR(0, 360, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bound_port)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("forward_listen_ex", 1, 4, 4, 2); __PYX_ERR(0, 331, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("forward_listen_ex", 1, 4, 4, 2); __PYX_ERR(0, 360, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_queue_maxsize)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("forward_listen_ex", 1, 4, 4, 3); __PYX_ERR(0, 331, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("forward_listen_ex", 1, 4, 4, 3); __PYX_ERR(0, 360, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "forward_listen_ex") < 0)) __PYX_ERR(0, 331, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "forward_listen_ex") < 0)) __PYX_ERR(0, 360, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; @@ -5242,22 +5573,22 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_39forward_listen_ex(PyObject * values[3] = PyTuple_GET_ITEM(__pyx_args, 3); } __pyx_v_host = values[0]; - __pyx_v_port = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_port == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 331, __pyx_L3_error) - __pyx_v_bound_port = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_bound_port == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 332, __pyx_L3_error) - __pyx_v_queue_maxsize = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_queue_maxsize == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 332, __pyx_L3_error) + __pyx_v_port = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_port == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 360, __pyx_L3_error) + __pyx_v_bound_port = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_bound_port == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 361, __pyx_L3_error) + __pyx_v_queue_maxsize = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_queue_maxsize == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 361, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("forward_listen_ex", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 331, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("forward_listen_ex", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 360, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.session.Session.forward_listen_ex", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(((PyObject *)__pyx_v_host) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "host"); __PYX_ERR(0, 331, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "host"); __PYX_ERR(0, 360, __pyx_L1_error) } - __pyx_r = __pyx_pf_4ssh2_7session_7Session_38forward_listen_ex(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), __pyx_v_host, __pyx_v_port, __pyx_v_bound_port, __pyx_v_queue_maxsize); + __pyx_r = __pyx_pf_4ssh2_7session_7Session_44forward_listen_ex(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), __pyx_v_host, __pyx_v_port, __pyx_v_bound_port, __pyx_v_queue_maxsize); /* function exit code */ goto __pyx_L0; @@ -5268,7 +5599,7 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_39forward_listen_ex(PyObject * return __pyx_r; } -static PyObject *__pyx_pf_4ssh2_7session_7Session_38forward_listen_ex(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, PyObject *__pyx_v_host, int __pyx_v_port, int __pyx_v_bound_port, int __pyx_v_queue_maxsize) { +static PyObject *__pyx_pf_4ssh2_7session_7Session_44forward_listen_ex(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, PyObject *__pyx_v_host, int __pyx_v_port, int __pyx_v_bound_port, int __pyx_v_queue_maxsize) { LIBSSH2_LISTENER *__pyx_v_listener; char *__pyx_v__host; PyObject *__pyx_r = NULL; @@ -5277,7 +5608,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_38forward_listen_ex(struct __p PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("forward_listen_ex", 0); - /* "ssh2/session.pyx":334 + /* "ssh2/session.pyx":363 * int bound_port, int queue_maxsize): * cdef c_ssh2.LIBSSH2_LISTENER *listener * cdef char *_host = to_bytes(host) # <<<<<<<<<<<<<< @@ -5286,7 +5617,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_38forward_listen_ex(struct __p */ __pyx_v__host = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_host); - /* "ssh2/session.pyx":335 + /* "ssh2/session.pyx":364 * cdef c_ssh2.LIBSSH2_LISTENER *listener * cdef char *_host = to_bytes(host) * with nogil: # <<<<<<<<<<<<<< @@ -5301,7 +5632,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_38forward_listen_ex(struct __p #endif /*try:*/ { - /* "ssh2/session.pyx":336 + /* "ssh2/session.pyx":365 * cdef char *_host = to_bytes(host) * with nogil: * listener = c_ssh2.libssh2_channel_forward_listen_ex( # <<<<<<<<<<<<<< @@ -5311,7 +5642,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_38forward_listen_ex(struct __p __pyx_v_listener = libssh2_channel_forward_listen_ex(__pyx_v_self->_session, __pyx_v__host, __pyx_v_port, (&__pyx_v_bound_port), __pyx_v_queue_maxsize); } - /* "ssh2/session.pyx":335 + /* "ssh2/session.pyx":364 * cdef c_ssh2.LIBSSH2_LISTENER *listener * cdef char *_host = to_bytes(host) * with nogil: # <<<<<<<<<<<<<< @@ -5330,7 +5661,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_38forward_listen_ex(struct __p } } - /* "ssh2/session.pyx":338 + /* "ssh2/session.pyx":367 * listener = c_ssh2.libssh2_channel_forward_listen_ex( * self._session, _host, port, &bound_port, queue_maxsize) * if listener is NULL: # <<<<<<<<<<<<<< @@ -5340,7 +5671,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_38forward_listen_ex(struct __p __pyx_t_1 = ((__pyx_v_listener == NULL) != 0); if (__pyx_t_1) { - /* "ssh2/session.pyx":339 + /* "ssh2/session.pyx":368 * self._session, _host, port, &bound_port, queue_maxsize) * if listener is NULL: * return # <<<<<<<<<<<<<< @@ -5351,7 +5682,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_38forward_listen_ex(struct __p __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "ssh2/session.pyx":338 + /* "ssh2/session.pyx":367 * listener = c_ssh2.libssh2_channel_forward_listen_ex( * self._session, _host, port, &bound_port, queue_maxsize) * if listener is NULL: # <<<<<<<<<<<<<< @@ -5360,7 +5691,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_38forward_listen_ex(struct __p */ } - /* "ssh2/session.pyx":340 + /* "ssh2/session.pyx":369 * if listener is NULL: * return * return PyListener(listener, self) # <<<<<<<<<<<<<< @@ -5368,13 +5699,13 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_38forward_listen_ex(struct __p * def sftp_init(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __pyx_f_4ssh2_8listener_PyListener(__pyx_v_listener, __pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 340, __pyx_L1_error) + __pyx_t_2 = __pyx_f_4ssh2_8listener_PyListener(__pyx_v_listener, __pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 369, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":331 + /* "ssh2/session.pyx":360 * return PyListener(listener, self) * * def forward_listen_ex(self, host not None, int port, # <<<<<<<<<<<<<< @@ -5393,7 +5724,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_38forward_listen_ex(struct __p return __pyx_r; } -/* "ssh2/session.pyx":342 +/* "ssh2/session.pyx":371 * return PyListener(listener, self) * * def sftp_init(self): # <<<<<<<<<<<<<< @@ -5402,20 +5733,20 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_38forward_listen_ex(struct __p */ /* Python wrapper */ -static PyObject *__pyx_pw_4ssh2_7session_7Session_41sftp_init(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static char __pyx_doc_4ssh2_7session_7Session_40sftp_init[] = "Session.sftp_init(self)\nInitialise SFTP channel.\n\n :rtype: :py:class:`ssh2.sftp.SFTP`\n "; -static PyObject *__pyx_pw_4ssh2_7session_7Session_41sftp_init(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { +static PyObject *__pyx_pw_4ssh2_7session_7Session_47sftp_init(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_4ssh2_7session_7Session_46sftp_init[] = "Session.sftp_init(self)\nInitialise SFTP channel.\n\n :rtype: :py:class:`ssh2.sftp.SFTP`\n "; +static PyObject *__pyx_pw_4ssh2_7session_7Session_47sftp_init(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("sftp_init (wrapper)", 0); - __pyx_r = __pyx_pf_4ssh2_7session_7Session_40sftp_init(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self)); + __pyx_r = __pyx_pf_4ssh2_7session_7Session_46sftp_init(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_4ssh2_7session_7Session_40sftp_init(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self) { +static PyObject *__pyx_pf_4ssh2_7session_7Session_46sftp_init(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self) { LIBSSH2_SFTP *__pyx_v__sftp; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -5423,7 +5754,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_40sftp_init(struct __pyx_obj_4 PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("sftp_init", 0); - /* "ssh2/session.pyx":348 + /* "ssh2/session.pyx":377 * """ * cdef c_sftp.LIBSSH2_SFTP *_sftp * with nogil: # <<<<<<<<<<<<<< @@ -5438,7 +5769,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_40sftp_init(struct __pyx_obj_4 #endif /*try:*/ { - /* "ssh2/session.pyx":349 + /* "ssh2/session.pyx":378 * cdef c_sftp.LIBSSH2_SFTP *_sftp * with nogil: * _sftp = c_sftp.libssh2_sftp_init(self._session) # <<<<<<<<<<<<<< @@ -5448,7 +5779,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_40sftp_init(struct __pyx_obj_4 __pyx_v__sftp = libssh2_sftp_init(__pyx_v_self->_session); } - /* "ssh2/session.pyx":348 + /* "ssh2/session.pyx":377 * """ * cdef c_sftp.LIBSSH2_SFTP *_sftp * with nogil: # <<<<<<<<<<<<<< @@ -5467,7 +5798,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_40sftp_init(struct __pyx_obj_4 } } - /* "ssh2/session.pyx":350 + /* "ssh2/session.pyx":379 * with nogil: * _sftp = c_sftp.libssh2_sftp_init(self._session) * if _sftp is NULL: # <<<<<<<<<<<<<< @@ -5477,7 +5808,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_40sftp_init(struct __pyx_obj_4 __pyx_t_1 = ((__pyx_v__sftp == NULL) != 0); if (__pyx_t_1) { - /* "ssh2/session.pyx":351 + /* "ssh2/session.pyx":380 * _sftp = c_sftp.libssh2_sftp_init(self._session) * if _sftp is NULL: * return # <<<<<<<<<<<<<< @@ -5488,7 +5819,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_40sftp_init(struct __pyx_obj_4 __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "ssh2/session.pyx":350 + /* "ssh2/session.pyx":379 * with nogil: * _sftp = c_sftp.libssh2_sftp_init(self._session) * if _sftp is NULL: # <<<<<<<<<<<<<< @@ -5497,7 +5828,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_40sftp_init(struct __pyx_obj_4 */ } - /* "ssh2/session.pyx":352 + /* "ssh2/session.pyx":381 * if _sftp is NULL: * return * return PySFTP(_sftp, self) # <<<<<<<<<<<<<< @@ -5505,13 +5836,13 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_40sftp_init(struct __pyx_obj_4 * def last_error(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __pyx_f_4ssh2_4sftp_PySFTP(__pyx_v__sftp, __pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 352, __pyx_L1_error) + __pyx_t_2 = __pyx_f_4ssh2_4sftp_PySFTP(__pyx_v__sftp, __pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":342 + /* "ssh2/session.pyx":371 * return PyListener(listener, self) * * def sftp_init(self): # <<<<<<<<<<<<<< @@ -5530,7 +5861,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_40sftp_init(struct __pyx_obj_4 return __pyx_r; } -/* "ssh2/session.pyx":354 +/* "ssh2/session.pyx":383 * return PySFTP(_sftp, self) * * def last_error(self): # <<<<<<<<<<<<<< @@ -5539,20 +5870,20 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_40sftp_init(struct __pyx_obj_4 */ /* Python wrapper */ -static PyObject *__pyx_pw_4ssh2_7session_7Session_43last_error(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static char __pyx_doc_4ssh2_7session_7Session_42last_error[] = "Session.last_error(self)\nRetrieve last error message from libssh2, if any.\n Returns empty string on no error message.\n\n :rtype: str\n "; -static PyObject *__pyx_pw_4ssh2_7session_7Session_43last_error(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { +static PyObject *__pyx_pw_4ssh2_7session_7Session_49last_error(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_4ssh2_7session_7Session_48last_error[] = "Session.last_error(self)\nRetrieve last error message from libssh2, if any.\n Returns empty string on no error message.\n\n :rtype: str\n "; +static PyObject *__pyx_pw_4ssh2_7session_7Session_49last_error(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("last_error (wrapper)", 0); - __pyx_r = __pyx_pf_4ssh2_7session_7Session_42last_error(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self)); + __pyx_r = __pyx_pf_4ssh2_7session_7Session_48last_error(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_4ssh2_7session_7Session_42last_error(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self) { +static PyObject *__pyx_pf_4ssh2_7session_7Session_48last_error(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self) { char **__pyx_v__error_msg; PyObject *__pyx_v_msg = 0; int __pyx_v_errmsg_len; @@ -5569,7 +5900,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_42last_error(struct __pyx_obj_ PyObject *__pyx_t_7 = NULL; __Pyx_RefNannySetupContext("last_error", 0); - /* "ssh2/session.pyx":360 + /* "ssh2/session.pyx":389 * :rtype: str * """ * cdef char **_error_msg = NULL # <<<<<<<<<<<<<< @@ -5578,7 +5909,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_42last_error(struct __pyx_obj_ */ __pyx_v__error_msg = NULL; - /* "ssh2/session.pyx":362 + /* "ssh2/session.pyx":391 * cdef char **_error_msg = NULL * cdef bytes msg * cdef int errmsg_len = 0 # <<<<<<<<<<<<<< @@ -5587,7 +5918,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_42last_error(struct __pyx_obj_ */ __pyx_v_errmsg_len = 0; - /* "ssh2/session.pyx":364 + /* "ssh2/session.pyx":393 * cdef int errmsg_len = 0 * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -5602,7 +5933,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_42last_error(struct __pyx_obj_ #endif /*try:*/ { - /* "ssh2/session.pyx":365 + /* "ssh2/session.pyx":394 * cdef int rc * with nogil: * rc = c_ssh2.libssh2_session_last_error( # <<<<<<<<<<<<<< @@ -5612,7 +5943,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_42last_error(struct __pyx_obj_ __pyx_v_rc = libssh2_session_last_error(__pyx_v_self->_session, __pyx_v__error_msg, (&__pyx_v_errmsg_len), 0); } - /* "ssh2/session.pyx":364 + /* "ssh2/session.pyx":393 * cdef int errmsg_len = 0 * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -5631,7 +5962,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_42last_error(struct __pyx_obj_ } } - /* "ssh2/session.pyx":367 + /* "ssh2/session.pyx":396 * rc = c_ssh2.libssh2_session_last_error( * self._session, _error_msg, &errmsg_len, 0) * if errmsg_len > 0 and _error_msg is not NULL: # <<<<<<<<<<<<<< @@ -5649,7 +5980,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_42last_error(struct __pyx_obj_ __pyx_L7_bool_binop_done:; if (__pyx_t_1) { - /* "ssh2/session.pyx":368 + /* "ssh2/session.pyx":397 * self._session, _error_msg, &errmsg_len, 0) * if errmsg_len > 0 and _error_msg is not NULL: * for line in _error_msg[:errmsg_len]: # <<<<<<<<<<<<<< @@ -5661,24 +5992,24 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_42last_error(struct __pyx_obj_ __pyx_t_3 = __pyx_t_5; __pyx_v_line = (__pyx_t_3[0]); - /* "ssh2/session.pyx":369 + /* "ssh2/session.pyx":398 * if errmsg_len > 0 and _error_msg is not NULL: * for line in _error_msg[:errmsg_len]: * msg += line # <<<<<<<<<<<<<< * else: * msg = b'' */ - if (unlikely(!__pyx_v_msg)) { __Pyx_RaiseUnboundLocalError("msg"); __PYX_ERR(0, 369, __pyx_L1_error) } - __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_line); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 369, __pyx_L1_error) + if (unlikely(!__pyx_v_msg)) { __Pyx_RaiseUnboundLocalError("msg"); __PYX_ERR(0, 398, __pyx_L1_error) } + __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_line); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 398, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PyNumber_InPlaceAdd(__pyx_v_msg, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 369, __pyx_L1_error) + __pyx_t_7 = PyNumber_InPlaceAdd(__pyx_v_msg, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 398, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF_SET(__pyx_v_msg, ((PyObject*)__pyx_t_7)); __pyx_t_7 = 0; } - /* "ssh2/session.pyx":367 + /* "ssh2/session.pyx":396 * rc = c_ssh2.libssh2_session_last_error( * self._session, _error_msg, &errmsg_len, 0) * if errmsg_len > 0 and _error_msg is not NULL: # <<<<<<<<<<<<<< @@ -5688,7 +6019,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_42last_error(struct __pyx_obj_ goto __pyx_L6; } - /* "ssh2/session.pyx":371 + /* "ssh2/session.pyx":400 * msg += line * else: * msg = b'' # <<<<<<<<<<<<<< @@ -5701,20 +6032,20 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_42last_error(struct __pyx_obj_ } __pyx_L6:; - /* "ssh2/session.pyx":372 + /* "ssh2/session.pyx":401 * else: * msg = b'' * return msg # <<<<<<<<<<<<<< * - * def scp_recv(self, path not None): + * def scp_recv2(self, path not None): */ __Pyx_XDECREF(__pyx_r); - if (unlikely(!__pyx_v_msg)) { __Pyx_RaiseUnboundLocalError("msg"); __PYX_ERR(0, 372, __pyx_L1_error) } + if (unlikely(!__pyx_v_msg)) { __Pyx_RaiseUnboundLocalError("msg"); __PYX_ERR(0, 401, __pyx_L1_error) } __Pyx_INCREF(__pyx_v_msg); __pyx_r = __pyx_v_msg; goto __pyx_L0; - /* "ssh2/session.pyx":354 + /* "ssh2/session.pyx":383 * return PySFTP(_sftp, self) * * def last_error(self): # <<<<<<<<<<<<<< @@ -5735,25 +6066,25 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_42last_error(struct __pyx_obj_ return __pyx_r; } -/* "ssh2/session.pyx":374 +/* "ssh2/session.pyx":403 * return msg * - * def scp_recv(self, path not None): # <<<<<<<<<<<<<< - * raise NotImplementedError + * def scp_recv2(self, path not None): # <<<<<<<<<<<<<< + * """Receive file via SCP. * */ /* Python wrapper */ -static PyObject *__pyx_pw_4ssh2_7session_7Session_45scp_recv(PyObject *__pyx_v_self, PyObject *__pyx_v_path); /*proto*/ -static char __pyx_doc_4ssh2_7session_7Session_44scp_recv[] = "Session.scp_recv(self, path)"; -static PyObject *__pyx_pw_4ssh2_7session_7Session_45scp_recv(PyObject *__pyx_v_self, PyObject *__pyx_v_path) { +static PyObject *__pyx_pw_4ssh2_7session_7Session_51scp_recv2(PyObject *__pyx_v_self, PyObject *__pyx_v_path); /*proto*/ +static char __pyx_doc_4ssh2_7session_7Session_50scp_recv2[] = "Session.scp_recv2(self, path)\nReceive file via SCP.\n\n :param path: File path to receive.\n :type path: str\n\n :rtype: tuple(:py:class:`ssh2.channel.Channel`,\n :py:class:`ssh2.fileinfo.FileInfo)"; +static PyObject *__pyx_pw_4ssh2_7session_7Session_51scp_recv2(PyObject *__pyx_v_self, PyObject *__pyx_v_path) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("scp_recv (wrapper)", 0); + __Pyx_RefNannySetupContext("scp_recv2 (wrapper)", 0); if (unlikely(((PyObject *)__pyx_v_path) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "path"); __PYX_ERR(0, 374, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "path"); __PYX_ERR(0, 403, __pyx_L1_error) } - __pyx_r = __pyx_pf_4ssh2_7session_7Session_44scp_recv(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), ((PyObject *)__pyx_v_path)); + __pyx_r = __pyx_pf_4ssh2_7session_7Session_50scp_recv2(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), ((PyObject *)__pyx_v_path)); /* function exit code */ goto __pyx_L0; @@ -5764,53 +6095,161 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_45scp_recv(PyObject *__pyx_v_s return __pyx_r; } -static PyObject *__pyx_pf_4ssh2_7session_7Session_44scp_recv(CYTHON_UNUSED struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_path) { +static PyObject *__pyx_pf_4ssh2_7session_7Session_50scp_recv2(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, PyObject *__pyx_v_path) { + struct __pyx_obj_4ssh2_8fileinfo_FileInfo *__pyx_v_fileinfo = 0; + char *__pyx_v__path; + LIBSSH2_CHANNEL *__pyx_v_channel; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("scp_recv", 0); + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("scp_recv2", 0); + + /* "ssh2/session.pyx":411 + * :rtype: tuple(:py:class:`ssh2.channel.Channel`, + * :py:class:`ssh2.fileinfo.FileInfo)""" + * cdef FileInfo fileinfo = FileInfo() # <<<<<<<<<<<<<< + * cdef char *_path = to_bytes(path) + * cdef c_ssh2.LIBSSH2_CHANNEL *channel + */ + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4ssh2_8fileinfo_FileInfo), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 411, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_fileinfo = ((struct __pyx_obj_4ssh2_8fileinfo_FileInfo *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "ssh2/session.pyx":412 + * :py:class:`ssh2.fileinfo.FileInfo)""" + * cdef FileInfo fileinfo = FileInfo() + * cdef char *_path = to_bytes(path) # <<<<<<<<<<<<<< + * cdef c_ssh2.LIBSSH2_CHANNEL *channel + * with nogil: + */ + __pyx_v__path = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_path); + + /* "ssh2/session.pyx":414 + * cdef char *_path = to_bytes(path) + * cdef c_ssh2.LIBSSH2_CHANNEL *channel + * with nogil: # <<<<<<<<<<<<<< + * channel = c_ssh2.libssh2_scp_recv2( + * self._session, _path, fileinfo._stat) + */ + { + #ifdef WITH_THREAD + PyThreadState *_save; + Py_UNBLOCK_THREADS + __Pyx_FastGIL_Remember(); + #endif + /*try:*/ { + + /* "ssh2/session.pyx":415 + * cdef c_ssh2.LIBSSH2_CHANNEL *channel + * with nogil: + * channel = c_ssh2.libssh2_scp_recv2( # <<<<<<<<<<<<<< + * self._session, _path, fileinfo._stat) + * if channel is not NULL: + */ + __pyx_v_channel = libssh2_scp_recv2(__pyx_v_self->_session, __pyx_v__path, __pyx_v_fileinfo->_stat); + } + + /* "ssh2/session.pyx":414 + * cdef char *_path = to_bytes(path) + * cdef c_ssh2.LIBSSH2_CHANNEL *channel + * with nogil: # <<<<<<<<<<<<<< + * channel = c_ssh2.libssh2_scp_recv2( + * self._session, _path, fileinfo._stat) + */ + /*finally:*/ { + /*normal exit:*/{ + #ifdef WITH_THREAD + __Pyx_FastGIL_Forget(); + Py_BLOCK_THREADS + #endif + goto __pyx_L5; + } + __pyx_L5:; + } + } - /* "ssh2/session.pyx":375 + /* "ssh2/session.pyx":417 + * channel = c_ssh2.libssh2_scp_recv2( + * self._session, _path, fileinfo._stat) + * if channel is not NULL: # <<<<<<<<<<<<<< + * return PyChannel(channel, self), fileinfo * - * def scp_recv(self, path not None): - * raise NotImplementedError # <<<<<<<<<<<<<< + */ + __pyx_t_2 = ((__pyx_v_channel != NULL) != 0); + if (__pyx_t_2) { + + /* "ssh2/session.pyx":418 + * self._session, _path, fileinfo._stat) + * if channel is not NULL: + * return PyChannel(channel, self), fileinfo # <<<<<<<<<<<<<< * * def scp_send(self, path not None, int mode, size_t size): */ - __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); - __PYX_ERR(0, 375, __pyx_L1_error) + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_4ssh2_7channel_PyChannel(__pyx_v_channel, __pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 418, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 418, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_fileinfo)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_fileinfo)); + PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_fileinfo)); + __pyx_t_1 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "ssh2/session.pyx":417 + * channel = c_ssh2.libssh2_scp_recv2( + * self._session, _path, fileinfo._stat) + * if channel is not NULL: # <<<<<<<<<<<<<< + * return PyChannel(channel, self), fileinfo + * + */ + } - /* "ssh2/session.pyx":374 + /* "ssh2/session.pyx":403 * return msg * - * def scp_recv(self, path not None): # <<<<<<<<<<<<<< - * raise NotImplementedError + * def scp_recv2(self, path not None): # <<<<<<<<<<<<<< + * """Receive file via SCP. * */ /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; __pyx_L1_error:; - __Pyx_AddTraceback("ssh2.session.Session.scp_recv", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("ssh2.session.Session.scp_recv2", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_fileinfo); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "ssh2/session.pyx":377 - * raise NotImplementedError +/* "ssh2/session.pyx":420 + * return PyChannel(channel, self), fileinfo * * def scp_send(self, path not None, int mode, size_t size): # <<<<<<<<<<<<<< - * raise NotImplementedError + * """Send file via SCP. * */ /* Python wrapper */ -static PyObject *__pyx_pw_4ssh2_7session_7Session_47scp_send(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_4ssh2_7session_7Session_46scp_send[] = "Session.scp_send(self, path, int mode, size_t size)"; -static PyObject *__pyx_pw_4ssh2_7session_7Session_47scp_send(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - CYTHON_UNUSED PyObject *__pyx_v_path = 0; - CYTHON_UNUSED int __pyx_v_mode; - CYTHON_UNUSED size_t __pyx_v_size; +static PyObject *__pyx_pw_4ssh2_7session_7Session_53scp_send(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_4ssh2_7session_7Session_52scp_send[] = "Session.scp_send(self, path, int mode, size_t size)\nSend file via SCP.\n\n :param path: Local file path to send.\n :type path: str\n :param mode: File mode.\n :type mode: int\n :param size: size of file\n :type size: int\n\n :rtype: :py:class:`ssh2.channel.Channel`"; +static PyObject *__pyx_pw_4ssh2_7session_7Session_53scp_send(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_path = 0; + int __pyx_v_mode; + size_t __pyx_v_size; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("scp_send (wrapper)", 0); @@ -5839,17 +6278,17 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_47scp_send(PyObject *__pyx_v_s case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mode)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("scp_send", 1, 3, 3, 1); __PYX_ERR(0, 377, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("scp_send", 1, 3, 3, 1); __PYX_ERR(0, 420, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("scp_send", 1, 3, 3, 2); __PYX_ERR(0, 377, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("scp_send", 1, 3, 3, 2); __PYX_ERR(0, 420, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "scp_send") < 0)) __PYX_ERR(0, 377, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "scp_send") < 0)) __PYX_ERR(0, 420, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -5859,21 +6298,21 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_47scp_send(PyObject *__pyx_v_s values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_path = values[0]; - __pyx_v_mode = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_mode == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 377, __pyx_L3_error) - __pyx_v_size = __Pyx_PyInt_As_size_t(values[2]); if (unlikely((__pyx_v_size == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 377, __pyx_L3_error) + __pyx_v_mode = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_mode == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 420, __pyx_L3_error) + __pyx_v_size = __Pyx_PyInt_As_size_t(values[2]); if (unlikely((__pyx_v_size == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 420, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("scp_send", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 377, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("scp_send", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 420, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.session.Session.scp_send", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(((PyObject *)__pyx_v_path) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "path"); __PYX_ERR(0, 377, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "path"); __PYX_ERR(0, 420, __pyx_L1_error) } - __pyx_r = __pyx_pf_4ssh2_7session_7Session_46scp_send(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), __pyx_v_path, __pyx_v_mode, __pyx_v_size); + __pyx_r = __pyx_pf_4ssh2_7session_7Session_52scp_send(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), __pyx_v_path, __pyx_v_mode, __pyx_v_size); /* function exit code */ goto __pyx_L0; @@ -5884,55 +6323,139 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_47scp_send(PyObject *__pyx_v_s return __pyx_r; } -static PyObject *__pyx_pf_4ssh2_7session_7Session_46scp_send(CYTHON_UNUSED struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_path, CYTHON_UNUSED int __pyx_v_mode, CYTHON_UNUSED size_t __pyx_v_size) { +static PyObject *__pyx_pf_4ssh2_7session_7Session_52scp_send(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, PyObject *__pyx_v_path, int __pyx_v_mode, size_t __pyx_v_size) { + char *__pyx_v__path; + LIBSSH2_CHANNEL *__pyx_v_channel; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("scp_send", 0); - /* "ssh2/session.pyx":378 + /* "ssh2/session.pyx":431 * - * def scp_send(self, path not None, int mode, size_t size): - * raise NotImplementedError # <<<<<<<<<<<<<< + * :rtype: :py:class:`ssh2.channel.Channel`""" + * cdef char *_path = to_bytes(path) # <<<<<<<<<<<<<< + * cdef c_ssh2.LIBSSH2_CHANNEL *channel + * with nogil: + */ + __pyx_v__path = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_path); + + /* "ssh2/session.pyx":433 + * cdef char *_path = to_bytes(path) + * cdef c_ssh2.LIBSSH2_CHANNEL *channel + * with nogil: # <<<<<<<<<<<<<< + * channel = c_ssh2.libssh2_scp_send( + * self._session, _path, mode, size) + */ + { + #ifdef WITH_THREAD + PyThreadState *_save; + Py_UNBLOCK_THREADS + __Pyx_FastGIL_Remember(); + #endif + /*try:*/ { + + /* "ssh2/session.pyx":434 + * cdef c_ssh2.LIBSSH2_CHANNEL *channel + * with nogil: + * channel = c_ssh2.libssh2_scp_send( # <<<<<<<<<<<<<< + * self._session, _path, mode, size) + * if channel is not NULL: + */ + __pyx_v_channel = libssh2_scp_send(__pyx_v_self->_session, __pyx_v__path, __pyx_v_mode, __pyx_v_size); + } + + /* "ssh2/session.pyx":433 + * cdef char *_path = to_bytes(path) + * cdef c_ssh2.LIBSSH2_CHANNEL *channel + * with nogil: # <<<<<<<<<<<<<< + * channel = c_ssh2.libssh2_scp_send( + * self._session, _path, mode, size) + */ + /*finally:*/ { + /*normal exit:*/{ + #ifdef WITH_THREAD + __Pyx_FastGIL_Forget(); + Py_BLOCK_THREADS + #endif + goto __pyx_L5; + } + __pyx_L5:; + } + } + + /* "ssh2/session.pyx":436 + * channel = c_ssh2.libssh2_scp_send( + * self._session, _path, mode, size) + * if channel is not NULL: # <<<<<<<<<<<<<< + * return PyChannel(channel, self) + * + */ + __pyx_t_1 = ((__pyx_v_channel != NULL) != 0); + if (__pyx_t_1) { + + /* "ssh2/session.pyx":437 + * self._session, _path, mode, size) + * if channel is not NULL: + * return PyChannel(channel, self) # <<<<<<<<<<<<<< * * def scp_send64(self, path not None, int mode, uint64_t size, */ - __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); - __PYX_ERR(0, 378, __pyx_L1_error) + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __pyx_f_4ssh2_7channel_PyChannel(__pyx_v_channel, __pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 437, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "ssh2/session.pyx":436 + * channel = c_ssh2.libssh2_scp_send( + * self._session, _path, mode, size) + * if channel is not NULL: # <<<<<<<<<<<<<< + * return PyChannel(channel, self) + * + */ + } - /* "ssh2/session.pyx":377 - * raise NotImplementedError + /* "ssh2/session.pyx":420 + * return PyChannel(channel, self), fileinfo * * def scp_send(self, path not None, int mode, size_t size): # <<<<<<<<<<<<<< - * raise NotImplementedError + * """Send file via SCP. * */ /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("ssh2.session.Session.scp_send", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; + __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "ssh2/session.pyx":380 - * raise NotImplementedError +/* "ssh2/session.pyx":439 + * return PyChannel(channel, self) * * def scp_send64(self, path not None, int mode, uint64_t size, # <<<<<<<<<<<<<< * time_t mtime, time_t atime): - * raise NotImplementedError + * cdef char *_path = to_bytes(path) */ /* Python wrapper */ -static PyObject *__pyx_pw_4ssh2_7session_7Session_49scp_send64(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_4ssh2_7session_7Session_48scp_send64[] = "Session.scp_send64(self, path, int mode, uint64_t size, time_t mtime, time_t atime)"; -static PyObject *__pyx_pw_4ssh2_7session_7Session_49scp_send64(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - CYTHON_UNUSED PyObject *__pyx_v_path = 0; - CYTHON_UNUSED int __pyx_v_mode; - CYTHON_UNUSED uint64_t __pyx_v_size; - CYTHON_UNUSED time_t __pyx_v_mtime; - CYTHON_UNUSED time_t __pyx_v_atime; +static PyObject *__pyx_pw_4ssh2_7session_7Session_55scp_send64(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_4ssh2_7session_7Session_54scp_send64[] = "Session.scp_send64(self, path, int mode, uint64_t size, time_t mtime, time_t atime)"; +static PyObject *__pyx_pw_4ssh2_7session_7Session_55scp_send64(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_path = 0; + int __pyx_v_mode; + uint64_t __pyx_v_size; + time_t __pyx_v_mtime; + time_t __pyx_v_atime; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("scp_send64 (wrapper)", 0); @@ -5965,94 +6488,174 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_49scp_send64(PyObject *__pyx_v case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mode)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("scp_send64", 1, 5, 5, 1); __PYX_ERR(0, 380, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("scp_send64", 1, 5, 5, 1); __PYX_ERR(0, 439, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("scp_send64", 1, 5, 5, 2); __PYX_ERR(0, 380, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("scp_send64", 1, 5, 5, 2); __PYX_ERR(0, 439, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mtime)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("scp_send64", 1, 5, 5, 3); __PYX_ERR(0, 380, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("scp_send64", 1, 5, 5, 3); __PYX_ERR(0, 439, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_atime)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("scp_send64", 1, 5, 5, 4); __PYX_ERR(0, 380, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("scp_send64", 1, 5, 5, 4); __PYX_ERR(0, 439, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "scp_send64") < 0)) __PYX_ERR(0, 380, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "scp_send64") < 0)) __PYX_ERR(0, 439, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 5) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + } + __pyx_v_path = values[0]; + __pyx_v_mode = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_mode == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 439, __pyx_L3_error) + __pyx_v_size = __Pyx_PyInt_As_uint64_t(values[2]); if (unlikely((__pyx_v_size == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 439, __pyx_L3_error) + __pyx_v_mtime = __Pyx_PyInt_As_time_t(values[3]); if (unlikely((__pyx_v_mtime == ((time_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 440, __pyx_L3_error) + __pyx_v_atime = __Pyx_PyInt_As_time_t(values[4]); if (unlikely((__pyx_v_atime == ((time_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 440, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("scp_send64", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 439, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("ssh2.session.Session.scp_send64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(((PyObject *)__pyx_v_path) == Py_None)) { + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "path"); __PYX_ERR(0, 439, __pyx_L1_error) + } + __pyx_r = __pyx_pf_4ssh2_7session_7Session_54scp_send64(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), __pyx_v_path, __pyx_v_mode, __pyx_v_size, __pyx_v_mtime, __pyx_v_atime); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4ssh2_7session_7Session_54scp_send64(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, PyObject *__pyx_v_path, int __pyx_v_mode, uint64_t __pyx_v_size, time_t __pyx_v_mtime, time_t __pyx_v_atime) { + char *__pyx_v__path; + LIBSSH2_CHANNEL *__pyx_v_channel; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("scp_send64", 0); + + /* "ssh2/session.pyx":441 + * def scp_send64(self, path not None, int mode, uint64_t size, + * time_t mtime, time_t atime): + * cdef char *_path = to_bytes(path) # <<<<<<<<<<<<<< + * cdef c_ssh2.LIBSSH2_CHANNEL *channel + * with nogil: + */ + __pyx_v__path = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_path); + + /* "ssh2/session.pyx":443 + * cdef char *_path = to_bytes(path) + * cdef c_ssh2.LIBSSH2_CHANNEL *channel + * with nogil: # <<<<<<<<<<<<<< + * channel = c_ssh2.libssh2_scp_send64( + * self._session, _path, mode, size, mtime, atime) + */ + { + #ifdef WITH_THREAD + PyThreadState *_save; + Py_UNBLOCK_THREADS + __Pyx_FastGIL_Remember(); + #endif + /*try:*/ { + + /* "ssh2/session.pyx":444 + * cdef c_ssh2.LIBSSH2_CHANNEL *channel + * with nogil: + * channel = c_ssh2.libssh2_scp_send64( # <<<<<<<<<<<<<< + * self._session, _path, mode, size, mtime, atime) + * if channel is not NULL: + */ + __pyx_v_channel = libssh2_scp_send64(__pyx_v_self->_session, __pyx_v__path, __pyx_v_mode, __pyx_v_size, __pyx_v_mtime, __pyx_v_atime); + } + + /* "ssh2/session.pyx":443 + * cdef char *_path = to_bytes(path) + * cdef c_ssh2.LIBSSH2_CHANNEL *channel + * with nogil: # <<<<<<<<<<<<<< + * channel = c_ssh2.libssh2_scp_send64( + * self._session, _path, mode, size, mtime, atime) + */ + /*finally:*/ { + /*normal exit:*/{ + #ifdef WITH_THREAD + __Pyx_FastGIL_Forget(); + Py_BLOCK_THREADS + #endif + goto __pyx_L5; + } + __pyx_L5:; } - } else if (PyTuple_GET_SIZE(__pyx_args) != 5) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - } - __pyx_v_path = values[0]; - __pyx_v_mode = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_mode == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 380, __pyx_L3_error) - __pyx_v_size = __Pyx_PyInt_As_uint64_t(values[2]); if (unlikely((__pyx_v_size == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 380, __pyx_L3_error) - __pyx_v_mtime = __Pyx_PyInt_As_time_t(values[3]); if (unlikely((__pyx_v_mtime == ((time_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 381, __pyx_L3_error) - __pyx_v_atime = __Pyx_PyInt_As_time_t(values[4]); if (unlikely((__pyx_v_atime == ((time_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 381, __pyx_L3_error) - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("scp_send64", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 380, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("ssh2.session.Session.scp_send64", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(((PyObject *)__pyx_v_path) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "path"); __PYX_ERR(0, 380, __pyx_L1_error) } - __pyx_r = __pyx_pf_4ssh2_7session_7Session_48scp_send64(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), __pyx_v_path, __pyx_v_mode, __pyx_v_size, __pyx_v_mtime, __pyx_v_atime); - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} + /* "ssh2/session.pyx":446 + * channel = c_ssh2.libssh2_scp_send64( + * self._session, _path, mode, size, mtime, atime) + * if channel is not NULL: # <<<<<<<<<<<<<< + * return PyChannel(channel, self) + */ + __pyx_t_1 = ((__pyx_v_channel != NULL) != 0); + if (__pyx_t_1) { -static PyObject *__pyx_pf_4ssh2_7session_7Session_48scp_send64(CYTHON_UNUSED struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_path, CYTHON_UNUSED int __pyx_v_mode, CYTHON_UNUSED uint64_t __pyx_v_size, CYTHON_UNUSED time_t __pyx_v_mtime, CYTHON_UNUSED time_t __pyx_v_atime) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("scp_send64", 0); + /* "ssh2/session.pyx":447 + * self._session, _path, mode, size, mtime, atime) + * if channel is not NULL: + * return PyChannel(channel, self) # <<<<<<<<<<<<<< + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __pyx_f_4ssh2_7channel_PyChannel(__pyx_v_channel, __pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 447, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; - /* "ssh2/session.pyx":382 - * def scp_send64(self, path not None, int mode, uint64_t size, - * time_t mtime, time_t atime): - * raise NotImplementedError # <<<<<<<<<<<<<< - * - * # cdef c_ssh2.LIBSSH2_CHANNEL * scp_recv2( + /* "ssh2/session.pyx":446 + * channel = c_ssh2.libssh2_scp_send64( + * self._session, _path, mode, size, mtime, atime) + * if channel is not NULL: # <<<<<<<<<<<<<< + * return PyChannel(channel, self) */ - __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); - __PYX_ERR(0, 382, __pyx_L1_error) + } - /* "ssh2/session.pyx":380 - * raise NotImplementedError + /* "ssh2/session.pyx":439 + * return PyChannel(channel, self) * * def scp_send64(self, path not None, int mode, uint64_t size, # <<<<<<<<<<<<<< * time_t mtime, time_t atime): - * raise NotImplementedError + * cdef char *_path = to_bytes(path) */ /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("ssh2.session.Session.scp_send64", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; + __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; @@ -6065,20 +6668,20 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_48scp_send64(CYTHON_UNUSED str */ /* Python wrapper */ -static PyObject *__pyx_pw_4ssh2_7session_7Session_51__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static char __pyx_doc_4ssh2_7session_7Session_50__reduce_cython__[] = "Session.__reduce_cython__(self)"; -static PyObject *__pyx_pw_4ssh2_7session_7Session_51__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { +static PyObject *__pyx_pw_4ssh2_7session_7Session_57__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_4ssh2_7session_7Session_56__reduce_cython__[] = "Session.__reduce_cython__(self)"; +static PyObject *__pyx_pw_4ssh2_7session_7Session_57__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); - __pyx_r = __pyx_pf_4ssh2_7session_7Session_50__reduce_cython__(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self)); + __pyx_r = __pyx_pf_4ssh2_7session_7Session_56__reduce_cython__(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_4ssh2_7session_7Session_50__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self) { +static PyObject *__pyx_pf_4ssh2_7session_7Session_56__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -6120,20 +6723,20 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_50__reduce_cython__(CYTHON_UNU */ /* Python wrapper */ -static PyObject *__pyx_pw_4ssh2_7session_7Session_53__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ -static char __pyx_doc_4ssh2_7session_7Session_52__setstate_cython__[] = "Session.__setstate_cython__(self, __pyx_state)"; -static PyObject *__pyx_pw_4ssh2_7session_7Session_53__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { +static PyObject *__pyx_pw_4ssh2_7session_7Session_59__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static char __pyx_doc_4ssh2_7session_7Session_58__setstate_cython__[] = "Session.__setstate_cython__(self, __pyx_state)"; +static PyObject *__pyx_pw_4ssh2_7session_7Session_59__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); - __pyx_r = __pyx_pf_4ssh2_7session_7Session_52__setstate_cython__(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + __pyx_r = __pyx_pf_4ssh2_7session_7Session_58__setstate_cython__(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_4ssh2_7session_7Session_52__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { +static PyObject *__pyx_pf_4ssh2_7session_7Session_58__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -6207,28 +6810,31 @@ static PyMethodDef __pyx_methods_4ssh2_7session_Session[] = { {"disconnect", (PyCFunction)__pyx_pw_4ssh2_7session_7Session_5disconnect, METH_NOARGS, __pyx_doc_4ssh2_7session_7Session_4disconnect}, {"handshake", (PyCFunction)__pyx_pw_4ssh2_7session_7Session_7handshake, METH_O, __pyx_doc_4ssh2_7session_7Session_6handshake}, {"startup", (PyCFunction)__pyx_pw_4ssh2_7session_7Session_9startup, METH_O, __pyx_doc_4ssh2_7session_7Session_8startup}, - {"setblocking", (PyCFunction)__pyx_pw_4ssh2_7session_7Session_11setblocking, METH_O, __pyx_doc_4ssh2_7session_7Session_10setblocking}, - {"userauth_authenticated", (PyCFunction)__pyx_pw_4ssh2_7session_7Session_13userauth_authenticated, METH_NOARGS, __pyx_doc_4ssh2_7session_7Session_12userauth_authenticated}, - {"userauth_list", (PyCFunction)__pyx_pw_4ssh2_7session_7Session_15userauth_list, METH_O, __pyx_doc_4ssh2_7session_7Session_14userauth_list}, - {"userauth_publickey_fromfile", (PyCFunction)__pyx_pw_4ssh2_7session_7Session_17userauth_publickey_fromfile, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_16userauth_publickey_fromfile}, - {"userauth_publickey", (PyCFunction)__pyx_pw_4ssh2_7session_7Session_19userauth_publickey, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_18userauth_publickey}, - {"userauth_hostbased_fromfile", (PyCFunction)__pyx_pw_4ssh2_7session_7Session_21userauth_hostbased_fromfile, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_20userauth_hostbased_fromfile}, - {"userauth_password", (PyCFunction)__pyx_pw_4ssh2_7session_7Session_23userauth_password, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_22userauth_password}, - {"agent_init", (PyCFunction)__pyx_pw_4ssh2_7session_7Session_25agent_init, METH_NOARGS, __pyx_doc_4ssh2_7session_7Session_24agent_init}, - {"agent_auth", (PyCFunction)__pyx_pw_4ssh2_7session_7Session_27agent_auth, METH_O, __pyx_doc_4ssh2_7session_7Session_26agent_auth}, - {"open_session", (PyCFunction)__pyx_pw_4ssh2_7session_7Session_29open_session, METH_NOARGS, __pyx_doc_4ssh2_7session_7Session_28open_session}, - {"direct_tcpip_ex", (PyCFunction)__pyx_pw_4ssh2_7session_7Session_31direct_tcpip_ex, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_30direct_tcpip_ex}, - {"direct_tcpip", (PyCFunction)__pyx_pw_4ssh2_7session_7Session_33direct_tcpip, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_32direct_tcpip}, - {"blockdirections", (PyCFunction)__pyx_pw_4ssh2_7session_7Session_35blockdirections, METH_NOARGS, __pyx_doc_4ssh2_7session_7Session_34blockdirections}, - {"forward_listen", (PyCFunction)__pyx_pw_4ssh2_7session_7Session_37forward_listen, METH_O, __pyx_doc_4ssh2_7session_7Session_36forward_listen}, - {"forward_listen_ex", (PyCFunction)__pyx_pw_4ssh2_7session_7Session_39forward_listen_ex, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_38forward_listen_ex}, - {"sftp_init", (PyCFunction)__pyx_pw_4ssh2_7session_7Session_41sftp_init, METH_NOARGS, __pyx_doc_4ssh2_7session_7Session_40sftp_init}, - {"last_error", (PyCFunction)__pyx_pw_4ssh2_7session_7Session_43last_error, METH_NOARGS, __pyx_doc_4ssh2_7session_7Session_42last_error}, - {"scp_recv", (PyCFunction)__pyx_pw_4ssh2_7session_7Session_45scp_recv, METH_O, __pyx_doc_4ssh2_7session_7Session_44scp_recv}, - {"scp_send", (PyCFunction)__pyx_pw_4ssh2_7session_7Session_47scp_send, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_46scp_send}, - {"scp_send64", (PyCFunction)__pyx_pw_4ssh2_7session_7Session_49scp_send64, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_48scp_send64}, - {"__reduce_cython__", (PyCFunction)__pyx_pw_4ssh2_7session_7Session_51__reduce_cython__, METH_NOARGS, __pyx_doc_4ssh2_7session_7Session_50__reduce_cython__}, - {"__setstate_cython__", (PyCFunction)__pyx_pw_4ssh2_7session_7Session_53__setstate_cython__, METH_O, __pyx_doc_4ssh2_7session_7Session_52__setstate_cython__}, + {"set_blocking", (PyCFunction)__pyx_pw_4ssh2_7session_7Session_11set_blocking, METH_O, __pyx_doc_4ssh2_7session_7Session_10set_blocking}, + {"get_blocking", (PyCFunction)__pyx_pw_4ssh2_7session_7Session_13get_blocking, METH_NOARGS, __pyx_doc_4ssh2_7session_7Session_12get_blocking}, + {"set_timeout", (PyCFunction)__pyx_pw_4ssh2_7session_7Session_15set_timeout, METH_O, __pyx_doc_4ssh2_7session_7Session_14set_timeout}, + {"get_timeout", (PyCFunction)__pyx_pw_4ssh2_7session_7Session_17get_timeout, METH_NOARGS, __pyx_doc_4ssh2_7session_7Session_16get_timeout}, + {"userauth_authenticated", (PyCFunction)__pyx_pw_4ssh2_7session_7Session_19userauth_authenticated, METH_NOARGS, __pyx_doc_4ssh2_7session_7Session_18userauth_authenticated}, + {"userauth_list", (PyCFunction)__pyx_pw_4ssh2_7session_7Session_21userauth_list, METH_O, __pyx_doc_4ssh2_7session_7Session_20userauth_list}, + {"userauth_publickey_fromfile", (PyCFunction)__pyx_pw_4ssh2_7session_7Session_23userauth_publickey_fromfile, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_22userauth_publickey_fromfile}, + {"userauth_publickey", (PyCFunction)__pyx_pw_4ssh2_7session_7Session_25userauth_publickey, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_24userauth_publickey}, + {"userauth_hostbased_fromfile", (PyCFunction)__pyx_pw_4ssh2_7session_7Session_27userauth_hostbased_fromfile, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_26userauth_hostbased_fromfile}, + {"userauth_password", (PyCFunction)__pyx_pw_4ssh2_7session_7Session_29userauth_password, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_28userauth_password}, + {"agent_init", (PyCFunction)__pyx_pw_4ssh2_7session_7Session_31agent_init, METH_NOARGS, __pyx_doc_4ssh2_7session_7Session_30agent_init}, + {"agent_auth", (PyCFunction)__pyx_pw_4ssh2_7session_7Session_33agent_auth, METH_O, __pyx_doc_4ssh2_7session_7Session_32agent_auth}, + {"open_session", (PyCFunction)__pyx_pw_4ssh2_7session_7Session_35open_session, METH_NOARGS, __pyx_doc_4ssh2_7session_7Session_34open_session}, + {"direct_tcpip_ex", (PyCFunction)__pyx_pw_4ssh2_7session_7Session_37direct_tcpip_ex, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_36direct_tcpip_ex}, + {"direct_tcpip", (PyCFunction)__pyx_pw_4ssh2_7session_7Session_39direct_tcpip, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_38direct_tcpip}, + {"blockdirections", (PyCFunction)__pyx_pw_4ssh2_7session_7Session_41blockdirections, METH_NOARGS, __pyx_doc_4ssh2_7session_7Session_40blockdirections}, + {"forward_listen", (PyCFunction)__pyx_pw_4ssh2_7session_7Session_43forward_listen, METH_O, __pyx_doc_4ssh2_7session_7Session_42forward_listen}, + {"forward_listen_ex", (PyCFunction)__pyx_pw_4ssh2_7session_7Session_45forward_listen_ex, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_44forward_listen_ex}, + {"sftp_init", (PyCFunction)__pyx_pw_4ssh2_7session_7Session_47sftp_init, METH_NOARGS, __pyx_doc_4ssh2_7session_7Session_46sftp_init}, + {"last_error", (PyCFunction)__pyx_pw_4ssh2_7session_7Session_49last_error, METH_NOARGS, __pyx_doc_4ssh2_7session_7Session_48last_error}, + {"scp_recv2", (PyCFunction)__pyx_pw_4ssh2_7session_7Session_51scp_recv2, METH_O, __pyx_doc_4ssh2_7session_7Session_50scp_recv2}, + {"scp_send", (PyCFunction)__pyx_pw_4ssh2_7session_7Session_53scp_send, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_52scp_send}, + {"scp_send64", (PyCFunction)__pyx_pw_4ssh2_7session_7Session_55scp_send64, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_54scp_send64}, + {"__reduce_cython__", (PyCFunction)__pyx_pw_4ssh2_7session_7Session_57__reduce_cython__, METH_NOARGS, __pyx_doc_4ssh2_7session_7Session_56__reduce_cython__}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_4ssh2_7session_7Session_59__setstate_cython__, METH_O, __pyx_doc_4ssh2_7session_7Session_58__setstate_cython__}, {0, 0, 0, 0} }; @@ -6316,7 +6922,6 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_s_, __pyx_k_, sizeof(__pyx_k_), 0, 0, 1, 0}, {&__pyx_kp_s_Failure_requesting_identities_fr, __pyx_k_Failure_requesting_identities_fr, sizeof(__pyx_k_Failure_requesting_identities_fr), 0, 0, 1, 0}, {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1}, - {&__pyx_n_s_NotImplementedError, __pyx_k_NotImplementedError, sizeof(__pyx_k_NotImplementedError), 0, 0, 1, 1}, {&__pyx_kp_s_SSH_session_handshake_failed_wit, __pyx_k_SSH_session_handshake_failed_wit, sizeof(__pyx_k_SSH_session_handshake_failed_wit), 0, 0, 1, 0}, {&__pyx_kp_s_SSH_session_startup_failed_with, __pyx_k_SSH_session_startup_failed_with, sizeof(__pyx_k_SSH_session_startup_failed_with), 0, 0, 1, 0}, {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, @@ -6351,8 +6956,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {0, 0, 0, 0, 0, 0, 0} }; static int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(0, 41, __pyx_L1_error) - __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) __PYX_ERR(0, 375, __pyx_L1_error) + __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(0, 43, __pyx_L1_error) __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error) return 0; __pyx_L1_error:; @@ -6363,36 +6967,36 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - /* "ssh2/session.pyx":111 + /* "ssh2/session.pyx":140 * return * auth = to_str(_auth) * return auth.split(',') # <<<<<<<<<<<<<< * * def userauth_publickey_fromfile(self, username not None, */ - __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 111, __pyx_L1_error) + __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); - /* "ssh2/session.pyx":227 + /* "ssh2/session.pyx":256 * c_ssh2.libssh2_agent_free(agent) * with gil: - * raise AgentConnectError("Unable to connect to agent") # <<<<<<<<<<<<<< + * raise AgentConnectionError("Unable to connect to agent") # <<<<<<<<<<<<<< * return agent * */ - __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_connect_to_agent); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 227, __pyx_L1_error) + __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_connect_to_agent); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); - /* "ssh2/session.pyx":267 + /* "ssh2/session.pyx":296 * clear_agent(agent) * with gil: * raise AgentListIdentitiesError( # <<<<<<<<<<<<<< * "Failure requesting identities from agent") * while 1: */ - __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_Failure_requesting_identities_fr); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 267, __pyx_L1_error) + __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_Failure_requesting_identities_fr); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 296, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); @@ -6521,11 +7125,11 @@ PyMODINIT_FUNC PyInit_session(void) __pyx_vtabptr_4ssh2_7session_Session = &__pyx_vtable_4ssh2_7session_Session; __pyx_vtable_4ssh2_7session_Session.init_connect_agent = (LIBSSH2_AGENT *(*)(struct __pyx_obj_4ssh2_7session_Session *))__pyx_f_4ssh2_7session_7Session_init_connect_agent; __pyx_vtable_4ssh2_7session_Session._agent_init = (LIBSSH2_AGENT *(*)(struct __pyx_obj_4ssh2_7session_Session *))__pyx_f_4ssh2_7session_7Session__agent_init; - if (PyType_Ready(&__pyx_type_4ssh2_7session_Session) < 0) __PYX_ERR(0, 32, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_4ssh2_7session_Session) < 0) __PYX_ERR(0, 34, __pyx_L1_error) __pyx_type_4ssh2_7session_Session.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_4ssh2_7session_Session.tp_dict, __pyx_vtabptr_4ssh2_7session_Session) < 0) __PYX_ERR(0, 32, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "Session", (PyObject *)&__pyx_type_4ssh2_7session_Session) < 0) __PYX_ERR(0, 32, __pyx_L1_error) - if (__Pyx_setup_reduce((PyObject*)&__pyx_type_4ssh2_7session_Session) < 0) __PYX_ERR(0, 32, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type_4ssh2_7session_Session.tp_dict, __pyx_vtabptr_4ssh2_7session_Session) < 0) __PYX_ERR(0, 34, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "Session", (PyObject *)&__pyx_type_4ssh2_7session_Session) < 0) __PYX_ERR(0, 34, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_4ssh2_7session_Session) < 0) __PYX_ERR(0, 34, __pyx_L1_error) __pyx_ptype_4ssh2_7session_Session = &__pyx_type_4ssh2_7session_Session; /*--- Type import code ---*/ __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", @@ -6541,7 +7145,7 @@ PyMODINIT_FUNC PyInit_session(void) __pyx_ptype_4ssh2_7channel_Channel = __Pyx_ImportType("ssh2.channel", "Channel", sizeof(struct __pyx_obj_4ssh2_7channel_Channel), 1); if (unlikely(!__pyx_ptype_4ssh2_7channel_Channel)) __PYX_ERR(6, 24, __pyx_L1_error) __pyx_ptype_4ssh2_10exceptions_AgentError = __Pyx_ImportType("ssh2.exceptions", "AgentError", sizeof(struct __pyx_obj_4ssh2_10exceptions_AgentError), 1); if (unlikely(!__pyx_ptype_4ssh2_10exceptions_AgentError)) __PYX_ERR(7, 17, __pyx_L1_error) __pyx_ptype_4ssh2_10exceptions_AuthenticationError = __Pyx_ImportType("ssh2.exceptions", "AuthenticationError", sizeof(struct __pyx_obj_4ssh2_10exceptions_AuthenticationError), 1); if (unlikely(!__pyx_ptype_4ssh2_10exceptions_AuthenticationError)) __PYX_ERR(7, 21, __pyx_L1_error) - __pyx_ptype_4ssh2_10exceptions_AgentConnectError = __Pyx_ImportType("ssh2.exceptions", "AgentConnectError", sizeof(struct __pyx_obj_4ssh2_10exceptions_AgentConnectError), 1); if (unlikely(!__pyx_ptype_4ssh2_10exceptions_AgentConnectError)) __PYX_ERR(7, 25, __pyx_L1_error) + __pyx_ptype_4ssh2_10exceptions_AgentConnectionError = __Pyx_ImportType("ssh2.exceptions", "AgentConnectionError", sizeof(struct __pyx_obj_4ssh2_10exceptions_AgentConnectionError), 1); if (unlikely(!__pyx_ptype_4ssh2_10exceptions_AgentConnectionError)) __PYX_ERR(7, 25, __pyx_L1_error) __pyx_ptype_4ssh2_10exceptions_AgentAuthenticationError = __Pyx_ImportType("ssh2.exceptions", "AgentAuthenticationError", sizeof(struct __pyx_obj_4ssh2_10exceptions_AgentAuthenticationError), 1); if (unlikely(!__pyx_ptype_4ssh2_10exceptions_AgentAuthenticationError)) __PYX_ERR(7, 29, __pyx_L1_error) __pyx_ptype_4ssh2_10exceptions_AgentListIdentitiesError = __Pyx_ImportType("ssh2.exceptions", "AgentListIdentitiesError", sizeof(struct __pyx_obj_4ssh2_10exceptions_AgentListIdentitiesError), 1); if (unlikely(!__pyx_ptype_4ssh2_10exceptions_AgentListIdentitiesError)) __PYX_ERR(7, 33, __pyx_L1_error) __pyx_ptype_4ssh2_10exceptions_AgentGetIdentityError = __Pyx_ImportType("ssh2.exceptions", "AgentGetIdentityError", sizeof(struct __pyx_obj_4ssh2_10exceptions_AgentGetIdentityError), 1); if (unlikely(!__pyx_ptype_4ssh2_10exceptions_AgentGetIdentityError)) __PYX_ERR(7, 37, __pyx_L1_error) @@ -6552,6 +7156,7 @@ PyMODINIT_FUNC PyInit_session(void) __pyx_ptype_4ssh2_10exceptions_SFTPBufferTooSmall = __Pyx_ImportType("ssh2.exceptions", "SFTPBufferTooSmall", sizeof(struct __pyx_obj_4ssh2_10exceptions_SFTPBufferTooSmall), 1); if (unlikely(!__pyx_ptype_4ssh2_10exceptions_SFTPBufferTooSmall)) __PYX_ERR(7, 57, __pyx_L1_error) __pyx_ptype_4ssh2_8listener_Listener = __Pyx_ImportType("ssh2.listener", "Listener", sizeof(struct __pyx_obj_4ssh2_8listener_Listener), 1); if (unlikely(!__pyx_ptype_4ssh2_8listener_Listener)) __PYX_ERR(8, 24, __pyx_L1_error) __pyx_ptype_4ssh2_4sftp_SFTP = __Pyx_ImportType("ssh2.sftp", "SFTP", sizeof(struct __pyx_obj_4ssh2_4sftp_SFTP), 1); if (unlikely(!__pyx_ptype_4ssh2_4sftp_SFTP)) __PYX_ERR(9, 26, __pyx_L1_error) + __pyx_ptype_4ssh2_8fileinfo_FileInfo = __Pyx_ImportType("ssh2.fileinfo", "FileInfo", sizeof(struct __pyx_obj_4ssh2_8fileinfo_FileInfo), 1); if (unlikely(!__pyx_ptype_4ssh2_8fileinfo_FileInfo)) __PYX_ERR(10, 3, __pyx_L1_error) /*--- Variable import code ---*/ /*--- Function import code ---*/ __pyx_t_1 = __Pyx_ImportModule("ssh2.agent"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) @@ -7427,20 +8032,240 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, #endif } } else { - if (sizeof(int) <= sizeof(long)) { - return PyInt_FromLong((long) value); -#ifdef HAVE_LONG_LONG - } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { - return PyLong_FromLongLong((PY_LONG_LONG) value); -#endif - } - } - { - int one = 1; int little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&value; - return _PyLong_FromByteArray(bytes, sizeof(int), - little, !is_unsigned); + if (sizeof(int) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(int), + little, !is_unsigned); + } +} + +/* CIntToPy */ + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + const long neg_one = (long) -1, const_zero = (long) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } +} + +/* CIntFromPy */ + static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + const long neg_one = (long) -1, const_zero = (long) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { + return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { + return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { + return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (long) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) + case -2: + if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + } +#endif + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + long val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to long"); + return (long) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; } /* CIntFromPy */ @@ -8199,226 +9024,6 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, return (time_t) -1; } -/* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { - const long neg_one = (long) -1, const_zero = (long) 0; - const int is_unsigned = neg_one > const_zero; - if (is_unsigned) { - if (sizeof(long) < sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(long) <= sizeof(unsigned long)) { - return PyLong_FromUnsignedLong((unsigned long) value); -#ifdef HAVE_LONG_LONG - } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { - return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); -#endif - } - } else { - if (sizeof(long) <= sizeof(long)) { - return PyInt_FromLong((long) value); -#ifdef HAVE_LONG_LONG - } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { - return PyLong_FromLongLong((PY_LONG_LONG) value); -#endif - } - } - { - int one = 1; int little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&value; - return _PyLong_FromByteArray(bytes, sizeof(long), - little, !is_unsigned); - } -} - -/* CIntFromPy */ - static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { - const long neg_one = (long) -1, const_zero = (long) 0; - const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - if (sizeof(long) < sizeof(long)) { - __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) - } else { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - goto raise_neg_overflow; - } - return (long) val; - } - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; - switch (Py_SIZE(x)) { - case 0: return (long) 0; - case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) - case 2: - if (8 * sizeof(long) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { - return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); - } - } - break; - case 3: - if (8 * sizeof(long) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { - return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); - } - } - break; - case 4: - if (8 * sizeof(long) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { - return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); - } - } - break; - } -#endif -#if CYTHON_COMPILING_IN_CPYTHON - if (unlikely(Py_SIZE(x) < 0)) { - goto raise_neg_overflow; - } -#else - { - int result = PyObject_RichCompareBool(x, Py_False, Py_LT); - if (unlikely(result < 0)) - return (long) -1; - if (unlikely(result == 1)) - goto raise_neg_overflow; - } -#endif - if (sizeof(long) <= sizeof(unsigned long)) { - __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) -#ifdef HAVE_LONG_LONG - } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) -#endif - } - } else { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; - switch (Py_SIZE(x)) { - case 0: return (long) 0; - case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0])) - case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) - case -2: - if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { - return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case 2: - if (8 * sizeof(long) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { - return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case -3: - if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { - return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case 3: - if (8 * sizeof(long) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { - return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case -4: - if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { - return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case 4: - if (8 * sizeof(long) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { - return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - } -#endif - if (sizeof(long) <= sizeof(long)) { - __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) -#ifdef HAVE_LONG_LONG - } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) -#endif - } - } - { -#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) - PyErr_SetString(PyExc_RuntimeError, - "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); -#else - long val; - PyObject *v = __Pyx_PyNumber_IntOrLong(x); - #if PY_MAJOR_VERSION < 3 - if (likely(v) && !PyLong_Check(v)) { - PyObject *tmp = v; - v = PyNumber_Long(tmp); - Py_DECREF(tmp); - } - #endif - if (likely(v)) { - int one = 1; int is_little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&val; - int ret = _PyLong_AsByteArray((PyLongObject *)v, - bytes, sizeof(val), - is_little, !is_unsigned); - Py_DECREF(v); - if (likely(!ret)) - return val; - } -#endif - return (long) -1; - } - } else { - long val; - PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); - if (!tmp) return (long) -1; - val = __Pyx_PyInt_As_long(tmp); - Py_DECREF(tmp); - return val; - } -raise_overflow: - PyErr_SetString(PyExc_OverflowError, - "value too large to convert to long"); - return (long) -1; -raise_neg_overflow: - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to long"); - return (long) -1; -} - /* CheckBinaryVersion */ static int __Pyx_check_binary_version(void) { char ctversion[4], rtversion[4]; diff --git a/ssh2/session.pyx b/ssh2/session.pyx index aa0382be..488cfed0 100644 --- a/ssh2/session.pyx +++ b/ssh2/session.pyx @@ -23,10 +23,11 @@ cimport c_sftp from agent cimport PyAgent, auth_identity, clear_agent from channel cimport PyChannel from exceptions cimport SessionHandshakeError, SessionStartupError, \ - AgentConnectError, AgentListIdentitiesError, AgentGetIdentityError + AgentConnectionError, AgentListIdentitiesError, AgentGetIdentityError from listener cimport PyListener from sftp cimport PySFTP from utils cimport to_bytes, to_str +from fileinfo cimport FileInfo cdef class Session: @@ -75,7 +76,7 @@ cdef class Session: rc) return rc - def setblocking(self, bint blocking): + def set_blocking(self, bint blocking): """Set session blocking mode on/off. :param blocking: ``False`` for non-blocking, ``True`` for blocking. @@ -85,6 +86,33 @@ cdef class Session: c_ssh2.libssh2_session_set_blocking( self._session, blocking) + def get_blocking(self): + """Get session blocking mode enabled True/False. + + :rtype: bool""" + cdef int rc + with nogil: + rc = c_ssh2.libssh2_session_get_blocking(self._session) + return bool(rc) + + def set_timeout(self, long timeout): + """Set the timeout in milliseconds for how long a blocking the libssh2 + function calls may wait until they consider the situation an error and + return :py:class:`ssh2.error_codes.LIBSSH2_ERROR_TIMEOUT`. + + By default or if you set the timeout to zero, libssh2 has no timeout + for blocking functions. + :param timeout: Milliseconds to wait before timeout.""" + with nogil: + c_ssh2.libssh2_session_set_timeout(self._session, timeout) + + def get_timeout(self): + """Get current session timeout setting""" + cdef long timeout + with nogil: + timeout = c_ssh2.libssh2_session_get_timeout(self._session) + return timeout + def userauth_authenticated(self): """True/False for is user authenticated or not. @@ -224,7 +252,7 @@ cdef class Session: if c_ssh2.libssh2_agent_connect(agent) != 0: c_ssh2.libssh2_agent_free(agent) with gil: - raise AgentConnectError("Unable to connect to agent") + raise AgentConnectionError("Unable to connect to agent") return agent def agent_auth(self, username not None): @@ -371,20 +399,48 @@ cdef class Session: msg = b'' return msg - def scp_recv(self, path not None): - raise NotImplementedError + def scp_recv2(self, path not None): + """Receive file via SCP. + + :param path: File path to receive. + :type path: str + + :rtype: tuple(:py:class:`ssh2.channel.Channel`, + :py:class:`ssh2.fileinfo.FileInfo)""" + cdef FileInfo fileinfo = FileInfo() + cdef char *_path = to_bytes(path) + cdef c_ssh2.LIBSSH2_CHANNEL *channel + with nogil: + channel = c_ssh2.libssh2_scp_recv2( + self._session, _path, fileinfo._stat) + if channel is not NULL: + return PyChannel(channel, self), fileinfo def scp_send(self, path not None, int mode, size_t size): - raise NotImplementedError + """Send file via SCP. + + :param path: Local file path to send. + :type path: str + :param mode: File mode. + :type mode: int + :param size: size of file + :type size: int + + :rtype: :py:class:`ssh2.channel.Channel`""" + cdef char *_path = to_bytes(path) + cdef c_ssh2.LIBSSH2_CHANNEL *channel + with nogil: + channel = c_ssh2.libssh2_scp_send( + self._session, _path, mode, size) + if channel is not NULL: + return PyChannel(channel, self) def scp_send64(self, path not None, int mode, uint64_t size, time_t mtime, time_t atime): - raise NotImplementedError - - # cdef c_ssh2.LIBSSH2_CHANNEL * scp_recv2( - # self, const char *path, libssh2_struct_stat *stat): - # cdef c_ssh2.LIBSSH2_CHANNEL *_channel - # with nogil: - # _channel = c_ssh2.libssh2_scp_recv2( - # self._session, path, stat) - # return _channel + cdef char *_path = to_bytes(path) + cdef c_ssh2.LIBSSH2_CHANNEL *channel + with nogil: + channel = c_ssh2.libssh2_scp_send64( + self._session, _path, mode, size, mtime, atime) + if channel is not NULL: + return PyChannel(channel, self) diff --git a/ssh2/sftp.c b/ssh2/sftp.c index 750ee186..b74cd7de 100644 --- a/ssh2/sftp.c +++ b/ssh2/sftp.c @@ -488,11 +488,11 @@ static CYTHON_INLINE float __PYX_NAN() { #define __PYX_HAVE__ssh2__sftp #define __PYX_HAVE_API__ssh2__sftp +#include #include #include #include #include "libssh2.h" -#include #include "libssh2_sftp.h" #include #include @@ -708,7 +708,7 @@ struct __pyx_obj_4ssh2_7session_Session; struct __pyx_obj_4ssh2_7channel_Channel; struct __pyx_obj_4ssh2_10exceptions_AgentError; struct __pyx_obj_4ssh2_10exceptions_AuthenticationError; -struct __pyx_obj_4ssh2_10exceptions_AgentConnectError; +struct __pyx_obj_4ssh2_10exceptions_AgentConnectionError; struct __pyx_obj_4ssh2_10exceptions_AgentAuthenticationError; struct __pyx_obj_4ssh2_10exceptions_AgentListIdentitiesError; struct __pyx_obj_4ssh2_10exceptions_AgentGetIdentityError; @@ -776,11 +776,11 @@ struct __pyx_obj_4ssh2_10exceptions_AuthenticationError { /* "exceptions.pxd":25 * * - * cdef class AgentConnectError(AgentError): # <<<<<<<<<<<<<< + * cdef class AgentConnectionError(AgentError): # <<<<<<<<<<<<<< * pass * */ -struct __pyx_obj_4ssh2_10exceptions_AgentConnectError { +struct __pyx_obj_4ssh2_10exceptions_AgentConnectionError { struct __pyx_obj_4ssh2_10exceptions_AgentError __pyx_base; }; @@ -894,7 +894,7 @@ struct __pyx_obj_4ssh2_4sftp_SFTP { }; -/* "ssh2/sftp.pyx":316 +/* "ssh2/sftp.pyx":319 * * * cdef class SFTPAttributes: # <<<<<<<<<<<<<< @@ -907,7 +907,7 @@ struct __pyx_obj_4ssh2_4sftp_SFTPAttributes { }; -/* "ssh2/sftp.pyx":395 +/* "ssh2/sftp.pyx":398 * * * cdef class SFTPHandle: # <<<<<<<<<<<<<< @@ -1234,6 +1234,8 @@ static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (** static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); +/* Module declarations from 'libc.stdint' */ + /* Module declarations from 'libc.stddef' */ /* Module declarations from 'libc.time' */ @@ -1242,8 +1244,6 @@ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* Module declarations from 'ssh2.c_ssh2' */ -/* Module declarations from 'libc.stdint' */ - /* Module declarations from 'ssh2.c_sftp' */ /* Module declarations from 'ssh2.session' */ @@ -1266,7 +1266,7 @@ static PyObject *(*__pyx_f_4ssh2_5utils_to_str)(char *); /*proto*/ /* Module declarations from 'ssh2.exceptions' */ static PyTypeObject *__pyx_ptype_4ssh2_10exceptions_AgentError = 0; static PyTypeObject *__pyx_ptype_4ssh2_10exceptions_AuthenticationError = 0; -static PyTypeObject *__pyx_ptype_4ssh2_10exceptions_AgentConnectError = 0; +static PyTypeObject *__pyx_ptype_4ssh2_10exceptions_AgentConnectionError = 0; static PyTypeObject *__pyx_ptype_4ssh2_10exceptions_AgentAuthenticationError = 0; static PyTypeObject *__pyx_ptype_4ssh2_10exceptions_AgentListIdentitiesError = 0; static PyTypeObject *__pyx_ptype_4ssh2_10exceptions_AgentGetIdentityError = 0; @@ -1472,7 +1472,7 @@ static PyObject *__pyx_tuple__4; static PyObject *__pyx_tuple__8; static PyObject *__pyx_tuple__9; -/* "ssh2/sftp.pyx":54 +/* "ssh2/sftp.pyx":57 * * * cdef object PySFTPHandle(c_sftp.LIBSSH2_SFTP_HANDLE *handle, SFTP sftp): # <<<<<<<<<<<<<< @@ -1488,25 +1488,25 @@ static PyObject *__pyx_f_4ssh2_4sftp_PySFTPHandle(LIBSSH2_SFTP_HANDLE *__pyx_v_h PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("PySFTPHandle", 0); - /* "ssh2/sftp.pyx":55 + /* "ssh2/sftp.pyx":58 * * cdef object PySFTPHandle(c_sftp.LIBSSH2_SFTP_HANDLE *handle, SFTP sftp): * cdef SFTPHandle _handle = SFTPHandle(sftp) # <<<<<<<<<<<<<< * _handle._handle = handle * return _handle */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 55, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_v_sftp)); __Pyx_GIVEREF(((PyObject *)__pyx_v_sftp)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_sftp)); - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4ssh2_4sftp_SFTPHandle), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 55, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4ssh2_4sftp_SFTPHandle), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v__handle = ((struct __pyx_obj_4ssh2_4sftp_SFTPHandle *)__pyx_t_2); __pyx_t_2 = 0; - /* "ssh2/sftp.pyx":56 + /* "ssh2/sftp.pyx":59 * cdef object PySFTPHandle(c_sftp.LIBSSH2_SFTP_HANDLE *handle, SFTP sftp): * cdef SFTPHandle _handle = SFTPHandle(sftp) * _handle._handle = handle # <<<<<<<<<<<<<< @@ -1515,7 +1515,7 @@ static PyObject *__pyx_f_4ssh2_4sftp_PySFTPHandle(LIBSSH2_SFTP_HANDLE *__pyx_v_h */ __pyx_v__handle->_handle = __pyx_v_handle; - /* "ssh2/sftp.pyx":57 + /* "ssh2/sftp.pyx":60 * cdef SFTPHandle _handle = SFTPHandle(sftp) * _handle._handle = handle * return _handle # <<<<<<<<<<<<<< @@ -1527,7 +1527,7 @@ static PyObject *__pyx_f_4ssh2_4sftp_PySFTPHandle(LIBSSH2_SFTP_HANDLE *__pyx_v_h __pyx_r = ((PyObject *)__pyx_v__handle); goto __pyx_L0; - /* "ssh2/sftp.pyx":54 + /* "ssh2/sftp.pyx":57 * * * cdef object PySFTPHandle(c_sftp.LIBSSH2_SFTP_HANDLE *handle, SFTP sftp): # <<<<<<<<<<<<<< @@ -1548,7 +1548,7 @@ static PyObject *__pyx_f_4ssh2_4sftp_PySFTPHandle(LIBSSH2_SFTP_HANDLE *__pyx_v_h return __pyx_r; } -/* "ssh2/sftp.pyx":60 +/* "ssh2/sftp.pyx":63 * * * cdef object PySFTP(c_sftp.LIBSSH2_SFTP *sftp, Session session): # <<<<<<<<<<<<<< @@ -1564,25 +1564,25 @@ static PyObject *__pyx_f_4ssh2_4sftp_PySFTP(LIBSSH2_SFTP *__pyx_v_sftp, struct _ PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("PySFTP", 0); - /* "ssh2/sftp.pyx":61 + /* "ssh2/sftp.pyx":64 * * cdef object PySFTP(c_sftp.LIBSSH2_SFTP *sftp, Session session): * cdef SFTP _sftp = SFTP(session) # <<<<<<<<<<<<<< * _sftp._sftp = sftp * return _sftp */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 61, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_v_session)); __Pyx_GIVEREF(((PyObject *)__pyx_v_session)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_session)); - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4ssh2_4sftp_SFTP), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 61, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4ssh2_4sftp_SFTP), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v__sftp = ((struct __pyx_obj_4ssh2_4sftp_SFTP *)__pyx_t_2); __pyx_t_2 = 0; - /* "ssh2/sftp.pyx":62 + /* "ssh2/sftp.pyx":65 * cdef object PySFTP(c_sftp.LIBSSH2_SFTP *sftp, Session session): * cdef SFTP _sftp = SFTP(session) * _sftp._sftp = sftp # <<<<<<<<<<<<<< @@ -1591,7 +1591,7 @@ static PyObject *__pyx_f_4ssh2_4sftp_PySFTP(LIBSSH2_SFTP *__pyx_v_sftp, struct _ */ __pyx_v__sftp->_sftp = __pyx_v_sftp; - /* "ssh2/sftp.pyx":63 + /* "ssh2/sftp.pyx":66 * cdef SFTP _sftp = SFTP(session) * _sftp._sftp = sftp * return _sftp # <<<<<<<<<<<<<< @@ -1603,7 +1603,7 @@ static PyObject *__pyx_f_4ssh2_4sftp_PySFTP(LIBSSH2_SFTP *__pyx_v_sftp, struct _ __pyx_r = ((PyObject *)__pyx_v__sftp); goto __pyx_L0; - /* "ssh2/sftp.pyx":60 + /* "ssh2/sftp.pyx":63 * * * cdef object PySFTP(c_sftp.LIBSSH2_SFTP *sftp, Session session): # <<<<<<<<<<<<<< @@ -1624,7 +1624,7 @@ static PyObject *__pyx_f_4ssh2_4sftp_PySFTP(LIBSSH2_SFTP *__pyx_v_sftp, struct _ return __pyx_r; } -/* "ssh2/sftp.pyx":68 +/* "ssh2/sftp.pyx":71 * cdef class SFTP: * * def __cinit__(self, session): # <<<<<<<<<<<<<< @@ -1658,7 +1658,7 @@ static int __pyx_pw_4ssh2_4sftp_4SFTP_1__cinit__(PyObject *__pyx_v_self, PyObjec else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 68, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 71, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; @@ -1669,7 +1669,7 @@ static int __pyx_pw_4ssh2_4sftp_4SFTP_1__cinit__(PyObject *__pyx_v_self, PyObjec } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 68, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 71, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.sftp.SFTP.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -1688,7 +1688,7 @@ static int __pyx_pf_4ssh2_4sftp_4SFTP___cinit__(struct __pyx_obj_4ssh2_4sftp_SFT PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "ssh2/sftp.pyx":69 + /* "ssh2/sftp.pyx":72 * * def __cinit__(self, session): * self._sftp = NULL # <<<<<<<<<<<<<< @@ -1697,14 +1697,14 @@ static int __pyx_pf_4ssh2_4sftp_4SFTP___cinit__(struct __pyx_obj_4ssh2_4sftp_SFT */ __pyx_v_self->_sftp = NULL; - /* "ssh2/sftp.pyx":70 + /* "ssh2/sftp.pyx":73 * def __cinit__(self, session): * self._sftp = NULL * self._session = session # <<<<<<<<<<<<<< * * def __dealloc__(self): */ - if (!(likely(((__pyx_v_session) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_session, __pyx_ptype_4ssh2_7session_Session))))) __PYX_ERR(0, 70, __pyx_L1_error) + if (!(likely(((__pyx_v_session) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_session, __pyx_ptype_4ssh2_7session_Session))))) __PYX_ERR(0, 73, __pyx_L1_error) __pyx_t_1 = __pyx_v_session; __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); @@ -1713,7 +1713,7 @@ static int __pyx_pf_4ssh2_4sftp_4SFTP___cinit__(struct __pyx_obj_4ssh2_4sftp_SFT __pyx_v_self->_session = ((struct __pyx_obj_4ssh2_7session_Session *)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/sftp.pyx":68 + /* "ssh2/sftp.pyx":71 * cdef class SFTP: * * def __cinit__(self, session): # <<<<<<<<<<<<<< @@ -1733,7 +1733,7 @@ static int __pyx_pf_4ssh2_4sftp_4SFTP___cinit__(struct __pyx_obj_4ssh2_4sftp_SFT return __pyx_r; } -/* "ssh2/sftp.pyx":72 +/* "ssh2/sftp.pyx":75 * self._session = session * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -1756,7 +1756,7 @@ static void __pyx_pf_4ssh2_4sftp_4SFTP_2__dealloc__(struct __pyx_obj_4ssh2_4sftp __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "ssh2/sftp.pyx":73 + /* "ssh2/sftp.pyx":76 * * def __dealloc__(self): * with nogil: # <<<<<<<<<<<<<< @@ -1771,7 +1771,7 @@ static void __pyx_pf_4ssh2_4sftp_4SFTP_2__dealloc__(struct __pyx_obj_4ssh2_4sftp #endif /*try:*/ { - /* "ssh2/sftp.pyx":74 + /* "ssh2/sftp.pyx":77 * def __dealloc__(self): * with nogil: * c_sftp.libssh2_sftp_shutdown(self._sftp) # <<<<<<<<<<<<<< @@ -1781,7 +1781,7 @@ static void __pyx_pf_4ssh2_4sftp_4SFTP_2__dealloc__(struct __pyx_obj_4ssh2_4sftp libssh2_sftp_shutdown(__pyx_v_self->_sftp); } - /* "ssh2/sftp.pyx":73 + /* "ssh2/sftp.pyx":76 * * def __dealloc__(self): * with nogil: # <<<<<<<<<<<<<< @@ -1800,7 +1800,7 @@ static void __pyx_pf_4ssh2_4sftp_4SFTP_2__dealloc__(struct __pyx_obj_4ssh2_4sftp } } - /* "ssh2/sftp.pyx":72 + /* "ssh2/sftp.pyx":75 * self._session = session * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -1812,7 +1812,7 @@ static void __pyx_pf_4ssh2_4sftp_4SFTP_2__dealloc__(struct __pyx_obj_4ssh2_4sftp __Pyx_RefNannyFinishContext(); } -/* "ssh2/sftp.pyx":76 +/* "ssh2/sftp.pyx":79 * c_sftp.libssh2_sftp_shutdown(self._sftp) * * def get_channel(self): # <<<<<<<<<<<<<< @@ -1843,7 +1843,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_4get_channel(struct __pyx_obj_4ssh2_ PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("get_channel", 0); - /* "ssh2/sftp.pyx":78 + /* "ssh2/sftp.pyx":81 * def get_channel(self): * cdef c_ssh2.LIBSSH2_CHANNEL *_channel * with nogil: # <<<<<<<<<<<<<< @@ -1858,7 +1858,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_4get_channel(struct __pyx_obj_4ssh2_ #endif /*try:*/ { - /* "ssh2/sftp.pyx":79 + /* "ssh2/sftp.pyx":82 * cdef c_ssh2.LIBSSH2_CHANNEL *_channel * with nogil: * _channel = c_sftp.libssh2_sftp_get_channel(self._sftp) # <<<<<<<<<<<<<< @@ -1868,7 +1868,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_4get_channel(struct __pyx_obj_4ssh2_ __pyx_v__channel = libssh2_sftp_get_channel(__pyx_v_self->_sftp); } - /* "ssh2/sftp.pyx":78 + /* "ssh2/sftp.pyx":81 * def get_channel(self): * cdef c_ssh2.LIBSSH2_CHANNEL *_channel * with nogil: # <<<<<<<<<<<<<< @@ -1887,7 +1887,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_4get_channel(struct __pyx_obj_4ssh2_ } } - /* "ssh2/sftp.pyx":80 + /* "ssh2/sftp.pyx":83 * with nogil: * _channel = c_sftp.libssh2_sftp_get_channel(self._sftp) * if _channel is NULL: # <<<<<<<<<<<<<< @@ -1897,7 +1897,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_4get_channel(struct __pyx_obj_4ssh2_ __pyx_t_1 = ((__pyx_v__channel == NULL) != 0); if (__pyx_t_1) { - /* "ssh2/sftp.pyx":81 + /* "ssh2/sftp.pyx":84 * _channel = c_sftp.libssh2_sftp_get_channel(self._sftp) * if _channel is NULL: * return # <<<<<<<<<<<<<< @@ -1908,7 +1908,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_4get_channel(struct __pyx_obj_4ssh2_ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "ssh2/sftp.pyx":80 + /* "ssh2/sftp.pyx":83 * with nogil: * _channel = c_sftp.libssh2_sftp_get_channel(self._sftp) * if _channel is NULL: # <<<<<<<<<<<<<< @@ -1917,7 +1917,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_4get_channel(struct __pyx_obj_4ssh2_ */ } - /* "ssh2/sftp.pyx":82 + /* "ssh2/sftp.pyx":85 * if _channel is NULL: * return * return PyChannel(_channel, self._session) # <<<<<<<<<<<<<< @@ -1927,14 +1927,14 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_4get_channel(struct __pyx_obj_4ssh2_ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = ((PyObject *)__pyx_v_self->_session); __Pyx_INCREF(__pyx_t_2); - __pyx_t_3 = __pyx_f_4ssh2_7channel_PyChannel(__pyx_v__channel, ((struct __pyx_obj_4ssh2_7session_Session *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 82, __pyx_L1_error) + __pyx_t_3 = __pyx_f_4ssh2_7channel_PyChannel(__pyx_v__channel, ((struct __pyx_obj_4ssh2_7session_Session *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 85, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - /* "ssh2/sftp.pyx":76 + /* "ssh2/sftp.pyx":79 * c_sftp.libssh2_sftp_shutdown(self._sftp) * * def get_channel(self): # <<<<<<<<<<<<<< @@ -1954,7 +1954,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_4get_channel(struct __pyx_obj_4ssh2_ return __pyx_r; } -/* "ssh2/sftp.pyx":84 +/* "ssh2/sftp.pyx":87 * return PyChannel(_channel, self._session) * * def open_ex(self, const char *filename, # <<<<<<<<<<<<<< @@ -2003,29 +2003,29 @@ static PyObject *__pyx_pw_4ssh2_4sftp_4SFTP_7open_ex(PyObject *__pyx_v_self, PyO case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_filename_len)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("open_ex", 1, 5, 5, 1); __PYX_ERR(0, 84, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("open_ex", 1, 5, 5, 1); __PYX_ERR(0, 87, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("open_ex", 1, 5, 5, 2); __PYX_ERR(0, 84, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("open_ex", 1, 5, 5, 2); __PYX_ERR(0, 87, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mode)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("open_ex", 1, 5, 5, 3); __PYX_ERR(0, 84, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("open_ex", 1, 5, 5, 3); __PYX_ERR(0, 87, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open_type)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("open_ex", 1, 5, 5, 4); __PYX_ERR(0, 84, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("open_ex", 1, 5, 5, 4); __PYX_ERR(0, 87, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "open_ex") < 0)) __PYX_ERR(0, 84, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "open_ex") < 0)) __PYX_ERR(0, 87, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 5) { goto __pyx_L5_argtuple_error; @@ -2036,15 +2036,15 @@ static PyObject *__pyx_pw_4ssh2_4sftp_4SFTP_7open_ex(PyObject *__pyx_v_self, PyO values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[4] = PyTuple_GET_ITEM(__pyx_args, 4); } - __pyx_v_filename = __Pyx_PyObject_AsString(values[0]); if (unlikely((!__pyx_v_filename) && PyErr_Occurred())) __PYX_ERR(0, 84, __pyx_L3_error) - __pyx_v_filename_len = __Pyx_PyInt_As_unsigned_int(values[1]); if (unlikely((__pyx_v_filename_len == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 85, __pyx_L3_error) - __pyx_v_flags = __Pyx_PyInt_As_unsigned_long(values[2]); if (unlikely((__pyx_v_flags == (unsigned long)-1) && PyErr_Occurred())) __PYX_ERR(0, 86, __pyx_L3_error) - __pyx_v_mode = __Pyx_PyInt_As_long(values[3]); if (unlikely((__pyx_v_mode == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 87, __pyx_L3_error) - __pyx_v_open_type = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_open_type == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 87, __pyx_L3_error) + __pyx_v_filename = __Pyx_PyObject_AsString(values[0]); if (unlikely((!__pyx_v_filename) && PyErr_Occurred())) __PYX_ERR(0, 87, __pyx_L3_error) + __pyx_v_filename_len = __Pyx_PyInt_As_unsigned_int(values[1]); if (unlikely((__pyx_v_filename_len == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 88, __pyx_L3_error) + __pyx_v_flags = __Pyx_PyInt_As_unsigned_long(values[2]); if (unlikely((__pyx_v_flags == (unsigned long)-1) && PyErr_Occurred())) __PYX_ERR(0, 89, __pyx_L3_error) + __pyx_v_mode = __Pyx_PyInt_As_long(values[3]); if (unlikely((__pyx_v_mode == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 90, __pyx_L3_error) + __pyx_v_open_type = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_open_type == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 90, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("open_ex", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 84, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("open_ex", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 87, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.sftp.SFTP.open_ex", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -2066,7 +2066,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_6open_ex(struct __pyx_obj_4ssh2_4sft PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("open_ex", 0); - /* "ssh2/sftp.pyx":90 + /* "ssh2/sftp.pyx":93 * cdef c_sftp.LIBSSH2_SFTP_HANDLE *_handle * cdef SFTPHandle handle * with nogil: # <<<<<<<<<<<<<< @@ -2081,7 +2081,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_6open_ex(struct __pyx_obj_4ssh2_4sft #endif /*try:*/ { - /* "ssh2/sftp.pyx":91 + /* "ssh2/sftp.pyx":94 * cdef SFTPHandle handle * with nogil: * _handle = c_sftp.libssh2_sftp_open_ex( # <<<<<<<<<<<<<< @@ -2091,7 +2091,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_6open_ex(struct __pyx_obj_4ssh2_4sft __pyx_v__handle = libssh2_sftp_open_ex(__pyx_v_self->_sftp, __pyx_v_filename, __pyx_v_filename_len, __pyx_v_flags, __pyx_v_mode, __pyx_v_open_type); } - /* "ssh2/sftp.pyx":90 + /* "ssh2/sftp.pyx":93 * cdef c_sftp.LIBSSH2_SFTP_HANDLE *_handle * cdef SFTPHandle handle * with nogil: # <<<<<<<<<<<<<< @@ -2110,7 +2110,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_6open_ex(struct __pyx_obj_4ssh2_4sft } } - /* "ssh2/sftp.pyx":94 + /* "ssh2/sftp.pyx":97 * self._sftp, filename, filename_len, flags, * mode, open_type) * if _handle is NULL: # <<<<<<<<<<<<<< @@ -2120,7 +2120,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_6open_ex(struct __pyx_obj_4ssh2_4sft __pyx_t_1 = ((__pyx_v__handle == NULL) != 0); if (__pyx_t_1) { - /* "ssh2/sftp.pyx":95 + /* "ssh2/sftp.pyx":98 * mode, open_type) * if _handle is NULL: * return # <<<<<<<<<<<<<< @@ -2131,7 +2131,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_6open_ex(struct __pyx_obj_4ssh2_4sft __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "ssh2/sftp.pyx":94 + /* "ssh2/sftp.pyx":97 * self._sftp, filename, filename_len, flags, * mode, open_type) * if _handle is NULL: # <<<<<<<<<<<<<< @@ -2140,20 +2140,20 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_6open_ex(struct __pyx_obj_4ssh2_4sft */ } - /* "ssh2/sftp.pyx":96 + /* "ssh2/sftp.pyx":99 * if _handle is NULL: * return * handle = PySFTPHandle(_handle, self) # <<<<<<<<<<<<<< * return handle * */ - __pyx_t_2 = __pyx_f_4ssh2_4sftp_PySFTPHandle(__pyx_v__handle, __pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 96, __pyx_L1_error) + __pyx_t_2 = __pyx_f_4ssh2_4sftp_PySFTPHandle(__pyx_v__handle, __pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_4ssh2_4sftp_SFTPHandle))))) __PYX_ERR(0, 96, __pyx_L1_error) + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_4ssh2_4sftp_SFTPHandle))))) __PYX_ERR(0, 99, __pyx_L1_error) __pyx_v_handle = ((struct __pyx_obj_4ssh2_4sftp_SFTPHandle *)__pyx_t_2); __pyx_t_2 = 0; - /* "ssh2/sftp.pyx":97 + /* "ssh2/sftp.pyx":100 * return * handle = PySFTPHandle(_handle, self) * return handle # <<<<<<<<<<<<<< @@ -2165,7 +2165,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_6open_ex(struct __pyx_obj_4ssh2_4sft __pyx_r = ((PyObject *)__pyx_v_handle); goto __pyx_L0; - /* "ssh2/sftp.pyx":84 + /* "ssh2/sftp.pyx":87 * return PyChannel(_channel, self._session) * * def open_ex(self, const char *filename, # <<<<<<<<<<<<<< @@ -2185,7 +2185,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_6open_ex(struct __pyx_obj_4ssh2_4sft return __pyx_r; } -/* "ssh2/sftp.pyx":99 +/* "ssh2/sftp.pyx":102 * return handle * * def open(self, filename not None, # <<<<<<<<<<<<<< @@ -2228,17 +2228,17 @@ static PyObject *__pyx_pw_4ssh2_4sftp_4SFTP_9open(PyObject *__pyx_v_self, PyObje case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("open", 1, 3, 3, 1); __PYX_ERR(0, 99, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("open", 1, 3, 3, 1); __PYX_ERR(0, 102, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mode)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("open", 1, 3, 3, 2); __PYX_ERR(0, 99, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("open", 1, 3, 3, 2); __PYX_ERR(0, 102, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "open") < 0)) __PYX_ERR(0, 99, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "open") < 0)) __PYX_ERR(0, 102, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -2248,19 +2248,19 @@ static PyObject *__pyx_pw_4ssh2_4sftp_4SFTP_9open(PyObject *__pyx_v_self, PyObje values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_filename = values[0]; - __pyx_v_flags = __Pyx_PyInt_As_unsigned_long(values[1]); if (unlikely((__pyx_v_flags == (unsigned long)-1) && PyErr_Occurred())) __PYX_ERR(0, 100, __pyx_L3_error) - __pyx_v_mode = __Pyx_PyInt_As_long(values[2]); if (unlikely((__pyx_v_mode == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 101, __pyx_L3_error) + __pyx_v_flags = __Pyx_PyInt_As_unsigned_long(values[1]); if (unlikely((__pyx_v_flags == (unsigned long)-1) && PyErr_Occurred())) __PYX_ERR(0, 103, __pyx_L3_error) + __pyx_v_mode = __Pyx_PyInt_As_long(values[2]); if (unlikely((__pyx_v_mode == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 104, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("open", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 99, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("open", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 102, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.sftp.SFTP.open", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(((PyObject *)__pyx_v_filename) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "filename"); __PYX_ERR(0, 99, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "filename"); __PYX_ERR(0, 102, __pyx_L1_error) } __pyx_r = __pyx_pf_4ssh2_4sftp_4SFTP_8open(((struct __pyx_obj_4ssh2_4sftp_SFTP *)__pyx_v_self), __pyx_v_filename, __pyx_v_flags, __pyx_v_mode); @@ -2283,7 +2283,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_8open(struct __pyx_obj_4ssh2_4sftp_S PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("open", 0); - /* "ssh2/sftp.pyx":118 + /* "ssh2/sftp.pyx":121 * cdef c_sftp.LIBSSH2_SFTP_HANDLE *_handle * cdef SFTPHandle handle * cdef char *_filename = to_bytes(filename) # <<<<<<<<<<<<<< @@ -2292,7 +2292,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_8open(struct __pyx_obj_4ssh2_4sftp_S */ __pyx_v__filename = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_filename); - /* "ssh2/sftp.pyx":119 + /* "ssh2/sftp.pyx":122 * cdef SFTPHandle handle * cdef char *_filename = to_bytes(filename) * with nogil: # <<<<<<<<<<<<<< @@ -2307,7 +2307,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_8open(struct __pyx_obj_4ssh2_4sftp_S #endif /*try:*/ { - /* "ssh2/sftp.pyx":120 + /* "ssh2/sftp.pyx":123 * cdef char *_filename = to_bytes(filename) * with nogil: * _handle = c_sftp.libssh2_sftp_open( # <<<<<<<<<<<<<< @@ -2317,7 +2317,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_8open(struct __pyx_obj_4ssh2_4sftp_S __pyx_v__handle = libssh2_sftp_open(__pyx_v_self->_sftp, __pyx_v__filename, __pyx_v_flags, __pyx_v_mode); } - /* "ssh2/sftp.pyx":119 + /* "ssh2/sftp.pyx":122 * cdef SFTPHandle handle * cdef char *_filename = to_bytes(filename) * with nogil: # <<<<<<<<<<<<<< @@ -2336,7 +2336,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_8open(struct __pyx_obj_4ssh2_4sftp_S } } - /* "ssh2/sftp.pyx":122 + /* "ssh2/sftp.pyx":125 * _handle = c_sftp.libssh2_sftp_open( * self._sftp, _filename, flags, mode) * if _handle is NULL: # <<<<<<<<<<<<<< @@ -2346,7 +2346,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_8open(struct __pyx_obj_4ssh2_4sftp_S __pyx_t_1 = ((__pyx_v__handle == NULL) != 0); if (__pyx_t_1) { - /* "ssh2/sftp.pyx":123 + /* "ssh2/sftp.pyx":126 * self._sftp, _filename, flags, mode) * if _handle is NULL: * return # <<<<<<<<<<<<<< @@ -2357,7 +2357,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_8open(struct __pyx_obj_4ssh2_4sftp_S __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "ssh2/sftp.pyx":122 + /* "ssh2/sftp.pyx":125 * _handle = c_sftp.libssh2_sftp_open( * self._sftp, _filename, flags, mode) * if _handle is NULL: # <<<<<<<<<<<<<< @@ -2366,20 +2366,20 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_8open(struct __pyx_obj_4ssh2_4sftp_S */ } - /* "ssh2/sftp.pyx":124 + /* "ssh2/sftp.pyx":127 * if _handle is NULL: * return * handle = PySFTPHandle(_handle, self) # <<<<<<<<<<<<<< * return handle * */ - __pyx_t_2 = __pyx_f_4ssh2_4sftp_PySFTPHandle(__pyx_v__handle, __pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 124, __pyx_L1_error) + __pyx_t_2 = __pyx_f_4ssh2_4sftp_PySFTPHandle(__pyx_v__handle, __pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_4ssh2_4sftp_SFTPHandle))))) __PYX_ERR(0, 124, __pyx_L1_error) + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_4ssh2_4sftp_SFTPHandle))))) __PYX_ERR(0, 127, __pyx_L1_error) __pyx_v_handle = ((struct __pyx_obj_4ssh2_4sftp_SFTPHandle *)__pyx_t_2); __pyx_t_2 = 0; - /* "ssh2/sftp.pyx":125 + /* "ssh2/sftp.pyx":128 * return * handle = PySFTPHandle(_handle, self) * return handle # <<<<<<<<<<<<<< @@ -2391,7 +2391,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_8open(struct __pyx_obj_4ssh2_4sftp_S __pyx_r = ((PyObject *)__pyx_v_handle); goto __pyx_L0; - /* "ssh2/sftp.pyx":99 + /* "ssh2/sftp.pyx":102 * return handle * * def open(self, filename not None, # <<<<<<<<<<<<<< @@ -2411,7 +2411,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_8open(struct __pyx_obj_4ssh2_4sftp_S return __pyx_r; } -/* "ssh2/sftp.pyx":127 +/* "ssh2/sftp.pyx":130 * return handle * * def opendir(self, path not None): # <<<<<<<<<<<<<< @@ -2427,7 +2427,7 @@ static PyObject *__pyx_pw_4ssh2_4sftp_4SFTP_11opendir(PyObject *__pyx_v_self, Py __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("opendir (wrapper)", 0); if (unlikely(((PyObject *)__pyx_v_path) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "path"); __PYX_ERR(0, 127, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "path"); __PYX_ERR(0, 130, __pyx_L1_error) } __pyx_r = __pyx_pf_4ssh2_4sftp_4SFTP_10opendir(((struct __pyx_obj_4ssh2_4sftp_SFTP *)__pyx_v_self), ((PyObject *)__pyx_v_path)); @@ -2449,7 +2449,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_10opendir(struct __pyx_obj_4ssh2_4sf PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("opendir", 0); - /* "ssh2/sftp.pyx":135 + /* "ssh2/sftp.pyx":138 * :rtype: :py:class:`ssh2.sftp.SFTPHandle` or `None`""" * cdef c_sftp.LIBSSH2_SFTP_HANDLE *_handle * cdef char *_path = to_bytes(path) # <<<<<<<<<<<<<< @@ -2458,7 +2458,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_10opendir(struct __pyx_obj_4ssh2_4sf */ __pyx_v__path = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_path); - /* "ssh2/sftp.pyx":136 + /* "ssh2/sftp.pyx":139 * cdef c_sftp.LIBSSH2_SFTP_HANDLE *_handle * cdef char *_path = to_bytes(path) * with nogil: # <<<<<<<<<<<<<< @@ -2473,7 +2473,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_10opendir(struct __pyx_obj_4ssh2_4sf #endif /*try:*/ { - /* "ssh2/sftp.pyx":137 + /* "ssh2/sftp.pyx":140 * cdef char *_path = to_bytes(path) * with nogil: * _handle = c_sftp.libssh2_sftp_opendir(self._sftp, _path) # <<<<<<<<<<<<<< @@ -2483,7 +2483,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_10opendir(struct __pyx_obj_4ssh2_4sf __pyx_v__handle = libssh2_sftp_opendir(__pyx_v_self->_sftp, __pyx_v__path); } - /* "ssh2/sftp.pyx":136 + /* "ssh2/sftp.pyx":139 * cdef c_sftp.LIBSSH2_SFTP_HANDLE *_handle * cdef char *_path = to_bytes(path) * with nogil: # <<<<<<<<<<<<<< @@ -2502,7 +2502,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_10opendir(struct __pyx_obj_4ssh2_4sf } } - /* "ssh2/sftp.pyx":138 + /* "ssh2/sftp.pyx":141 * with nogil: * _handle = c_sftp.libssh2_sftp_opendir(self._sftp, _path) * if _handle is NULL: # <<<<<<<<<<<<<< @@ -2512,7 +2512,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_10opendir(struct __pyx_obj_4ssh2_4sf __pyx_t_1 = ((__pyx_v__handle == NULL) != 0); if (__pyx_t_1) { - /* "ssh2/sftp.pyx":139 + /* "ssh2/sftp.pyx":142 * _handle = c_sftp.libssh2_sftp_opendir(self._sftp, _path) * if _handle is NULL: * return # <<<<<<<<<<<<<< @@ -2523,7 +2523,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_10opendir(struct __pyx_obj_4ssh2_4sf __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "ssh2/sftp.pyx":138 + /* "ssh2/sftp.pyx":141 * with nogil: * _handle = c_sftp.libssh2_sftp_opendir(self._sftp, _path) * if _handle is NULL: # <<<<<<<<<<<<<< @@ -2532,7 +2532,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_10opendir(struct __pyx_obj_4ssh2_4sf */ } - /* "ssh2/sftp.pyx":140 + /* "ssh2/sftp.pyx":143 * if _handle is NULL: * return * return PySFTPHandle(_handle, self) # <<<<<<<<<<<<<< @@ -2540,13 +2540,13 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_10opendir(struct __pyx_obj_4ssh2_4sf * def rename_ex(self, const char *source_filename, */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __pyx_f_4ssh2_4sftp_PySFTPHandle(__pyx_v__handle, __pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 140, __pyx_L1_error) + __pyx_t_2 = __pyx_f_4ssh2_4sftp_PySFTPHandle(__pyx_v__handle, __pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "ssh2/sftp.pyx":127 + /* "ssh2/sftp.pyx":130 * return handle * * def opendir(self, path not None): # <<<<<<<<<<<<<< @@ -2565,7 +2565,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_10opendir(struct __pyx_obj_4ssh2_4sf return __pyx_r; } -/* "ssh2/sftp.pyx":142 +/* "ssh2/sftp.pyx":145 * return PySFTPHandle(_handle, self) * * def rename_ex(self, const char *source_filename, # <<<<<<<<<<<<<< @@ -2614,29 +2614,29 @@ static PyObject *__pyx_pw_4ssh2_4sftp_4SFTP_13rename_ex(PyObject *__pyx_v_self, case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_source_filename_len)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("rename_ex", 1, 5, 5, 1); __PYX_ERR(0, 142, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("rename_ex", 1, 5, 5, 1); __PYX_ERR(0, 145, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dest_filename)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("rename_ex", 1, 5, 5, 2); __PYX_ERR(0, 142, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("rename_ex", 1, 5, 5, 2); __PYX_ERR(0, 145, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dest_filename_len)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("rename_ex", 1, 5, 5, 3); __PYX_ERR(0, 142, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("rename_ex", 1, 5, 5, 3); __PYX_ERR(0, 145, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("rename_ex", 1, 5, 5, 4); __PYX_ERR(0, 142, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("rename_ex", 1, 5, 5, 4); __PYX_ERR(0, 145, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "rename_ex") < 0)) __PYX_ERR(0, 142, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "rename_ex") < 0)) __PYX_ERR(0, 145, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 5) { goto __pyx_L5_argtuple_error; @@ -2647,15 +2647,15 @@ static PyObject *__pyx_pw_4ssh2_4sftp_4SFTP_13rename_ex(PyObject *__pyx_v_self, values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[4] = PyTuple_GET_ITEM(__pyx_args, 4); } - __pyx_v_source_filename = __Pyx_PyObject_AsString(values[0]); if (unlikely((!__pyx_v_source_filename) && PyErr_Occurred())) __PYX_ERR(0, 142, __pyx_L3_error) - __pyx_v_source_filename_len = __Pyx_PyInt_As_unsigned_int(values[1]); if (unlikely((__pyx_v_source_filename_len == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 143, __pyx_L3_error) - __pyx_v_dest_filename = __Pyx_PyObject_AsString(values[2]); if (unlikely((!__pyx_v_dest_filename) && PyErr_Occurred())) __PYX_ERR(0, 144, __pyx_L3_error) - __pyx_v_dest_filename_len = __Pyx_PyInt_As_unsigned_int(values[3]); if (unlikely((__pyx_v_dest_filename_len == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 145, __pyx_L3_error) - __pyx_v_flags = __Pyx_PyInt_As_long(values[4]); if (unlikely((__pyx_v_flags == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 146, __pyx_L3_error) + __pyx_v_source_filename = __Pyx_PyObject_AsString(values[0]); if (unlikely((!__pyx_v_source_filename) && PyErr_Occurred())) __PYX_ERR(0, 145, __pyx_L3_error) + __pyx_v_source_filename_len = __Pyx_PyInt_As_unsigned_int(values[1]); if (unlikely((__pyx_v_source_filename_len == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 146, __pyx_L3_error) + __pyx_v_dest_filename = __Pyx_PyObject_AsString(values[2]); if (unlikely((!__pyx_v_dest_filename) && PyErr_Occurred())) __PYX_ERR(0, 147, __pyx_L3_error) + __pyx_v_dest_filename_len = __Pyx_PyInt_As_unsigned_int(values[3]); if (unlikely((__pyx_v_dest_filename_len == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 148, __pyx_L3_error) + __pyx_v_flags = __Pyx_PyInt_As_long(values[4]); if (unlikely((__pyx_v_flags == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 149, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("rename_ex", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 142, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("rename_ex", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 145, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.sftp.SFTP.rename_ex", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -2675,7 +2675,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_12rename_ex(struct __pyx_obj_4ssh2_4 PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("rename_ex", 0); - /* "ssh2/sftp.pyx":148 + /* "ssh2/sftp.pyx":151 * long flags): * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -2690,7 +2690,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_12rename_ex(struct __pyx_obj_4ssh2_4 #endif /*try:*/ { - /* "ssh2/sftp.pyx":149 + /* "ssh2/sftp.pyx":152 * cdef int rc * with nogil: * rc = c_sftp.libssh2_sftp_rename_ex( # <<<<<<<<<<<<<< @@ -2700,7 +2700,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_12rename_ex(struct __pyx_obj_4ssh2_4 __pyx_v_rc = libssh2_sftp_rename_ex(__pyx_v_self->_sftp, __pyx_v_source_filename, __pyx_v_source_filename_len, __pyx_v_dest_filename, __pyx_v_dest_filename_len, __pyx_v_flags); } - /* "ssh2/sftp.pyx":148 + /* "ssh2/sftp.pyx":151 * long flags): * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -2719,7 +2719,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_12rename_ex(struct __pyx_obj_4ssh2_4 } } - /* "ssh2/sftp.pyx":152 + /* "ssh2/sftp.pyx":155 * self._sftp, source_filename, source_filename_len, * dest_filename, dest_filename_len, flags) * return rc # <<<<<<<<<<<<<< @@ -2727,13 +2727,13 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_12rename_ex(struct __pyx_obj_4ssh2_4 * def rename(self, source_filename not None, dest_filename not None): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 152, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 155, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/sftp.pyx":142 + /* "ssh2/sftp.pyx":145 * return PySFTPHandle(_handle, self) * * def rename_ex(self, const char *source_filename, # <<<<<<<<<<<<<< @@ -2752,7 +2752,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_12rename_ex(struct __pyx_obj_4ssh2_4 return __pyx_r; } -/* "ssh2/sftp.pyx":154 +/* "ssh2/sftp.pyx":157 * return rc * * def rename(self, source_filename not None, dest_filename not None): # <<<<<<<<<<<<<< @@ -2792,11 +2792,11 @@ static PyObject *__pyx_pw_4ssh2_4sftp_4SFTP_15rename(PyObject *__pyx_v_self, PyO case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dest_filename)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("rename", 1, 2, 2, 1); __PYX_ERR(0, 154, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("rename", 1, 2, 2, 1); __PYX_ERR(0, 157, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "rename") < 0)) __PYX_ERR(0, 154, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "rename") < 0)) __PYX_ERR(0, 157, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -2809,17 +2809,17 @@ static PyObject *__pyx_pw_4ssh2_4sftp_4SFTP_15rename(PyObject *__pyx_v_self, PyO } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("rename", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 154, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("rename", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 157, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.sftp.SFTP.rename", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(((PyObject *)__pyx_v_source_filename) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "source_filename"); __PYX_ERR(0, 154, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "source_filename"); __PYX_ERR(0, 157, __pyx_L1_error) } if (unlikely(((PyObject *)__pyx_v_dest_filename) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "dest_filename"); __PYX_ERR(0, 154, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "dest_filename"); __PYX_ERR(0, 157, __pyx_L1_error) } __pyx_r = __pyx_pf_4ssh2_4sftp_4SFTP_14rename(((struct __pyx_obj_4ssh2_4sftp_SFTP *)__pyx_v_self), __pyx_v_source_filename, __pyx_v_dest_filename); @@ -2841,7 +2841,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_14rename(struct __pyx_obj_4ssh2_4sft PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("rename", 0); - /* "ssh2/sftp.pyx":162 + /* "ssh2/sftp.pyx":165 * :type dest_filename: str""" * cdef int rc * cdef char *_source_filename = to_bytes(source_filename) # <<<<<<<<<<<<<< @@ -2850,7 +2850,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_14rename(struct __pyx_obj_4ssh2_4sft */ __pyx_v__source_filename = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_source_filename); - /* "ssh2/sftp.pyx":163 + /* "ssh2/sftp.pyx":166 * cdef int rc * cdef char *_source_filename = to_bytes(source_filename) * cdef char *_dest_filename = to_bytes(dest_filename) # <<<<<<<<<<<<<< @@ -2859,7 +2859,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_14rename(struct __pyx_obj_4ssh2_4sft */ __pyx_v__dest_filename = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_dest_filename); - /* "ssh2/sftp.pyx":164 + /* "ssh2/sftp.pyx":167 * cdef char *_source_filename = to_bytes(source_filename) * cdef char *_dest_filename = to_bytes(dest_filename) * with nogil: # <<<<<<<<<<<<<< @@ -2874,7 +2874,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_14rename(struct __pyx_obj_4ssh2_4sft #endif /*try:*/ { - /* "ssh2/sftp.pyx":165 + /* "ssh2/sftp.pyx":168 * cdef char *_dest_filename = to_bytes(dest_filename) * with nogil: * rc = c_sftp.libssh2_sftp_rename( # <<<<<<<<<<<<<< @@ -2884,7 +2884,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_14rename(struct __pyx_obj_4ssh2_4sft __pyx_v_rc = libssh2_sftp_rename(__pyx_v_self->_sftp, __pyx_v__source_filename, __pyx_v__dest_filename); } - /* "ssh2/sftp.pyx":164 + /* "ssh2/sftp.pyx":167 * cdef char *_source_filename = to_bytes(source_filename) * cdef char *_dest_filename = to_bytes(dest_filename) * with nogil: # <<<<<<<<<<<<<< @@ -2903,7 +2903,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_14rename(struct __pyx_obj_4ssh2_4sft } } - /* "ssh2/sftp.pyx":167 + /* "ssh2/sftp.pyx":170 * rc = c_sftp.libssh2_sftp_rename( * self._sftp, _source_filename, _dest_filename) * return rc # <<<<<<<<<<<<<< @@ -2911,13 +2911,13 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_14rename(struct __pyx_obj_4ssh2_4sft * def unlink(self, filename not None): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 167, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/sftp.pyx":154 + /* "ssh2/sftp.pyx":157 * return rc * * def rename(self, source_filename not None, dest_filename not None): # <<<<<<<<<<<<<< @@ -2936,7 +2936,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_14rename(struct __pyx_obj_4ssh2_4sft return __pyx_r; } -/* "ssh2/sftp.pyx":169 +/* "ssh2/sftp.pyx":172 * return rc * * def unlink(self, filename not None): # <<<<<<<<<<<<<< @@ -2952,7 +2952,7 @@ static PyObject *__pyx_pw_4ssh2_4sftp_4SFTP_17unlink(PyObject *__pyx_v_self, PyO __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("unlink (wrapper)", 0); if (unlikely(((PyObject *)__pyx_v_filename) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "filename"); __PYX_ERR(0, 169, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "filename"); __PYX_ERR(0, 172, __pyx_L1_error) } __pyx_r = __pyx_pf_4ssh2_4sftp_4SFTP_16unlink(((struct __pyx_obj_4ssh2_4sftp_SFTP *)__pyx_v_self), ((PyObject *)__pyx_v_filename)); @@ -2973,7 +2973,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_16unlink(struct __pyx_obj_4ssh2_4sft PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("unlink", 0); - /* "ssh2/sftp.pyx":175 + /* "ssh2/sftp.pyx":178 * :type filename: str""" * cdef int rc * cdef char *_filename = to_bytes(filename) # <<<<<<<<<<<<<< @@ -2982,7 +2982,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_16unlink(struct __pyx_obj_4ssh2_4sft */ __pyx_v__filename = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_filename); - /* "ssh2/sftp.pyx":176 + /* "ssh2/sftp.pyx":179 * cdef int rc * cdef char *_filename = to_bytes(filename) * with nogil: # <<<<<<<<<<<<<< @@ -2997,7 +2997,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_16unlink(struct __pyx_obj_4ssh2_4sft #endif /*try:*/ { - /* "ssh2/sftp.pyx":177 + /* "ssh2/sftp.pyx":180 * cdef char *_filename = to_bytes(filename) * with nogil: * rc = c_sftp.libssh2_sftp_unlink(self._sftp, _filename) # <<<<<<<<<<<<<< @@ -3007,7 +3007,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_16unlink(struct __pyx_obj_4ssh2_4sft __pyx_v_rc = libssh2_sftp_unlink(__pyx_v_self->_sftp, __pyx_v__filename); } - /* "ssh2/sftp.pyx":176 + /* "ssh2/sftp.pyx":179 * cdef int rc * cdef char *_filename = to_bytes(filename) * with nogil: # <<<<<<<<<<<<<< @@ -3026,7 +3026,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_16unlink(struct __pyx_obj_4ssh2_4sft } } - /* "ssh2/sftp.pyx":178 + /* "ssh2/sftp.pyx":181 * with nogil: * rc = c_sftp.libssh2_sftp_unlink(self._sftp, _filename) * return rc # <<<<<<<<<<<<<< @@ -3034,13 +3034,13 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_16unlink(struct __pyx_obj_4ssh2_4sft * def fstatvfs(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 178, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/sftp.pyx":169 + /* "ssh2/sftp.pyx":172 * return rc * * def unlink(self, filename not None): # <<<<<<<<<<<<<< @@ -3059,7 +3059,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_16unlink(struct __pyx_obj_4ssh2_4sft return __pyx_r; } -/* "ssh2/sftp.pyx":180 +/* "ssh2/sftp.pyx":183 * return rc * * def fstatvfs(self): # <<<<<<<<<<<<<< @@ -3086,7 +3086,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_18fstatvfs(CYTHON_UNUSED struct __py __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("fstatvfs", 0); - /* "ssh2/sftp.pyx":181 + /* "ssh2/sftp.pyx":184 * * def fstatvfs(self): * raise NotImplementedError # <<<<<<<<<<<<<< @@ -3094,9 +3094,9 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_18fstatvfs(CYTHON_UNUSED struct __py * def statvfs(self): */ __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); - __PYX_ERR(0, 181, __pyx_L1_error) + __PYX_ERR(0, 184, __pyx_L1_error) - /* "ssh2/sftp.pyx":180 + /* "ssh2/sftp.pyx":183 * return rc * * def fstatvfs(self): # <<<<<<<<<<<<<< @@ -3113,7 +3113,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_18fstatvfs(CYTHON_UNUSED struct __py return __pyx_r; } -/* "ssh2/sftp.pyx":183 +/* "ssh2/sftp.pyx":186 * raise NotImplementedError * * def statvfs(self): # <<<<<<<<<<<<<< @@ -3140,7 +3140,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_20statvfs(CYTHON_UNUSED struct __pyx __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("statvfs", 0); - /* "ssh2/sftp.pyx":184 + /* "ssh2/sftp.pyx":187 * * def statvfs(self): * raise NotImplementedError # <<<<<<<<<<<<<< @@ -3148,9 +3148,9 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_20statvfs(CYTHON_UNUSED struct __pyx * def mkdir(self, path not None, long mode): */ __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); - __PYX_ERR(0, 184, __pyx_L1_error) + __PYX_ERR(0, 187, __pyx_L1_error) - /* "ssh2/sftp.pyx":183 + /* "ssh2/sftp.pyx":186 * raise NotImplementedError * * def statvfs(self): # <<<<<<<<<<<<<< @@ -3167,7 +3167,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_20statvfs(CYTHON_UNUSED struct __pyx return __pyx_r; } -/* "ssh2/sftp.pyx":186 +/* "ssh2/sftp.pyx":189 * raise NotImplementedError * * def mkdir(self, path not None, long mode): # <<<<<<<<<<<<<< @@ -3207,11 +3207,11 @@ static PyObject *__pyx_pw_4ssh2_4sftp_4SFTP_23mkdir(PyObject *__pyx_v_self, PyOb case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mode)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("mkdir", 1, 2, 2, 1); __PYX_ERR(0, 186, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("mkdir", 1, 2, 2, 1); __PYX_ERR(0, 189, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "mkdir") < 0)) __PYX_ERR(0, 186, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "mkdir") < 0)) __PYX_ERR(0, 189, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -3220,18 +3220,18 @@ static PyObject *__pyx_pw_4ssh2_4sftp_4SFTP_23mkdir(PyObject *__pyx_v_self, PyOb values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_path = values[0]; - __pyx_v_mode = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v_mode == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 186, __pyx_L3_error) + __pyx_v_mode = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v_mode == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 189, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("mkdir", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 186, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("mkdir", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 189, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.sftp.SFTP.mkdir", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(((PyObject *)__pyx_v_path) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "path"); __PYX_ERR(0, 186, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "path"); __PYX_ERR(0, 189, __pyx_L1_error) } __pyx_r = __pyx_pf_4ssh2_4sftp_4SFTP_22mkdir(((struct __pyx_obj_4ssh2_4sftp_SFTP *)__pyx_v_self), __pyx_v_path, __pyx_v_mode); @@ -3253,17 +3253,17 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_22mkdir(struct __pyx_obj_4ssh2_4sftp PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("mkdir", 0); - /* "ssh2/sftp.pyx":196 + /* "ssh2/sftp.pyx":199 * :rtype: int""" * cdef int rc * cdef char *_path = path # <<<<<<<<<<<<<< * with nogil: * rc = c_sftp.libssh2_sftp_mkdir(self._sftp, _path, mode) */ - __pyx_t_1 = __Pyx_PyObject_AsWritableString(__pyx_v_path); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(0, 196, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_AsWritableString(__pyx_v_path); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(0, 199, __pyx_L1_error) __pyx_v__path = __pyx_t_1; - /* "ssh2/sftp.pyx":197 + /* "ssh2/sftp.pyx":200 * cdef int rc * cdef char *_path = path * with nogil: # <<<<<<<<<<<<<< @@ -3278,7 +3278,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_22mkdir(struct __pyx_obj_4ssh2_4sftp #endif /*try:*/ { - /* "ssh2/sftp.pyx":198 + /* "ssh2/sftp.pyx":201 * cdef char *_path = path * with nogil: * rc = c_sftp.libssh2_sftp_mkdir(self._sftp, _path, mode) # <<<<<<<<<<<<<< @@ -3288,7 +3288,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_22mkdir(struct __pyx_obj_4ssh2_4sftp __pyx_v_rc = libssh2_sftp_mkdir(__pyx_v_self->_sftp, __pyx_v__path, __pyx_v_mode); } - /* "ssh2/sftp.pyx":197 + /* "ssh2/sftp.pyx":200 * cdef int rc * cdef char *_path = path * with nogil: # <<<<<<<<<<<<<< @@ -3307,7 +3307,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_22mkdir(struct __pyx_obj_4ssh2_4sftp } } - /* "ssh2/sftp.pyx":199 + /* "ssh2/sftp.pyx":202 * with nogil: * rc = c_sftp.libssh2_sftp_mkdir(self._sftp, _path, mode) * return rc # <<<<<<<<<<<<<< @@ -3315,13 +3315,13 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_22mkdir(struct __pyx_obj_4ssh2_4sftp * def rmdir(self, path not None): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 199, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "ssh2/sftp.pyx":186 + /* "ssh2/sftp.pyx":189 * raise NotImplementedError * * def mkdir(self, path not None, long mode): # <<<<<<<<<<<<<< @@ -3340,7 +3340,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_22mkdir(struct __pyx_obj_4ssh2_4sftp return __pyx_r; } -/* "ssh2/sftp.pyx":201 +/* "ssh2/sftp.pyx":204 * return rc * * def rmdir(self, path not None): # <<<<<<<<<<<<<< @@ -3356,7 +3356,7 @@ static PyObject *__pyx_pw_4ssh2_4sftp_4SFTP_25rmdir(PyObject *__pyx_v_self, PyOb __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("rmdir (wrapper)", 0); if (unlikely(((PyObject *)__pyx_v_path) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "path"); __PYX_ERR(0, 201, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "path"); __PYX_ERR(0, 204, __pyx_L1_error) } __pyx_r = __pyx_pf_4ssh2_4sftp_4SFTP_24rmdir(((struct __pyx_obj_4ssh2_4sftp_SFTP *)__pyx_v_self), ((PyObject *)__pyx_v_path)); @@ -3377,7 +3377,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_24rmdir(struct __pyx_obj_4ssh2_4sftp PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("rmdir", 0); - /* "ssh2/sftp.pyx":209 + /* "ssh2/sftp.pyx":212 * :rtype: int""" * cdef int rc * cdef char *_path = to_bytes(path) # <<<<<<<<<<<<<< @@ -3386,7 +3386,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_24rmdir(struct __pyx_obj_4ssh2_4sftp */ __pyx_v__path = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_path); - /* "ssh2/sftp.pyx":210 + /* "ssh2/sftp.pyx":213 * cdef int rc * cdef char *_path = to_bytes(path) * with nogil: # <<<<<<<<<<<<<< @@ -3401,7 +3401,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_24rmdir(struct __pyx_obj_4ssh2_4sftp #endif /*try:*/ { - /* "ssh2/sftp.pyx":211 + /* "ssh2/sftp.pyx":214 * cdef char *_path = to_bytes(path) * with nogil: * rc = c_sftp.libssh2_sftp_rmdir(self._sftp, _path) # <<<<<<<<<<<<<< @@ -3411,7 +3411,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_24rmdir(struct __pyx_obj_4ssh2_4sftp __pyx_v_rc = libssh2_sftp_rmdir(__pyx_v_self->_sftp, __pyx_v__path); } - /* "ssh2/sftp.pyx":210 + /* "ssh2/sftp.pyx":213 * cdef int rc * cdef char *_path = to_bytes(path) * with nogil: # <<<<<<<<<<<<<< @@ -3430,7 +3430,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_24rmdir(struct __pyx_obj_4ssh2_4sftp } } - /* "ssh2/sftp.pyx":212 + /* "ssh2/sftp.pyx":215 * with nogil: * rc = c_sftp.libssh2_sftp_rmdir(self._sftp, _path) * return rc # <<<<<<<<<<<<<< @@ -3438,13 +3438,13 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_24rmdir(struct __pyx_obj_4ssh2_4sftp * def stat(self, path not None): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 212, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 215, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/sftp.pyx":201 + /* "ssh2/sftp.pyx":204 * return rc * * def rmdir(self, path not None): # <<<<<<<<<<<<<< @@ -3463,7 +3463,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_24rmdir(struct __pyx_obj_4ssh2_4sftp return __pyx_r; } -/* "ssh2/sftp.pyx":214 +/* "ssh2/sftp.pyx":217 * return rc * * def stat(self, path not None): # <<<<<<<<<<<<<< @@ -3479,7 +3479,7 @@ static PyObject *__pyx_pw_4ssh2_4sftp_4SFTP_27stat(PyObject *__pyx_v_self, PyObj __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("stat (wrapper)", 0); if (unlikely(((PyObject *)__pyx_v_path) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "path"); __PYX_ERR(0, 214, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "path"); __PYX_ERR(0, 217, __pyx_L1_error) } __pyx_r = __pyx_pf_4ssh2_4sftp_4SFTP_26stat(((struct __pyx_obj_4ssh2_4sftp_SFTP *)__pyx_v_self), ((PyObject *)__pyx_v_path)); @@ -3504,7 +3504,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_26stat(struct __pyx_obj_4ssh2_4sftp_ PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("stat", 0); - /* "ssh2/sftp.pyx":222 + /* "ssh2/sftp.pyx":225 * :rtype: :py:class:`ssh2.sftp.SFTPAttributes` or LIBSSH2_ERROR_EAGAIN""" * cdef int rc * cdef char *_path = to_bytes(path) # <<<<<<<<<<<<<< @@ -3513,19 +3513,19 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_26stat(struct __pyx_obj_4ssh2_4sftp_ */ __pyx_v__path = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_path); - /* "ssh2/sftp.pyx":223 + /* "ssh2/sftp.pyx":226 * cdef int rc * cdef char *_path = to_bytes(path) * cdef SFTPAttributes attrs = SFTPAttributes() # <<<<<<<<<<<<<< * with nogil: * rc = c_sftp.libssh2_sftp_stat( */ - __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4ssh2_4sftp_SFTPAttributes), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 223, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4ssh2_4sftp_SFTPAttributes), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_attrs = ((struct __pyx_obj_4ssh2_4sftp_SFTPAttributes *)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/sftp.pyx":224 + /* "ssh2/sftp.pyx":227 * cdef char *_path = to_bytes(path) * cdef SFTPAttributes attrs = SFTPAttributes() * with nogil: # <<<<<<<<<<<<<< @@ -3540,7 +3540,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_26stat(struct __pyx_obj_4ssh2_4sftp_ #endif /*try:*/ { - /* "ssh2/sftp.pyx":225 + /* "ssh2/sftp.pyx":228 * cdef SFTPAttributes attrs = SFTPAttributes() * with nogil: * rc = c_sftp.libssh2_sftp_stat( # <<<<<<<<<<<<<< @@ -3549,7 +3549,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_26stat(struct __pyx_obj_4ssh2_4sftp_ */ __pyx_v_rc = libssh2_sftp_stat(__pyx_v_self->_sftp, __pyx_v__path, __pyx_v_attrs->_attrs); - /* "ssh2/sftp.pyx":227 + /* "ssh2/sftp.pyx":230 * rc = c_sftp.libssh2_sftp_stat( * self._sftp, _path, attrs._attrs) * if rc != c_ssh2._LIBSSH2_ERROR_EAGAIN and rc != 0: # <<<<<<<<<<<<<< @@ -3567,7 +3567,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_26stat(struct __pyx_obj_4ssh2_4sftp_ __pyx_L7_bool_binop_done:; if (__pyx_t_2) { - /* "ssh2/sftp.pyx":228 + /* "ssh2/sftp.pyx":231 * self._sftp, _path, attrs._attrs) * if rc != c_ssh2._LIBSSH2_ERROR_EAGAIN and rc != 0: * with gil: # <<<<<<<<<<<<<< @@ -3580,24 +3580,24 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_26stat(struct __pyx_obj_4ssh2_4sftp_ #endif /*try:*/ { - /* "ssh2/sftp.pyx":231 + /* "ssh2/sftp.pyx":234 * raise SFTPHandleError( * "Error with stat on file %s - code %s", * path, rc) # <<<<<<<<<<<<<< * if rc == c_ssh2._LIBSSH2_ERROR_EAGAIN: * return rc */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L10_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_1); - /* "ssh2/sftp.pyx":229 + /* "ssh2/sftp.pyx":232 * if rc != c_ssh2._LIBSSH2_ERROR_EAGAIN and rc != 0: * with gil: * raise SFTPHandleError( # <<<<<<<<<<<<<< * "Error with stat on file %s - code %s", * path, rc) */ - __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 229, __pyx_L10_error) + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 232, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_kp_s_Error_with_stat_on_file_s_code_s); __Pyx_GIVEREF(__pyx_kp_s_Error_with_stat_on_file_s_code_s); @@ -3608,15 +3608,15 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_26stat(struct __pyx_obj_4ssh2_4sftp_ __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4ssh2_10exceptions_SFTPHandleError), __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __pyx_L10_error) + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4ssh2_10exceptions_SFTPHandleError), __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 232, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 229, __pyx_L10_error) + __PYX_ERR(0, 232, __pyx_L10_error) } - /* "ssh2/sftp.pyx":228 + /* "ssh2/sftp.pyx":231 * self._sftp, _path, attrs._attrs) * if rc != c_ssh2._LIBSSH2_ERROR_EAGAIN and rc != 0: * with gil: # <<<<<<<<<<<<<< @@ -3633,7 +3633,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_26stat(struct __pyx_obj_4ssh2_4sftp_ } } - /* "ssh2/sftp.pyx":227 + /* "ssh2/sftp.pyx":230 * rc = c_sftp.libssh2_sftp_stat( * self._sftp, _path, attrs._attrs) * if rc != c_ssh2._LIBSSH2_ERROR_EAGAIN and rc != 0: # <<<<<<<<<<<<<< @@ -3643,7 +3643,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_26stat(struct __pyx_obj_4ssh2_4sftp_ } } - /* "ssh2/sftp.pyx":224 + /* "ssh2/sftp.pyx":227 * cdef char *_path = to_bytes(path) * cdef SFTPAttributes attrs = SFTPAttributes() * with nogil: # <<<<<<<<<<<<<< @@ -3669,7 +3669,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_26stat(struct __pyx_obj_4ssh2_4sftp_ } } - /* "ssh2/sftp.pyx":232 + /* "ssh2/sftp.pyx":235 * "Error with stat on file %s - code %s", * path, rc) * if rc == c_ssh2._LIBSSH2_ERROR_EAGAIN: # <<<<<<<<<<<<<< @@ -3679,7 +3679,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_26stat(struct __pyx_obj_4ssh2_4sftp_ __pyx_t_2 = ((__pyx_v_rc == LIBSSH2_ERROR_EAGAIN) != 0); if (__pyx_t_2) { - /* "ssh2/sftp.pyx":233 + /* "ssh2/sftp.pyx":236 * path, rc) * if rc == c_ssh2._LIBSSH2_ERROR_EAGAIN: * return rc # <<<<<<<<<<<<<< @@ -3687,13 +3687,13 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_26stat(struct __pyx_obj_4ssh2_4sftp_ * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 233, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/sftp.pyx":232 + /* "ssh2/sftp.pyx":235 * "Error with stat on file %s - code %s", * path, rc) * if rc == c_ssh2._LIBSSH2_ERROR_EAGAIN: # <<<<<<<<<<<<<< @@ -3702,7 +3702,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_26stat(struct __pyx_obj_4ssh2_4sftp_ */ } - /* "ssh2/sftp.pyx":234 + /* "ssh2/sftp.pyx":237 * if rc == c_ssh2._LIBSSH2_ERROR_EAGAIN: * return rc * return attrs # <<<<<<<<<<<<<< @@ -3714,7 +3714,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_26stat(struct __pyx_obj_4ssh2_4sftp_ __pyx_r = ((PyObject *)__pyx_v_attrs); goto __pyx_L0; - /* "ssh2/sftp.pyx":214 + /* "ssh2/sftp.pyx":217 * return rc * * def stat(self, path not None): # <<<<<<<<<<<<<< @@ -3735,7 +3735,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_26stat(struct __pyx_obj_4ssh2_4sftp_ return __pyx_r; } -/* "ssh2/sftp.pyx":236 +/* "ssh2/sftp.pyx":239 * return attrs * * def lstat(self, path not None): # <<<<<<<<<<<<<< @@ -3751,7 +3751,7 @@ static PyObject *__pyx_pw_4ssh2_4sftp_4SFTP_29lstat(PyObject *__pyx_v_self, PyOb __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("lstat (wrapper)", 0); if (unlikely(((PyObject *)__pyx_v_path) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "path"); __PYX_ERR(0, 236, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "path"); __PYX_ERR(0, 239, __pyx_L1_error) } __pyx_r = __pyx_pf_4ssh2_4sftp_4SFTP_28lstat(((struct __pyx_obj_4ssh2_4sftp_SFTP *)__pyx_v_self), ((PyObject *)__pyx_v_path)); @@ -3776,7 +3776,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_28lstat(struct __pyx_obj_4ssh2_4sftp PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("lstat", 0); - /* "ssh2/sftp.pyx":238 + /* "ssh2/sftp.pyx":241 * def lstat(self, path not None): * cdef int rc * cdef char *_path = to_bytes(path) # <<<<<<<<<<<<<< @@ -3785,19 +3785,19 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_28lstat(struct __pyx_obj_4ssh2_4sftp */ __pyx_v__path = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_path); - /* "ssh2/sftp.pyx":239 + /* "ssh2/sftp.pyx":242 * cdef int rc * cdef char *_path = to_bytes(path) * cdef SFTPAttributes attrs = SFTPAttributes() # <<<<<<<<<<<<<< * with nogil: * rc = c_sftp.libssh2_sftp_lstat( */ - __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4ssh2_4sftp_SFTPAttributes), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 239, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4ssh2_4sftp_SFTPAttributes), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_attrs = ((struct __pyx_obj_4ssh2_4sftp_SFTPAttributes *)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/sftp.pyx":240 + /* "ssh2/sftp.pyx":243 * cdef char *_path = to_bytes(path) * cdef SFTPAttributes attrs = SFTPAttributes() * with nogil: # <<<<<<<<<<<<<< @@ -3812,7 +3812,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_28lstat(struct __pyx_obj_4ssh2_4sftp #endif /*try:*/ { - /* "ssh2/sftp.pyx":241 + /* "ssh2/sftp.pyx":244 * cdef SFTPAttributes attrs = SFTPAttributes() * with nogil: * rc = c_sftp.libssh2_sftp_lstat( # <<<<<<<<<<<<<< @@ -3821,7 +3821,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_28lstat(struct __pyx_obj_4ssh2_4sftp */ __pyx_v_rc = libssh2_sftp_lstat(__pyx_v_self->_sftp, __pyx_v__path, __pyx_v_attrs->_attrs); - /* "ssh2/sftp.pyx":243 + /* "ssh2/sftp.pyx":246 * rc = c_sftp.libssh2_sftp_lstat( * self._sftp, _path, attrs._attrs) * if rc != 0 and rc != c_ssh2._LIBSSH2_ERROR_EAGAIN: # <<<<<<<<<<<<<< @@ -3839,7 +3839,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_28lstat(struct __pyx_obj_4ssh2_4sftp __pyx_L7_bool_binop_done:; if (__pyx_t_2) { - /* "ssh2/sftp.pyx":244 + /* "ssh2/sftp.pyx":247 * self._sftp, _path, attrs._attrs) * if rc != 0 and rc != c_ssh2._LIBSSH2_ERROR_EAGAIN: * with gil: # <<<<<<<<<<<<<< @@ -3852,24 +3852,24 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_28lstat(struct __pyx_obj_4ssh2_4sftp #endif /*try:*/ { - /* "ssh2/sftp.pyx":247 + /* "ssh2/sftp.pyx":250 * raise SFTPHandleError( * "Error with stat on file %s - code %s", * path, rc) # <<<<<<<<<<<<<< * if rc == c_ssh2._LIBSSH2_ERROR_EAGAIN: * return rc */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 247, __pyx_L10_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 250, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_1); - /* "ssh2/sftp.pyx":245 + /* "ssh2/sftp.pyx":248 * if rc != 0 and rc != c_ssh2._LIBSSH2_ERROR_EAGAIN: * with gil: * raise SFTPHandleError( # <<<<<<<<<<<<<< * "Error with stat on file %s - code %s", * path, rc) */ - __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 245, __pyx_L10_error) + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 248, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_kp_s_Error_with_stat_on_file_s_code_s); __Pyx_GIVEREF(__pyx_kp_s_Error_with_stat_on_file_s_code_s); @@ -3880,15 +3880,15 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_28lstat(struct __pyx_obj_4ssh2_4sftp __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4ssh2_10exceptions_SFTPHandleError), __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 245, __pyx_L10_error) + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4ssh2_10exceptions_SFTPHandleError), __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 248, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 245, __pyx_L10_error) + __PYX_ERR(0, 248, __pyx_L10_error) } - /* "ssh2/sftp.pyx":244 + /* "ssh2/sftp.pyx":247 * self._sftp, _path, attrs._attrs) * if rc != 0 and rc != c_ssh2._LIBSSH2_ERROR_EAGAIN: * with gil: # <<<<<<<<<<<<<< @@ -3905,7 +3905,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_28lstat(struct __pyx_obj_4ssh2_4sftp } } - /* "ssh2/sftp.pyx":243 + /* "ssh2/sftp.pyx":246 * rc = c_sftp.libssh2_sftp_lstat( * self._sftp, _path, attrs._attrs) * if rc != 0 and rc != c_ssh2._LIBSSH2_ERROR_EAGAIN: # <<<<<<<<<<<<<< @@ -3915,7 +3915,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_28lstat(struct __pyx_obj_4ssh2_4sftp } } - /* "ssh2/sftp.pyx":240 + /* "ssh2/sftp.pyx":243 * cdef char *_path = to_bytes(path) * cdef SFTPAttributes attrs = SFTPAttributes() * with nogil: # <<<<<<<<<<<<<< @@ -3941,7 +3941,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_28lstat(struct __pyx_obj_4ssh2_4sftp } } - /* "ssh2/sftp.pyx":248 + /* "ssh2/sftp.pyx":251 * "Error with stat on file %s - code %s", * path, rc) * if rc == c_ssh2._LIBSSH2_ERROR_EAGAIN: # <<<<<<<<<<<<<< @@ -3951,7 +3951,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_28lstat(struct __pyx_obj_4ssh2_4sftp __pyx_t_2 = ((__pyx_v_rc == LIBSSH2_ERROR_EAGAIN) != 0); if (__pyx_t_2) { - /* "ssh2/sftp.pyx":249 + /* "ssh2/sftp.pyx":252 * path, rc) * if rc == c_ssh2._LIBSSH2_ERROR_EAGAIN: * return rc # <<<<<<<<<<<<<< @@ -3959,13 +3959,13 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_28lstat(struct __pyx_obj_4ssh2_4sftp * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 249, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/sftp.pyx":248 + /* "ssh2/sftp.pyx":251 * "Error with stat on file %s - code %s", * path, rc) * if rc == c_ssh2._LIBSSH2_ERROR_EAGAIN: # <<<<<<<<<<<<<< @@ -3974,7 +3974,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_28lstat(struct __pyx_obj_4ssh2_4sftp */ } - /* "ssh2/sftp.pyx":250 + /* "ssh2/sftp.pyx":253 * if rc == c_ssh2._LIBSSH2_ERROR_EAGAIN: * return rc * return attrs # <<<<<<<<<<<<<< @@ -3986,7 +3986,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_28lstat(struct __pyx_obj_4ssh2_4sftp __pyx_r = ((PyObject *)__pyx_v_attrs); goto __pyx_L0; - /* "ssh2/sftp.pyx":236 + /* "ssh2/sftp.pyx":239 * return attrs * * def lstat(self, path not None): # <<<<<<<<<<<<<< @@ -4007,7 +4007,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_28lstat(struct __pyx_obj_4ssh2_4sftp return __pyx_r; } -/* "ssh2/sftp.pyx":252 +/* "ssh2/sftp.pyx":255 * return attrs * * def setstat(self, path not None, SFTPAttributes attrs): # <<<<<<<<<<<<<< @@ -4047,11 +4047,11 @@ static PyObject *__pyx_pw_4ssh2_4sftp_4SFTP_31setstat(PyObject *__pyx_v_self, Py case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_attrs)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("setstat", 1, 2, 2, 1); __PYX_ERR(0, 252, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("setstat", 1, 2, 2, 1); __PYX_ERR(0, 255, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setstat") < 0)) __PYX_ERR(0, 252, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setstat") < 0)) __PYX_ERR(0, 255, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -4064,16 +4064,16 @@ static PyObject *__pyx_pw_4ssh2_4sftp_4SFTP_31setstat(PyObject *__pyx_v_self, Py } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("setstat", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 252, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("setstat", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 255, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.sftp.SFTP.setstat", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(((PyObject *)__pyx_v_path) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "path"); __PYX_ERR(0, 252, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "path"); __PYX_ERR(0, 255, __pyx_L1_error) } - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_attrs), __pyx_ptype_4ssh2_4sftp_SFTPAttributes, 1, "attrs", 0))) __PYX_ERR(0, 252, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_attrs), __pyx_ptype_4ssh2_4sftp_SFTPAttributes, 1, "attrs", 0))) __PYX_ERR(0, 255, __pyx_L1_error) __pyx_r = __pyx_pf_4ssh2_4sftp_4SFTP_30setstat(((struct __pyx_obj_4ssh2_4sftp_SFTP *)__pyx_v_self), __pyx_v_path, __pyx_v_attrs); /* function exit code */ @@ -4093,7 +4093,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_30setstat(struct __pyx_obj_4ssh2_4sf PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("setstat", 0); - /* "ssh2/sftp.pyx":254 + /* "ssh2/sftp.pyx":257 * def setstat(self, path not None, SFTPAttributes attrs): * cdef int rc * cdef char *_path = to_bytes(path) # <<<<<<<<<<<<<< @@ -4102,7 +4102,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_30setstat(struct __pyx_obj_4ssh2_4sf */ __pyx_v__path = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_path); - /* "ssh2/sftp.pyx":255 + /* "ssh2/sftp.pyx":258 * cdef int rc * cdef char *_path = to_bytes(path) * with nogil: # <<<<<<<<<<<<<< @@ -4117,7 +4117,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_30setstat(struct __pyx_obj_4ssh2_4sf #endif /*try:*/ { - /* "ssh2/sftp.pyx":256 + /* "ssh2/sftp.pyx":259 * cdef char *_path = to_bytes(path) * with nogil: * rc = c_sftp.libssh2_sftp_setstat( # <<<<<<<<<<<<<< @@ -4127,7 +4127,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_30setstat(struct __pyx_obj_4ssh2_4sf __pyx_v_rc = libssh2_sftp_setstat(__pyx_v_self->_sftp, __pyx_v__path, __pyx_v_attrs->_attrs); } - /* "ssh2/sftp.pyx":255 + /* "ssh2/sftp.pyx":258 * cdef int rc * cdef char *_path = to_bytes(path) * with nogil: # <<<<<<<<<<<<<< @@ -4146,7 +4146,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_30setstat(struct __pyx_obj_4ssh2_4sf } } - /* "ssh2/sftp.pyx":258 + /* "ssh2/sftp.pyx":261 * rc = c_sftp.libssh2_sftp_setstat( * self._sftp, _path, attrs._attrs) * return rc # <<<<<<<<<<<<<< @@ -4154,13 +4154,13 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_30setstat(struct __pyx_obj_4ssh2_4sf * def symlink(self, path not None, target not None): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 258, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/sftp.pyx":252 + /* "ssh2/sftp.pyx":255 * return attrs * * def setstat(self, path not None, SFTPAttributes attrs): # <<<<<<<<<<<<<< @@ -4179,7 +4179,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_30setstat(struct __pyx_obj_4ssh2_4sf return __pyx_r; } -/* "ssh2/sftp.pyx":260 +/* "ssh2/sftp.pyx":263 * return rc * * def symlink(self, path not None, target not None): # <<<<<<<<<<<<<< @@ -4219,11 +4219,11 @@ static PyObject *__pyx_pw_4ssh2_4sftp_4SFTP_33symlink(PyObject *__pyx_v_self, Py case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_target)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("symlink", 1, 2, 2, 1); __PYX_ERR(0, 260, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("symlink", 1, 2, 2, 1); __PYX_ERR(0, 263, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "symlink") < 0)) __PYX_ERR(0, 260, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "symlink") < 0)) __PYX_ERR(0, 263, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -4236,17 +4236,17 @@ static PyObject *__pyx_pw_4ssh2_4sftp_4SFTP_33symlink(PyObject *__pyx_v_self, Py } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("symlink", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 260, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("symlink", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 263, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.sftp.SFTP.symlink", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(((PyObject *)__pyx_v_path) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "path"); __PYX_ERR(0, 260, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "path"); __PYX_ERR(0, 263, __pyx_L1_error) } if (unlikely(((PyObject *)__pyx_v_target) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "target"); __PYX_ERR(0, 260, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "target"); __PYX_ERR(0, 263, __pyx_L1_error) } __pyx_r = __pyx_pf_4ssh2_4sftp_4SFTP_32symlink(((struct __pyx_obj_4ssh2_4sftp_SFTP *)__pyx_v_self), __pyx_v_path, __pyx_v_target); @@ -4268,7 +4268,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_32symlink(struct __pyx_obj_4ssh2_4sf PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("symlink", 0); - /* "ssh2/sftp.pyx":262 + /* "ssh2/sftp.pyx":265 * def symlink(self, path not None, target not None): * cdef int rc * cdef char *_path = to_bytes(path) # <<<<<<<<<<<<<< @@ -4277,7 +4277,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_32symlink(struct __pyx_obj_4ssh2_4sf */ __pyx_v__path = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_path); - /* "ssh2/sftp.pyx":263 + /* "ssh2/sftp.pyx":266 * cdef int rc * cdef char *_path = to_bytes(path) * cdef char *_target = to_bytes(target) # <<<<<<<<<<<<<< @@ -4286,7 +4286,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_32symlink(struct __pyx_obj_4ssh2_4sf */ __pyx_v__target = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_target); - /* "ssh2/sftp.pyx":264 + /* "ssh2/sftp.pyx":267 * cdef char *_path = to_bytes(path) * cdef char *_target = to_bytes(target) * with nogil: # <<<<<<<<<<<<<< @@ -4301,7 +4301,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_32symlink(struct __pyx_obj_4ssh2_4sf #endif /*try:*/ { - /* "ssh2/sftp.pyx":265 + /* "ssh2/sftp.pyx":268 * cdef char *_target = to_bytes(target) * with nogil: * rc = c_sftp.libssh2_sftp_symlink(self._sftp, _path, _target) # <<<<<<<<<<<<<< @@ -4311,7 +4311,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_32symlink(struct __pyx_obj_4ssh2_4sf __pyx_v_rc = libssh2_sftp_symlink(__pyx_v_self->_sftp, __pyx_v__path, __pyx_v__target); } - /* "ssh2/sftp.pyx":264 + /* "ssh2/sftp.pyx":267 * cdef char *_path = to_bytes(path) * cdef char *_target = to_bytes(target) * with nogil: # <<<<<<<<<<<<<< @@ -4330,7 +4330,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_32symlink(struct __pyx_obj_4ssh2_4sf } } - /* "ssh2/sftp.pyx":266 + /* "ssh2/sftp.pyx":269 * with nogil: * rc = c_sftp.libssh2_sftp_symlink(self._sftp, _path, _target) * return rc # <<<<<<<<<<<<<< @@ -4338,13 +4338,13 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_32symlink(struct __pyx_obj_4ssh2_4sf * def realpath(self, path not None, size_t max_len=256): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 266, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/sftp.pyx":260 + /* "ssh2/sftp.pyx":263 * return rc * * def symlink(self, path not None, target not None): # <<<<<<<<<<<<<< @@ -4363,7 +4363,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_32symlink(struct __pyx_obj_4ssh2_4sf return __pyx_r; } -/* "ssh2/sftp.pyx":268 +/* "ssh2/sftp.pyx":271 * return rc * * def realpath(self, path not None, size_t max_len=256): # <<<<<<<<<<<<<< @@ -4407,7 +4407,7 @@ static PyObject *__pyx_pw_4ssh2_4sftp_4SFTP_35realpath(PyObject *__pyx_v_self, P } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "realpath") < 0)) __PYX_ERR(0, 268, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "realpath") < 0)) __PYX_ERR(0, 271, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -4420,21 +4420,21 @@ static PyObject *__pyx_pw_4ssh2_4sftp_4SFTP_35realpath(PyObject *__pyx_v_self, P } __pyx_v_path = values[0]; if (values[1]) { - __pyx_v_max_len = __Pyx_PyInt_As_size_t(values[1]); if (unlikely((__pyx_v_max_len == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 268, __pyx_L3_error) + __pyx_v_max_len = __Pyx_PyInt_As_size_t(values[1]); if (unlikely((__pyx_v_max_len == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 271, __pyx_L3_error) } else { __pyx_v_max_len = ((size_t)0x100); } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("realpath", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 268, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("realpath", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 271, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.sftp.SFTP.realpath", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(((PyObject *)__pyx_v_path) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "path"); __PYX_ERR(0, 268, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "path"); __PYX_ERR(0, 271, __pyx_L1_error) } __pyx_r = __pyx_pf_4ssh2_4sftp_4SFTP_34realpath(((struct __pyx_obj_4ssh2_4sftp_SFTP *)__pyx_v_self), __pyx_v_path, __pyx_v_max_len); @@ -4471,7 +4471,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_34realpath(struct __pyx_obj_4ssh2_4s PyObject *__pyx_t_15 = NULL; __Pyx_RefNannySetupContext("realpath", 0); - /* "ssh2/sftp.pyx":280 + /* "ssh2/sftp.pyx":283 * :raises: :py:class:`ssh2.exceptions.SFTPBufferTooSmall` on max_len less * than real path length.""" * cdef char *_target = malloc(sizeof(char)*max_len) # <<<<<<<<<<<<<< @@ -4480,7 +4480,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_34realpath(struct __pyx_obj_4ssh2_4s */ __pyx_v__target = ((char *)malloc(((sizeof(char)) * __pyx_v_max_len))); - /* "ssh2/sftp.pyx":281 + /* "ssh2/sftp.pyx":284 * than real path length.""" * cdef char *_target = malloc(sizeof(char)*max_len) * if _target == NULL: # <<<<<<<<<<<<<< @@ -4490,16 +4490,16 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_34realpath(struct __pyx_obj_4ssh2_4s __pyx_t_1 = ((__pyx_v__target == NULL) != 0); if (__pyx_t_1) { - /* "ssh2/sftp.pyx":282 + /* "ssh2/sftp.pyx":285 * cdef char *_target = malloc(sizeof(char)*max_len) * if _target == NULL: * raise MemoryError # <<<<<<<<<<<<<< * cdef int rc * cdef char *_path = to_bytes(path) */ - PyErr_NoMemory(); __PYX_ERR(0, 282, __pyx_L1_error) + PyErr_NoMemory(); __PYX_ERR(0, 285, __pyx_L1_error) - /* "ssh2/sftp.pyx":281 + /* "ssh2/sftp.pyx":284 * than real path length.""" * cdef char *_target = malloc(sizeof(char)*max_len) * if _target == NULL: # <<<<<<<<<<<<<< @@ -4508,7 +4508,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_34realpath(struct __pyx_obj_4ssh2_4s */ } - /* "ssh2/sftp.pyx":284 + /* "ssh2/sftp.pyx":287 * raise MemoryError * cdef int rc * cdef char *_path = to_bytes(path) # <<<<<<<<<<<<<< @@ -4517,7 +4517,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_34realpath(struct __pyx_obj_4ssh2_4s */ __pyx_v__path = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_path); - /* "ssh2/sftp.pyx":286 + /* "ssh2/sftp.pyx":289 * cdef char *_path = to_bytes(path) * cdef bytes realpath * try: # <<<<<<<<<<<<<< @@ -4526,7 +4526,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_34realpath(struct __pyx_obj_4ssh2_4s */ /*try:*/ { - /* "ssh2/sftp.pyx":287 + /* "ssh2/sftp.pyx":290 * cdef bytes realpath * try: * with nogil: # <<<<<<<<<<<<<< @@ -4541,7 +4541,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_34realpath(struct __pyx_obj_4ssh2_4s #endif /*try:*/ { - /* "ssh2/sftp.pyx":288 + /* "ssh2/sftp.pyx":291 * try: * with nogil: * rc = c_sftp.libssh2_sftp_realpath( # <<<<<<<<<<<<<< @@ -4550,7 +4550,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_34realpath(struct __pyx_obj_4ssh2_4s */ __pyx_v_rc = libssh2_sftp_realpath(__pyx_v_self->_sftp, __pyx_v__path, __pyx_v__target, __pyx_v_max_len); - /* "ssh2/sftp.pyx":290 + /* "ssh2/sftp.pyx":293 * rc = c_sftp.libssh2_sftp_realpath( * self._sftp, _path, _target, max_len) * if rc == _LIBSSH2_ERROR_BUFFER_TOO_SMALL: # <<<<<<<<<<<<<< @@ -4560,7 +4560,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_34realpath(struct __pyx_obj_4ssh2_4s __pyx_t_1 = ((__pyx_v_rc == LIBSSH2_ERROR_BUFFER_TOO_SMALL) != 0); if (__pyx_t_1) { - /* "ssh2/sftp.pyx":291 + /* "ssh2/sftp.pyx":294 * self._sftp, _path, _target, max_len) * if rc == _LIBSSH2_ERROR_BUFFER_TOO_SMALL: * with gil: # <<<<<<<<<<<<<< @@ -4573,26 +4573,26 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_34realpath(struct __pyx_obj_4ssh2_4s #endif /*try:*/ { - /* "ssh2/sftp.pyx":295 + /* "ssh2/sftp.pyx":298 * "Buffer too small to fit realpath for %s " * "- max size %s. Error code %s", * path, max_len, rc) # <<<<<<<<<<<<<< * elif rc != c_ssh2._LIBSSH2_ERROR_EAGAIN and rc < 0: * with gil: */ - __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_max_len); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 295, __pyx_L12_error) + __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_max_len); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 298, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 295, __pyx_L12_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 298, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_3); - /* "ssh2/sftp.pyx":292 + /* "ssh2/sftp.pyx":295 * if rc == _LIBSSH2_ERROR_BUFFER_TOO_SMALL: * with gil: * raise SFTPBufferTooSmall( # <<<<<<<<<<<<<< * "Buffer too small to fit realpath for %s " * "- max size %s. Error code %s", */ - __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 292, __pyx_L12_error) + __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 295, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_kp_s_Buffer_too_small_to_fit_realpath); __Pyx_GIVEREF(__pyx_kp_s_Buffer_too_small_to_fit_realpath); @@ -4606,15 +4606,15 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_34realpath(struct __pyx_obj_4ssh2_4s PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_3); __pyx_t_2 = 0; __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4ssh2_10exceptions_SFTPBufferTooSmall), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 292, __pyx_L12_error) + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4ssh2_10exceptions_SFTPBufferTooSmall), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 295, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 292, __pyx_L12_error) + __PYX_ERR(0, 295, __pyx_L12_error) } - /* "ssh2/sftp.pyx":291 + /* "ssh2/sftp.pyx":294 * self._sftp, _path, _target, max_len) * if rc == _LIBSSH2_ERROR_BUFFER_TOO_SMALL: * with gil: # <<<<<<<<<<<<<< @@ -4631,7 +4631,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_34realpath(struct __pyx_obj_4ssh2_4s } } - /* "ssh2/sftp.pyx":290 + /* "ssh2/sftp.pyx":293 * rc = c_sftp.libssh2_sftp_realpath( * self._sftp, _path, _target, max_len) * if rc == _LIBSSH2_ERROR_BUFFER_TOO_SMALL: # <<<<<<<<<<<<<< @@ -4640,7 +4640,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_34realpath(struct __pyx_obj_4ssh2_4s */ } - /* "ssh2/sftp.pyx":296 + /* "ssh2/sftp.pyx":299 * "- max size %s. Error code %s", * path, max_len, rc) * elif rc != c_ssh2._LIBSSH2_ERROR_EAGAIN and rc < 0: # <<<<<<<<<<<<<< @@ -4658,7 +4658,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_34realpath(struct __pyx_obj_4ssh2_4s __pyx_L14_bool_binop_done:; if (__pyx_t_1) { - /* "ssh2/sftp.pyx":297 + /* "ssh2/sftp.pyx":300 * path, max_len, rc) * elif rc != c_ssh2._LIBSSH2_ERROR_EAGAIN and rc < 0: * with gil: # <<<<<<<<<<<<<< @@ -4671,24 +4671,24 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_34realpath(struct __pyx_obj_4ssh2_4s #endif /*try:*/ { - /* "ssh2/sftp.pyx":300 + /* "ssh2/sftp.pyx":303 * raise SFTPHandleError( * "Error getting real path for %s - error code %s", * path, rc) # <<<<<<<<<<<<<< * elif rc == c_ssh2._LIBSSH2_ERROR_EAGAIN: * with gil: */ - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 300, __pyx_L17_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 303, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_3); - /* "ssh2/sftp.pyx":298 + /* "ssh2/sftp.pyx":301 * elif rc != c_ssh2._LIBSSH2_ERROR_EAGAIN and rc < 0: * with gil: * raise SFTPHandleError( # <<<<<<<<<<<<<< * "Error getting real path for %s - error code %s", * path, rc) */ - __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 298, __pyx_L17_error) + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 301, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_kp_s_Error_getting_real_path_for_s_er); __Pyx_GIVEREF(__pyx_kp_s_Error_getting_real_path_for_s_er); @@ -4699,15 +4699,15 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_34realpath(struct __pyx_obj_4ssh2_4s __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4ssh2_10exceptions_SFTPHandleError), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 298, __pyx_L17_error) + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4ssh2_10exceptions_SFTPHandleError), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 301, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 298, __pyx_L17_error) + __PYX_ERR(0, 301, __pyx_L17_error) } - /* "ssh2/sftp.pyx":297 + /* "ssh2/sftp.pyx":300 * path, max_len, rc) * elif rc != c_ssh2._LIBSSH2_ERROR_EAGAIN and rc < 0: * with gil: # <<<<<<<<<<<<<< @@ -4724,7 +4724,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_34realpath(struct __pyx_obj_4ssh2_4s } } - /* "ssh2/sftp.pyx":296 + /* "ssh2/sftp.pyx":299 * "- max size %s. Error code %s", * path, max_len, rc) * elif rc != c_ssh2._LIBSSH2_ERROR_EAGAIN and rc < 0: # <<<<<<<<<<<<<< @@ -4733,7 +4733,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_34realpath(struct __pyx_obj_4ssh2_4s */ } - /* "ssh2/sftp.pyx":301 + /* "ssh2/sftp.pyx":304 * "Error getting real path for %s - error code %s", * path, rc) * elif rc == c_ssh2._LIBSSH2_ERROR_EAGAIN: # <<<<<<<<<<<<<< @@ -4743,7 +4743,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_34realpath(struct __pyx_obj_4ssh2_4s __pyx_t_1 = ((__pyx_v_rc == LIBSSH2_ERROR_EAGAIN) != 0); if (__pyx_t_1) { - /* "ssh2/sftp.pyx":302 + /* "ssh2/sftp.pyx":305 * path, rc) * elif rc == c_ssh2._LIBSSH2_ERROR_EAGAIN: * with gil: # <<<<<<<<<<<<<< @@ -4756,7 +4756,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_34realpath(struct __pyx_obj_4ssh2_4s #endif /*try:*/ { - /* "ssh2/sftp.pyx":303 + /* "ssh2/sftp.pyx":306 * elif rc == c_ssh2._LIBSSH2_ERROR_EAGAIN: * with gil: * return rc # <<<<<<<<<<<<<< @@ -4764,14 +4764,14 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_34realpath(struct __pyx_obj_4ssh2_4s * return to_str(realpath) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 303, __pyx_L20_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 306, __pyx_L20_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L19_return; } - /* "ssh2/sftp.pyx":302 + /* "ssh2/sftp.pyx":305 * path, rc) * elif rc == c_ssh2._LIBSSH2_ERROR_EAGAIN: * with gil: # <<<<<<<<<<<<<< @@ -4794,7 +4794,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_34realpath(struct __pyx_obj_4ssh2_4s } } - /* "ssh2/sftp.pyx":301 + /* "ssh2/sftp.pyx":304 * "Error getting real path for %s - error code %s", * path, rc) * elif rc == c_ssh2._LIBSSH2_ERROR_EAGAIN: # <<<<<<<<<<<<<< @@ -4804,7 +4804,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_34realpath(struct __pyx_obj_4ssh2_4s } } - /* "ssh2/sftp.pyx":287 + /* "ssh2/sftp.pyx":290 * cdef bytes realpath * try: * with nogil: # <<<<<<<<<<<<<< @@ -4837,19 +4837,19 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_34realpath(struct __pyx_obj_4ssh2_4s } } - /* "ssh2/sftp.pyx":304 + /* "ssh2/sftp.pyx":307 * with gil: * return rc * realpath = _target[:rc] # <<<<<<<<<<<<<< * return to_str(realpath) * finally: */ - __pyx_t_3 = __Pyx_PyBytes_FromStringAndSize(__pyx_v__target + 0, __pyx_v_rc - 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 304, __pyx_L5_error) + __pyx_t_3 = __Pyx_PyBytes_FromStringAndSize(__pyx_v__target + 0, __pyx_v_rc - 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 307, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_realpath = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; - /* "ssh2/sftp.pyx":305 + /* "ssh2/sftp.pyx":308 * return rc * realpath = _target[:rc] * return to_str(realpath) # <<<<<<<<<<<<<< @@ -4857,15 +4857,15 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_34realpath(struct __pyx_obj_4ssh2_4s * free(_target) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_6 = __Pyx_PyObject_AsWritableString(__pyx_v_realpath); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 305, __pyx_L5_error) - __pyx_t_3 = __pyx_f_4ssh2_5utils_to_str(__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 305, __pyx_L5_error) + __pyx_t_6 = __Pyx_PyObject_AsWritableString(__pyx_v_realpath); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 308, __pyx_L5_error) + __pyx_t_3 = __pyx_f_4ssh2_5utils_to_str(__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 308, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L4_return; } - /* "ssh2/sftp.pyx":307 + /* "ssh2/sftp.pyx":310 * return to_str(realpath) * finally: * free(_target) # <<<<<<<<<<<<<< @@ -4918,7 +4918,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_34realpath(struct __pyx_obj_4ssh2_4s } } - /* "ssh2/sftp.pyx":268 + /* "ssh2/sftp.pyx":271 * return rc * * def realpath(self, path not None, size_t max_len=256): # <<<<<<<<<<<<<< @@ -4940,7 +4940,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_34realpath(struct __pyx_obj_4ssh2_4s return __pyx_r; } -/* "ssh2/sftp.pyx":309 +/* "ssh2/sftp.pyx":312 * free(_target) * * def last_error(self): # <<<<<<<<<<<<<< @@ -4969,7 +4969,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_36last_error(struct __pyx_obj_4ssh2_ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("last_error", 0); - /* "ssh2/sftp.pyx":311 + /* "ssh2/sftp.pyx":314 * def last_error(self): * cdef unsigned long rc * with nogil: # <<<<<<<<<<<<<< @@ -4984,7 +4984,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_36last_error(struct __pyx_obj_4ssh2_ #endif /*try:*/ { - /* "ssh2/sftp.pyx":312 + /* "ssh2/sftp.pyx":315 * cdef unsigned long rc * with nogil: * rc = c_sftp.libssh2_sftp_last_error(self._sftp) # <<<<<<<<<<<<<< @@ -4994,7 +4994,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_36last_error(struct __pyx_obj_4ssh2_ __pyx_v_rc = libssh2_sftp_last_error(__pyx_v_self->_sftp); } - /* "ssh2/sftp.pyx":311 + /* "ssh2/sftp.pyx":314 * def last_error(self): * cdef unsigned long rc * with nogil: # <<<<<<<<<<<<<< @@ -5013,7 +5013,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_36last_error(struct __pyx_obj_4ssh2_ } } - /* "ssh2/sftp.pyx":313 + /* "ssh2/sftp.pyx":316 * with nogil: * rc = c_sftp.libssh2_sftp_last_error(self._sftp) * return rc # <<<<<<<<<<<<<< @@ -5021,13 +5021,13 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_36last_error(struct __pyx_obj_4ssh2_ * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_unsigned_long(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 313, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_unsigned_long(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 316, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/sftp.pyx":309 + /* "ssh2/sftp.pyx":312 * free(_target) * * def last_error(self): # <<<<<<<<<<<<<< @@ -5155,7 +5155,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_40__setstate_cython__(CYTHON_UNUSED return __pyx_r; } -/* "ssh2/sftp.pyx":319 +/* "ssh2/sftp.pyx":322 * cdef c_sftp.LIBSSH2_SFTP_ATTRIBUTES *_attrs * * def __cinit__(self): # <<<<<<<<<<<<<< @@ -5185,7 +5185,7 @@ static int __pyx_pf_4ssh2_4sftp_14SFTPAttributes___cinit__(struct __pyx_obj_4ssh int __pyx_t_1; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "ssh2/sftp.pyx":320 + /* "ssh2/sftp.pyx":323 * * def __cinit__(self): * with nogil: # <<<<<<<<<<<<<< @@ -5200,7 +5200,7 @@ static int __pyx_pf_4ssh2_4sftp_14SFTPAttributes___cinit__(struct __pyx_obj_4ssh #endif /*try:*/ { - /* "ssh2/sftp.pyx":321 + /* "ssh2/sftp.pyx":324 * def __cinit__(self): * with nogil: * self._attrs = malloc( # <<<<<<<<<<<<<< @@ -5209,7 +5209,7 @@ static int __pyx_pf_4ssh2_4sftp_14SFTPAttributes___cinit__(struct __pyx_obj_4ssh */ __pyx_v_self->_attrs = ((LIBSSH2_SFTP_ATTRIBUTES *)malloc((sizeof(LIBSSH2_SFTP_ATTRIBUTES)))); - /* "ssh2/sftp.pyx":323 + /* "ssh2/sftp.pyx":326 * self._attrs = malloc( * sizeof(c_sftp.LIBSSH2_SFTP_ATTRIBUTES)) * if self._attrs is NULL: # <<<<<<<<<<<<<< @@ -5219,7 +5219,7 @@ static int __pyx_pf_4ssh2_4sftp_14SFTPAttributes___cinit__(struct __pyx_obj_4ssh __pyx_t_1 = ((__pyx_v_self->_attrs == NULL) != 0); if (__pyx_t_1) { - /* "ssh2/sftp.pyx":324 + /* "ssh2/sftp.pyx":327 * sizeof(c_sftp.LIBSSH2_SFTP_ATTRIBUTES)) * if self._attrs is NULL: * with gil: # <<<<<<<<<<<<<< @@ -5232,17 +5232,17 @@ static int __pyx_pf_4ssh2_4sftp_14SFTPAttributes___cinit__(struct __pyx_obj_4ssh #endif /*try:*/ { - /* "ssh2/sftp.pyx":325 + /* "ssh2/sftp.pyx":328 * if self._attrs is NULL: * with gil: * raise MemoryError # <<<<<<<<<<<<<< * self._attrs.flags = 0 * self._attrs.filesize = 0 */ - PyErr_NoMemory(); __PYX_ERR(0, 325, __pyx_L8_error) + PyErr_NoMemory(); __PYX_ERR(0, 328, __pyx_L8_error) } - /* "ssh2/sftp.pyx":324 + /* "ssh2/sftp.pyx":327 * sizeof(c_sftp.LIBSSH2_SFTP_ATTRIBUTES)) * if self._attrs is NULL: * with gil: # <<<<<<<<<<<<<< @@ -5259,7 +5259,7 @@ static int __pyx_pf_4ssh2_4sftp_14SFTPAttributes___cinit__(struct __pyx_obj_4ssh } } - /* "ssh2/sftp.pyx":323 + /* "ssh2/sftp.pyx":326 * self._attrs = malloc( * sizeof(c_sftp.LIBSSH2_SFTP_ATTRIBUTES)) * if self._attrs is NULL: # <<<<<<<<<<<<<< @@ -5268,7 +5268,7 @@ static int __pyx_pf_4ssh2_4sftp_14SFTPAttributes___cinit__(struct __pyx_obj_4ssh */ } - /* "ssh2/sftp.pyx":326 + /* "ssh2/sftp.pyx":329 * with gil: * raise MemoryError * self._attrs.flags = 0 # <<<<<<<<<<<<<< @@ -5277,7 +5277,7 @@ static int __pyx_pf_4ssh2_4sftp_14SFTPAttributes___cinit__(struct __pyx_obj_4ssh */ __pyx_v_self->_attrs->flags = 0; - /* "ssh2/sftp.pyx":327 + /* "ssh2/sftp.pyx":330 * raise MemoryError * self._attrs.flags = 0 * self._attrs.filesize = 0 # <<<<<<<<<<<<<< @@ -5286,7 +5286,7 @@ static int __pyx_pf_4ssh2_4sftp_14SFTPAttributes___cinit__(struct __pyx_obj_4ssh */ __pyx_v_self->_attrs->filesize = 0; - /* "ssh2/sftp.pyx":328 + /* "ssh2/sftp.pyx":331 * self._attrs.flags = 0 * self._attrs.filesize = 0 * self._attrs.uid = 0 # <<<<<<<<<<<<<< @@ -5295,7 +5295,7 @@ static int __pyx_pf_4ssh2_4sftp_14SFTPAttributes___cinit__(struct __pyx_obj_4ssh */ __pyx_v_self->_attrs->uid = 0; - /* "ssh2/sftp.pyx":329 + /* "ssh2/sftp.pyx":332 * self._attrs.filesize = 0 * self._attrs.uid = 0 * self._attrs.gid = 0 # <<<<<<<<<<<<<< @@ -5304,7 +5304,7 @@ static int __pyx_pf_4ssh2_4sftp_14SFTPAttributes___cinit__(struct __pyx_obj_4ssh */ __pyx_v_self->_attrs->gid = 0; - /* "ssh2/sftp.pyx":330 + /* "ssh2/sftp.pyx":333 * self._attrs.uid = 0 * self._attrs.gid = 0 * self._attrs.permissions = 0 # <<<<<<<<<<<<<< @@ -5313,7 +5313,7 @@ static int __pyx_pf_4ssh2_4sftp_14SFTPAttributes___cinit__(struct __pyx_obj_4ssh */ __pyx_v_self->_attrs->permissions = 0; - /* "ssh2/sftp.pyx":331 + /* "ssh2/sftp.pyx":334 * self._attrs.gid = 0 * self._attrs.permissions = 0 * self._attrs.atime = 0 # <<<<<<<<<<<<<< @@ -5322,7 +5322,7 @@ static int __pyx_pf_4ssh2_4sftp_14SFTPAttributes___cinit__(struct __pyx_obj_4ssh */ __pyx_v_self->_attrs->atime = 0; - /* "ssh2/sftp.pyx":332 + /* "ssh2/sftp.pyx":335 * self._attrs.permissions = 0 * self._attrs.atime = 0 * self._attrs.mtime = 0 # <<<<<<<<<<<<<< @@ -5332,7 +5332,7 @@ static int __pyx_pf_4ssh2_4sftp_14SFTPAttributes___cinit__(struct __pyx_obj_4ssh __pyx_v_self->_attrs->mtime = 0; } - /* "ssh2/sftp.pyx":320 + /* "ssh2/sftp.pyx":323 * * def __cinit__(self): * with nogil: # <<<<<<<<<<<<<< @@ -5358,7 +5358,7 @@ static int __pyx_pf_4ssh2_4sftp_14SFTPAttributes___cinit__(struct __pyx_obj_4ssh } } - /* "ssh2/sftp.pyx":319 + /* "ssh2/sftp.pyx":322 * cdef c_sftp.LIBSSH2_SFTP_ATTRIBUTES *_attrs * * def __cinit__(self): # <<<<<<<<<<<<<< @@ -5377,7 +5377,7 @@ static int __pyx_pf_4ssh2_4sftp_14SFTPAttributes___cinit__(struct __pyx_obj_4ssh return __pyx_r; } -/* "ssh2/sftp.pyx":334 +/* "ssh2/sftp.pyx":337 * self._attrs.mtime = 0 * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -5400,7 +5400,7 @@ static void __pyx_pf_4ssh2_4sftp_14SFTPAttributes_2__dealloc__(struct __pyx_obj_ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "ssh2/sftp.pyx":335 + /* "ssh2/sftp.pyx":338 * * def __dealloc__(self): * with nogil: # <<<<<<<<<<<<<< @@ -5415,7 +5415,7 @@ static void __pyx_pf_4ssh2_4sftp_14SFTPAttributes_2__dealloc__(struct __pyx_obj_ #endif /*try:*/ { - /* "ssh2/sftp.pyx":336 + /* "ssh2/sftp.pyx":339 * def __dealloc__(self): * with nogil: * free(self._attrs) # <<<<<<<<<<<<<< @@ -5425,7 +5425,7 @@ static void __pyx_pf_4ssh2_4sftp_14SFTPAttributes_2__dealloc__(struct __pyx_obj_ free(__pyx_v_self->_attrs); } - /* "ssh2/sftp.pyx":335 + /* "ssh2/sftp.pyx":338 * * def __dealloc__(self): * with nogil: # <<<<<<<<<<<<<< @@ -5444,7 +5444,7 @@ static void __pyx_pf_4ssh2_4sftp_14SFTPAttributes_2__dealloc__(struct __pyx_obj_ } } - /* "ssh2/sftp.pyx":334 + /* "ssh2/sftp.pyx":337 * self._attrs.mtime = 0 * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -5456,7 +5456,7 @@ static void __pyx_pf_4ssh2_4sftp_14SFTPAttributes_2__dealloc__(struct __pyx_obj_ __Pyx_RefNannyFinishContext(); } -/* "ssh2/sftp.pyx":339 +/* "ssh2/sftp.pyx":342 * * @property * def flags(self): # <<<<<<<<<<<<<< @@ -5483,7 +5483,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_14SFTPAttributes_5flags___get__(struct __p PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__", 0); - /* "ssh2/sftp.pyx":340 + /* "ssh2/sftp.pyx":343 * @property * def flags(self): * return self._attrs.flags # <<<<<<<<<<<<<< @@ -5491,13 +5491,13 @@ static PyObject *__pyx_pf_4ssh2_4sftp_14SFTPAttributes_5flags___get__(struct __p * @flags.setter */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_unsigned_long(__pyx_v_self->_attrs->flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 340, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_unsigned_long(__pyx_v_self->_attrs->flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/sftp.pyx":339 + /* "ssh2/sftp.pyx":342 * * @property * def flags(self): # <<<<<<<<<<<<<< @@ -5516,7 +5516,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_14SFTPAttributes_5flags___get__(struct __p return __pyx_r; } -/* "ssh2/sftp.pyx":343 +/* "ssh2/sftp.pyx":346 * * @flags.setter * def flags(self, unsigned long flags): # <<<<<<<<<<<<<< @@ -5532,7 +5532,7 @@ static int __pyx_pw_4ssh2_4sftp_14SFTPAttributes_5flags_3__set__(PyObject *__pyx __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); assert(__pyx_arg_flags); { - __pyx_v_flags = __Pyx_PyInt_As_unsigned_long(__pyx_arg_flags); if (unlikely((__pyx_v_flags == (unsigned long)-1) && PyErr_Occurred())) __PYX_ERR(0, 343, __pyx_L3_error) + __pyx_v_flags = __Pyx_PyInt_As_unsigned_long(__pyx_arg_flags); if (unlikely((__pyx_v_flags == (unsigned long)-1) && PyErr_Occurred())) __PYX_ERR(0, 346, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -5552,7 +5552,7 @@ static int __pyx_pf_4ssh2_4sftp_14SFTPAttributes_5flags_2__set__(struct __pyx_ob __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__", 0); - /* "ssh2/sftp.pyx":344 + /* "ssh2/sftp.pyx":347 * @flags.setter * def flags(self, unsigned long flags): * self._attrs.flags = flags # <<<<<<<<<<<<<< @@ -5561,7 +5561,7 @@ static int __pyx_pf_4ssh2_4sftp_14SFTPAttributes_5flags_2__set__(struct __pyx_ob */ __pyx_v_self->_attrs->flags = __pyx_v_flags; - /* "ssh2/sftp.pyx":343 + /* "ssh2/sftp.pyx":346 * * @flags.setter * def flags(self, unsigned long flags): # <<<<<<<<<<<<<< @@ -5575,7 +5575,7 @@ static int __pyx_pf_4ssh2_4sftp_14SFTPAttributes_5flags_2__set__(struct __pyx_ob return __pyx_r; } -/* "ssh2/sftp.pyx":347 +/* "ssh2/sftp.pyx":350 * * @property * def filesize(self): # <<<<<<<<<<<<<< @@ -5602,7 +5602,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_14SFTPAttributes_8filesize___get__(struct PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__", 0); - /* "ssh2/sftp.pyx":348 + /* "ssh2/sftp.pyx":351 * @property * def filesize(self): * return self._attrs.filesize # <<<<<<<<<<<<<< @@ -5610,13 +5610,13 @@ static PyObject *__pyx_pf_4ssh2_4sftp_14SFTPAttributes_8filesize___get__(struct * @filesize.setter */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_uint64_t(__pyx_v_self->_attrs->filesize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 348, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint64_t(__pyx_v_self->_attrs->filesize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/sftp.pyx":347 + /* "ssh2/sftp.pyx":350 * * @property * def filesize(self): # <<<<<<<<<<<<<< @@ -5635,7 +5635,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_14SFTPAttributes_8filesize___get__(struct return __pyx_r; } -/* "ssh2/sftp.pyx":351 +/* "ssh2/sftp.pyx":354 * * @filesize.setter * def filesize(self, uint64_t filesize): # <<<<<<<<<<<<<< @@ -5651,7 +5651,7 @@ static int __pyx_pw_4ssh2_4sftp_14SFTPAttributes_8filesize_3__set__(PyObject *__ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); assert(__pyx_arg_filesize); { - __pyx_v_filesize = __Pyx_PyInt_As_uint64_t(__pyx_arg_filesize); if (unlikely((__pyx_v_filesize == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 351, __pyx_L3_error) + __pyx_v_filesize = __Pyx_PyInt_As_uint64_t(__pyx_arg_filesize); if (unlikely((__pyx_v_filesize == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 354, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -5671,7 +5671,7 @@ static int __pyx_pf_4ssh2_4sftp_14SFTPAttributes_8filesize_2__set__(struct __pyx __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__", 0); - /* "ssh2/sftp.pyx":352 + /* "ssh2/sftp.pyx":355 * @filesize.setter * def filesize(self, uint64_t filesize): * self._attrs.filesize = filesize # <<<<<<<<<<<<<< @@ -5680,7 +5680,7 @@ static int __pyx_pf_4ssh2_4sftp_14SFTPAttributes_8filesize_2__set__(struct __pyx */ __pyx_v_self->_attrs->filesize = __pyx_v_filesize; - /* "ssh2/sftp.pyx":351 + /* "ssh2/sftp.pyx":354 * * @filesize.setter * def filesize(self, uint64_t filesize): # <<<<<<<<<<<<<< @@ -5694,7 +5694,7 @@ static int __pyx_pf_4ssh2_4sftp_14SFTPAttributes_8filesize_2__set__(struct __pyx return __pyx_r; } -/* "ssh2/sftp.pyx":355 +/* "ssh2/sftp.pyx":358 * * @property * def uid(self): # <<<<<<<<<<<<<< @@ -5721,7 +5721,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_14SFTPAttributes_3uid___get__(struct __pyx PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__", 0); - /* "ssh2/sftp.pyx":356 + /* "ssh2/sftp.pyx":359 * @property * def uid(self): * return self._attrs.uid # <<<<<<<<<<<<<< @@ -5729,13 +5729,13 @@ static PyObject *__pyx_pf_4ssh2_4sftp_14SFTPAttributes_3uid___get__(struct __pyx * @uid.setter */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_unsigned_long(__pyx_v_self->_attrs->uid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 356, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_unsigned_long(__pyx_v_self->_attrs->uid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 359, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/sftp.pyx":355 + /* "ssh2/sftp.pyx":358 * * @property * def uid(self): # <<<<<<<<<<<<<< @@ -5754,7 +5754,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_14SFTPAttributes_3uid___get__(struct __pyx return __pyx_r; } -/* "ssh2/sftp.pyx":359 +/* "ssh2/sftp.pyx":362 * * @uid.setter * def uid(self, unsigned long uid): # <<<<<<<<<<<<<< @@ -5770,7 +5770,7 @@ static int __pyx_pw_4ssh2_4sftp_14SFTPAttributes_3uid_3__set__(PyObject *__pyx_v __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); assert(__pyx_arg_uid); { - __pyx_v_uid = __Pyx_PyInt_As_unsigned_long(__pyx_arg_uid); if (unlikely((__pyx_v_uid == (unsigned long)-1) && PyErr_Occurred())) __PYX_ERR(0, 359, __pyx_L3_error) + __pyx_v_uid = __Pyx_PyInt_As_unsigned_long(__pyx_arg_uid); if (unlikely((__pyx_v_uid == (unsigned long)-1) && PyErr_Occurred())) __PYX_ERR(0, 362, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -5790,7 +5790,7 @@ static int __pyx_pf_4ssh2_4sftp_14SFTPAttributes_3uid_2__set__(struct __pyx_obj_ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__", 0); - /* "ssh2/sftp.pyx":360 + /* "ssh2/sftp.pyx":363 * @uid.setter * def uid(self, unsigned long uid): * self._attrs.uid = uid # <<<<<<<<<<<<<< @@ -5799,7 +5799,7 @@ static int __pyx_pf_4ssh2_4sftp_14SFTPAttributes_3uid_2__set__(struct __pyx_obj_ */ __pyx_v_self->_attrs->uid = __pyx_v_uid; - /* "ssh2/sftp.pyx":359 + /* "ssh2/sftp.pyx":362 * * @uid.setter * def uid(self, unsigned long uid): # <<<<<<<<<<<<<< @@ -5813,7 +5813,7 @@ static int __pyx_pf_4ssh2_4sftp_14SFTPAttributes_3uid_2__set__(struct __pyx_obj_ return __pyx_r; } -/* "ssh2/sftp.pyx":363 +/* "ssh2/sftp.pyx":366 * * @property * def gid(self): # <<<<<<<<<<<<<< @@ -5840,7 +5840,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_14SFTPAttributes_3gid___get__(struct __pyx PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__", 0); - /* "ssh2/sftp.pyx":364 + /* "ssh2/sftp.pyx":367 * @property * def gid(self): * return self._attrs.gid # <<<<<<<<<<<<<< @@ -5848,13 +5848,13 @@ static PyObject *__pyx_pf_4ssh2_4sftp_14SFTPAttributes_3gid___get__(struct __pyx * @gid.setter */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_unsigned_long(__pyx_v_self->_attrs->gid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 364, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_unsigned_long(__pyx_v_self->_attrs->gid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 367, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/sftp.pyx":363 + /* "ssh2/sftp.pyx":366 * * @property * def gid(self): # <<<<<<<<<<<<<< @@ -5873,7 +5873,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_14SFTPAttributes_3gid___get__(struct __pyx return __pyx_r; } -/* "ssh2/sftp.pyx":367 +/* "ssh2/sftp.pyx":370 * * @gid.setter * def gid(self, unsigned long gid): # <<<<<<<<<<<<<< @@ -5889,7 +5889,7 @@ static int __pyx_pw_4ssh2_4sftp_14SFTPAttributes_3gid_3__set__(PyObject *__pyx_v __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); assert(__pyx_arg_gid); { - __pyx_v_gid = __Pyx_PyInt_As_unsigned_long(__pyx_arg_gid); if (unlikely((__pyx_v_gid == (unsigned long)-1) && PyErr_Occurred())) __PYX_ERR(0, 367, __pyx_L3_error) + __pyx_v_gid = __Pyx_PyInt_As_unsigned_long(__pyx_arg_gid); if (unlikely((__pyx_v_gid == (unsigned long)-1) && PyErr_Occurred())) __PYX_ERR(0, 370, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -5909,7 +5909,7 @@ static int __pyx_pf_4ssh2_4sftp_14SFTPAttributes_3gid_2__set__(struct __pyx_obj_ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__", 0); - /* "ssh2/sftp.pyx":368 + /* "ssh2/sftp.pyx":371 * @gid.setter * def gid(self, unsigned long gid): * self._attrs.gid = gid # <<<<<<<<<<<<<< @@ -5918,7 +5918,7 @@ static int __pyx_pf_4ssh2_4sftp_14SFTPAttributes_3gid_2__set__(struct __pyx_obj_ */ __pyx_v_self->_attrs->gid = __pyx_v_gid; - /* "ssh2/sftp.pyx":367 + /* "ssh2/sftp.pyx":370 * * @gid.setter * def gid(self, unsigned long gid): # <<<<<<<<<<<<<< @@ -5932,7 +5932,7 @@ static int __pyx_pf_4ssh2_4sftp_14SFTPAttributes_3gid_2__set__(struct __pyx_obj_ return __pyx_r; } -/* "ssh2/sftp.pyx":371 +/* "ssh2/sftp.pyx":374 * * @property * def permissions(self): # <<<<<<<<<<<<<< @@ -5959,7 +5959,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_14SFTPAttributes_11permissions___get__(str PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__", 0); - /* "ssh2/sftp.pyx":372 + /* "ssh2/sftp.pyx":375 * @property * def permissions(self): * return self._attrs.permissions # <<<<<<<<<<<<<< @@ -5967,13 +5967,13 @@ static PyObject *__pyx_pf_4ssh2_4sftp_14SFTPAttributes_11permissions___get__(str * @permissions.setter */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_unsigned_long(__pyx_v_self->_attrs->permissions); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 372, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_unsigned_long(__pyx_v_self->_attrs->permissions); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/sftp.pyx":371 + /* "ssh2/sftp.pyx":374 * * @property * def permissions(self): # <<<<<<<<<<<<<< @@ -5992,7 +5992,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_14SFTPAttributes_11permissions___get__(str return __pyx_r; } -/* "ssh2/sftp.pyx":375 +/* "ssh2/sftp.pyx":378 * * @permissions.setter * def permissions(self, unsigned long permissions): # <<<<<<<<<<<<<< @@ -6008,7 +6008,7 @@ static int __pyx_pw_4ssh2_4sftp_14SFTPAttributes_11permissions_3__set__(PyObject __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); assert(__pyx_arg_permissions); { - __pyx_v_permissions = __Pyx_PyInt_As_unsigned_long(__pyx_arg_permissions); if (unlikely((__pyx_v_permissions == (unsigned long)-1) && PyErr_Occurred())) __PYX_ERR(0, 375, __pyx_L3_error) + __pyx_v_permissions = __Pyx_PyInt_As_unsigned_long(__pyx_arg_permissions); if (unlikely((__pyx_v_permissions == (unsigned long)-1) && PyErr_Occurred())) __PYX_ERR(0, 378, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -6028,7 +6028,7 @@ static int __pyx_pf_4ssh2_4sftp_14SFTPAttributes_11permissions_2__set__(struct _ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__", 0); - /* "ssh2/sftp.pyx":376 + /* "ssh2/sftp.pyx":379 * @permissions.setter * def permissions(self, unsigned long permissions): * self._attrs.permissions = permissions # <<<<<<<<<<<<<< @@ -6037,7 +6037,7 @@ static int __pyx_pf_4ssh2_4sftp_14SFTPAttributes_11permissions_2__set__(struct _ */ __pyx_v_self->_attrs->permissions = __pyx_v_permissions; - /* "ssh2/sftp.pyx":375 + /* "ssh2/sftp.pyx":378 * * @permissions.setter * def permissions(self, unsigned long permissions): # <<<<<<<<<<<<<< @@ -6051,7 +6051,7 @@ static int __pyx_pf_4ssh2_4sftp_14SFTPAttributes_11permissions_2__set__(struct _ return __pyx_r; } -/* "ssh2/sftp.pyx":379 +/* "ssh2/sftp.pyx":382 * * @property * def atime(self): # <<<<<<<<<<<<<< @@ -6078,7 +6078,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_14SFTPAttributes_5atime___get__(struct __p PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__", 0); - /* "ssh2/sftp.pyx":380 + /* "ssh2/sftp.pyx":383 * @property * def atime(self): * return self._attrs.atime # <<<<<<<<<<<<<< @@ -6086,13 +6086,13 @@ static PyObject *__pyx_pf_4ssh2_4sftp_14SFTPAttributes_5atime___get__(struct __p * @atime.setter */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_unsigned_long(__pyx_v_self->_attrs->atime); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 380, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_unsigned_long(__pyx_v_self->_attrs->atime); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 383, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/sftp.pyx":379 + /* "ssh2/sftp.pyx":382 * * @property * def atime(self): # <<<<<<<<<<<<<< @@ -6111,7 +6111,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_14SFTPAttributes_5atime___get__(struct __p return __pyx_r; } -/* "ssh2/sftp.pyx":383 +/* "ssh2/sftp.pyx":386 * * @atime.setter * def atime(self, unsigned long atime): # <<<<<<<<<<<<<< @@ -6127,7 +6127,7 @@ static int __pyx_pw_4ssh2_4sftp_14SFTPAttributes_5atime_3__set__(PyObject *__pyx __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); assert(__pyx_arg_atime); { - __pyx_v_atime = __Pyx_PyInt_As_unsigned_long(__pyx_arg_atime); if (unlikely((__pyx_v_atime == (unsigned long)-1) && PyErr_Occurred())) __PYX_ERR(0, 383, __pyx_L3_error) + __pyx_v_atime = __Pyx_PyInt_As_unsigned_long(__pyx_arg_atime); if (unlikely((__pyx_v_atime == (unsigned long)-1) && PyErr_Occurred())) __PYX_ERR(0, 386, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -6147,7 +6147,7 @@ static int __pyx_pf_4ssh2_4sftp_14SFTPAttributes_5atime_2__set__(struct __pyx_ob __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__", 0); - /* "ssh2/sftp.pyx":384 + /* "ssh2/sftp.pyx":387 * @atime.setter * def atime(self, unsigned long atime): * self._attrs.atime = atime # <<<<<<<<<<<<<< @@ -6156,7 +6156,7 @@ static int __pyx_pf_4ssh2_4sftp_14SFTPAttributes_5atime_2__set__(struct __pyx_ob */ __pyx_v_self->_attrs->atime = __pyx_v_atime; - /* "ssh2/sftp.pyx":383 + /* "ssh2/sftp.pyx":386 * * @atime.setter * def atime(self, unsigned long atime): # <<<<<<<<<<<<<< @@ -6170,7 +6170,7 @@ static int __pyx_pf_4ssh2_4sftp_14SFTPAttributes_5atime_2__set__(struct __pyx_ob return __pyx_r; } -/* "ssh2/sftp.pyx":387 +/* "ssh2/sftp.pyx":390 * * @property * def mtime(self): # <<<<<<<<<<<<<< @@ -6197,7 +6197,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_14SFTPAttributes_5mtime___get__(struct __p PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__", 0); - /* "ssh2/sftp.pyx":388 + /* "ssh2/sftp.pyx":391 * @property * def mtime(self): * return self._attrs.mtime # <<<<<<<<<<<<<< @@ -6205,13 +6205,13 @@ static PyObject *__pyx_pf_4ssh2_4sftp_14SFTPAttributes_5mtime___get__(struct __p * @mtime.setter */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_unsigned_long(__pyx_v_self->_attrs->mtime); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 388, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_unsigned_long(__pyx_v_self->_attrs->mtime); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 391, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/sftp.pyx":387 + /* "ssh2/sftp.pyx":390 * * @property * def mtime(self): # <<<<<<<<<<<<<< @@ -6230,7 +6230,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_14SFTPAttributes_5mtime___get__(struct __p return __pyx_r; } -/* "ssh2/sftp.pyx":391 +/* "ssh2/sftp.pyx":394 * * @mtime.setter * def mtime(self, unsigned long mtime): # <<<<<<<<<<<<<< @@ -6246,7 +6246,7 @@ static int __pyx_pw_4ssh2_4sftp_14SFTPAttributes_5mtime_3__set__(PyObject *__pyx __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); assert(__pyx_arg_mtime); { - __pyx_v_mtime = __Pyx_PyInt_As_unsigned_long(__pyx_arg_mtime); if (unlikely((__pyx_v_mtime == (unsigned long)-1) && PyErr_Occurred())) __PYX_ERR(0, 391, __pyx_L3_error) + __pyx_v_mtime = __Pyx_PyInt_As_unsigned_long(__pyx_arg_mtime); if (unlikely((__pyx_v_mtime == (unsigned long)-1) && PyErr_Occurred())) __PYX_ERR(0, 394, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -6266,7 +6266,7 @@ static int __pyx_pf_4ssh2_4sftp_14SFTPAttributes_5mtime_2__set__(struct __pyx_ob __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__", 0); - /* "ssh2/sftp.pyx":392 + /* "ssh2/sftp.pyx":395 * @mtime.setter * def mtime(self, unsigned long mtime): * self._attrs.mtime = mtime # <<<<<<<<<<<<<< @@ -6275,7 +6275,7 @@ static int __pyx_pf_4ssh2_4sftp_14SFTPAttributes_5mtime_2__set__(struct __pyx_ob */ __pyx_v_self->_attrs->mtime = __pyx_v_mtime; - /* "ssh2/sftp.pyx":391 + /* "ssh2/sftp.pyx":394 * * @mtime.setter * def mtime(self, unsigned long mtime): # <<<<<<<<<<<<<< @@ -6398,7 +6398,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_14SFTPAttributes_6__setstate_cython__(CYTH return __pyx_r; } -/* "ssh2/sftp.pyx":400 +/* "ssh2/sftp.pyx":403 * cdef bint closed * * def __cinit__(self, sftp): # <<<<<<<<<<<<<< @@ -6432,7 +6432,7 @@ static int __pyx_pw_4ssh2_4sftp_10SFTPHandle_1__cinit__(PyObject *__pyx_v_self, else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 400, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 403, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; @@ -6443,7 +6443,7 @@ static int __pyx_pw_4ssh2_4sftp_10SFTPHandle_1__cinit__(PyObject *__pyx_v_self, } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 400, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 403, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.sftp.SFTPHandle.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -6462,7 +6462,7 @@ static int __pyx_pf_4ssh2_4sftp_10SFTPHandle___cinit__(struct __pyx_obj_4ssh2_4s PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "ssh2/sftp.pyx":401 + /* "ssh2/sftp.pyx":404 * * def __cinit__(self, sftp): * self._handle = NULL # <<<<<<<<<<<<<< @@ -6471,14 +6471,14 @@ static int __pyx_pf_4ssh2_4sftp_10SFTPHandle___cinit__(struct __pyx_obj_4ssh2_4s */ __pyx_v_self->_handle = NULL; - /* "ssh2/sftp.pyx":402 + /* "ssh2/sftp.pyx":405 * def __cinit__(self, sftp): * self._handle = NULL * self._sftp = sftp # <<<<<<<<<<<<<< * self.closed = 0 * */ - if (!(likely(((__pyx_v_sftp) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_sftp, __pyx_ptype_4ssh2_4sftp_SFTP))))) __PYX_ERR(0, 402, __pyx_L1_error) + if (!(likely(((__pyx_v_sftp) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_sftp, __pyx_ptype_4ssh2_4sftp_SFTP))))) __PYX_ERR(0, 405, __pyx_L1_error) __pyx_t_1 = __pyx_v_sftp; __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); @@ -6487,7 +6487,7 @@ static int __pyx_pf_4ssh2_4sftp_10SFTPHandle___cinit__(struct __pyx_obj_4ssh2_4s __pyx_v_self->_sftp = ((struct __pyx_obj_4ssh2_4sftp_SFTP *)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/sftp.pyx":403 + /* "ssh2/sftp.pyx":406 * self._handle = NULL * self._sftp = sftp * self.closed = 0 # <<<<<<<<<<<<<< @@ -6496,7 +6496,7 @@ static int __pyx_pf_4ssh2_4sftp_10SFTPHandle___cinit__(struct __pyx_obj_4ssh2_4s */ __pyx_v_self->closed = 0; - /* "ssh2/sftp.pyx":400 + /* "ssh2/sftp.pyx":403 * cdef bint closed * * def __cinit__(self, sftp): # <<<<<<<<<<<<<< @@ -6516,7 +6516,7 @@ static int __pyx_pf_4ssh2_4sftp_10SFTPHandle___cinit__(struct __pyx_obj_4ssh2_4s return __pyx_r; } -/* "ssh2/sftp.pyx":405 +/* "ssh2/sftp.pyx":408 * self.closed = 0 * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -6540,7 +6540,7 @@ static void __pyx_pf_4ssh2_4sftp_10SFTPHandle_2__dealloc__(struct __pyx_obj_4ssh int __pyx_t_1; __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "ssh2/sftp.pyx":406 + /* "ssh2/sftp.pyx":409 * * def __dealloc__(self): * if self.closed == 0: # <<<<<<<<<<<<<< @@ -6550,7 +6550,7 @@ static void __pyx_pf_4ssh2_4sftp_10SFTPHandle_2__dealloc__(struct __pyx_obj_4ssh __pyx_t_1 = ((__pyx_v_self->closed == 0) != 0); if (__pyx_t_1) { - /* "ssh2/sftp.pyx":407 + /* "ssh2/sftp.pyx":410 * def __dealloc__(self): * if self.closed == 0: * with nogil: # <<<<<<<<<<<<<< @@ -6565,7 +6565,7 @@ static void __pyx_pf_4ssh2_4sftp_10SFTPHandle_2__dealloc__(struct __pyx_obj_4ssh #endif /*try:*/ { - /* "ssh2/sftp.pyx":408 + /* "ssh2/sftp.pyx":411 * if self.closed == 0: * with nogil: * c_sftp.libssh2_sftp_close_handle(self._handle) # <<<<<<<<<<<<<< @@ -6575,7 +6575,7 @@ static void __pyx_pf_4ssh2_4sftp_10SFTPHandle_2__dealloc__(struct __pyx_obj_4ssh libssh2_sftp_close_handle(__pyx_v_self->_handle); } - /* "ssh2/sftp.pyx":407 + /* "ssh2/sftp.pyx":410 * def __dealloc__(self): * if self.closed == 0: * with nogil: # <<<<<<<<<<<<<< @@ -6594,7 +6594,7 @@ static void __pyx_pf_4ssh2_4sftp_10SFTPHandle_2__dealloc__(struct __pyx_obj_4ssh } } - /* "ssh2/sftp.pyx":409 + /* "ssh2/sftp.pyx":412 * with nogil: * c_sftp.libssh2_sftp_close_handle(self._handle) * self.closed = 1 # <<<<<<<<<<<<<< @@ -6603,7 +6603,7 @@ static void __pyx_pf_4ssh2_4sftp_10SFTPHandle_2__dealloc__(struct __pyx_obj_4ssh */ __pyx_v_self->closed = 1; - /* "ssh2/sftp.pyx":406 + /* "ssh2/sftp.pyx":409 * * def __dealloc__(self): * if self.closed == 0: # <<<<<<<<<<<<<< @@ -6612,7 +6612,7 @@ static void __pyx_pf_4ssh2_4sftp_10SFTPHandle_2__dealloc__(struct __pyx_obj_4ssh */ } - /* "ssh2/sftp.pyx":405 + /* "ssh2/sftp.pyx":408 * self.closed = 0 * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -6624,7 +6624,7 @@ static void __pyx_pf_4ssh2_4sftp_10SFTPHandle_2__dealloc__(struct __pyx_obj_4ssh __Pyx_RefNannyFinishContext(); } -/* "ssh2/sftp.pyx":411 +/* "ssh2/sftp.pyx":414 * self.closed = 1 * * def __iter__(self): # <<<<<<<<<<<<<< @@ -6650,7 +6650,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_4__iter__(struct __pyx_obj_4s __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__iter__", 0); - /* "ssh2/sftp.pyx":412 + /* "ssh2/sftp.pyx":415 * * def __iter__(self): * return self # <<<<<<<<<<<<<< @@ -6662,7 +6662,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_4__iter__(struct __pyx_obj_4s __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; - /* "ssh2/sftp.pyx":411 + /* "ssh2/sftp.pyx":414 * self.closed = 1 * * def __iter__(self): # <<<<<<<<<<<<<< @@ -6677,7 +6677,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_4__iter__(struct __pyx_obj_4s return __pyx_r; } -/* "ssh2/sftp.pyx":414 +/* "ssh2/sftp.pyx":417 * return self * * def __next__(self): # <<<<<<<<<<<<<< @@ -6709,14 +6709,14 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_6__next__(struct __pyx_obj_4s int __pyx_t_5; __Pyx_RefNannySetupContext("__next__", 0); - /* "ssh2/sftp.pyx":415 + /* "ssh2/sftp.pyx":418 * * def __next__(self): * cdef bytes data = self.read() # <<<<<<<<<<<<<< * if len(data) == 0: * raise StopIteration */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_read); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 415, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_read); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 418, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { @@ -6729,18 +6729,18 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_6__next__(struct __pyx_obj_4s } } if (__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 415, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 418, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 415, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 418, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 415, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 418, __pyx_L1_error) __pyx_v_data = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/sftp.pyx":416 + /* "ssh2/sftp.pyx":419 * def __next__(self): * cdef bytes data = self.read() * if len(data) == 0: # <<<<<<<<<<<<<< @@ -6749,13 +6749,13 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_6__next__(struct __pyx_obj_4s */ if (unlikely(__pyx_v_data == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 416, __pyx_L1_error) + __PYX_ERR(0, 419, __pyx_L1_error) } - __pyx_t_4 = PyBytes_GET_SIZE(__pyx_v_data); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 416, __pyx_L1_error) + __pyx_t_4 = PyBytes_GET_SIZE(__pyx_v_data); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 419, __pyx_L1_error) __pyx_t_5 = ((__pyx_t_4 == 0) != 0); if (__pyx_t_5) { - /* "ssh2/sftp.pyx":417 + /* "ssh2/sftp.pyx":420 * cdef bytes data = self.read() * if len(data) == 0: * raise StopIteration # <<<<<<<<<<<<<< @@ -6763,9 +6763,9 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_6__next__(struct __pyx_obj_4s * */ __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0); - __PYX_ERR(0, 417, __pyx_L1_error) + __PYX_ERR(0, 420, __pyx_L1_error) - /* "ssh2/sftp.pyx":416 + /* "ssh2/sftp.pyx":419 * def __next__(self): * cdef bytes data = self.read() * if len(data) == 0: # <<<<<<<<<<<<<< @@ -6774,7 +6774,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_6__next__(struct __pyx_obj_4s */ } - /* "ssh2/sftp.pyx":418 + /* "ssh2/sftp.pyx":421 * if len(data) == 0: * raise StopIteration * return data # <<<<<<<<<<<<<< @@ -6786,7 +6786,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_6__next__(struct __pyx_obj_4s __pyx_r = __pyx_v_data; goto __pyx_L0; - /* "ssh2/sftp.pyx":414 + /* "ssh2/sftp.pyx":417 * return self * * def __next__(self): # <<<<<<<<<<<<<< @@ -6808,7 +6808,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_6__next__(struct __pyx_obj_4s return __pyx_r; } -/* "ssh2/sftp.pyx":420 +/* "ssh2/sftp.pyx":423 * return data * * def __enter__(self): # <<<<<<<<<<<<<< @@ -6835,7 +6835,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_8__enter__(struct __pyx_obj_4 __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__enter__", 0); - /* "ssh2/sftp.pyx":421 + /* "ssh2/sftp.pyx":424 * * def __enter__(self): * return self # <<<<<<<<<<<<<< @@ -6847,7 +6847,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_8__enter__(struct __pyx_obj_4 __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; - /* "ssh2/sftp.pyx":420 + /* "ssh2/sftp.pyx":423 * return data * * def __enter__(self): # <<<<<<<<<<<<<< @@ -6862,7 +6862,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_8__enter__(struct __pyx_obj_4 return __pyx_r; } -/* "ssh2/sftp.pyx":423 +/* "ssh2/sftp.pyx":426 * return self * * def __exit__(self, *args): # <<<<<<<<<<<<<< @@ -6897,14 +6897,14 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_10__exit__(struct __pyx_obj_4 PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("__exit__", 0); - /* "ssh2/sftp.pyx":424 + /* "ssh2/sftp.pyx":427 * * def __exit__(self, *args): * self.close() # <<<<<<<<<<<<<< * * def close(self): */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 424, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 427, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { @@ -6917,16 +6917,16 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_10__exit__(struct __pyx_obj_4 } } if (__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 424, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 427, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 424, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 427, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/sftp.pyx":423 + /* "ssh2/sftp.pyx":426 * return self * * def __exit__(self, *args): # <<<<<<<<<<<<<< @@ -6949,7 +6949,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_10__exit__(struct __pyx_obj_4 return __pyx_r; } -/* "ssh2/sftp.pyx":426 +/* "ssh2/sftp.pyx":429 * self.close() * * def close(self): # <<<<<<<<<<<<<< @@ -6979,7 +6979,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_12close(struct __pyx_obj_4ssh PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("close", 0); - /* "ssh2/sftp.pyx":428 + /* "ssh2/sftp.pyx":431 * def close(self): * cdef int rc * if self.closed == 0: # <<<<<<<<<<<<<< @@ -6989,7 +6989,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_12close(struct __pyx_obj_4ssh __pyx_t_1 = ((__pyx_v_self->closed == 0) != 0); if (__pyx_t_1) { - /* "ssh2/sftp.pyx":429 + /* "ssh2/sftp.pyx":432 * cdef int rc * if self.closed == 0: * with nogil: # <<<<<<<<<<<<<< @@ -7004,7 +7004,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_12close(struct __pyx_obj_4ssh #endif /*try:*/ { - /* "ssh2/sftp.pyx":430 + /* "ssh2/sftp.pyx":433 * if self.closed == 0: * with nogil: * rc = c_sftp.libssh2_sftp_close_handle(self._handle) # <<<<<<<<<<<<<< @@ -7014,7 +7014,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_12close(struct __pyx_obj_4ssh __pyx_v_rc = libssh2_sftp_close_handle(__pyx_v_self->_handle); } - /* "ssh2/sftp.pyx":429 + /* "ssh2/sftp.pyx":432 * cdef int rc * if self.closed == 0: * with nogil: # <<<<<<<<<<<<<< @@ -7033,7 +7033,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_12close(struct __pyx_obj_4ssh } } - /* "ssh2/sftp.pyx":431 + /* "ssh2/sftp.pyx":434 * with nogil: * rc = c_sftp.libssh2_sftp_close_handle(self._handle) * self.closed = 1 # <<<<<<<<<<<<<< @@ -7042,7 +7042,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_12close(struct __pyx_obj_4ssh */ __pyx_v_self->closed = 1; - /* "ssh2/sftp.pyx":428 + /* "ssh2/sftp.pyx":431 * def close(self): * cdef int rc * if self.closed == 0: # <<<<<<<<<<<<<< @@ -7052,7 +7052,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_12close(struct __pyx_obj_4ssh goto __pyx_L3; } - /* "ssh2/sftp.pyx":433 + /* "ssh2/sftp.pyx":436 * self.closed = 1 * else: * return # <<<<<<<<<<<<<< @@ -7066,7 +7066,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_12close(struct __pyx_obj_4ssh } __pyx_L3:; - /* "ssh2/sftp.pyx":434 + /* "ssh2/sftp.pyx":437 * else: * return * return rc # <<<<<<<<<<<<<< @@ -7074,13 +7074,13 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_12close(struct __pyx_obj_4ssh * def read(self, size_t buffer_maxlen=c_ssh2._LIBSSH2_CHANNEL_WINDOW_DEFAULT): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 434, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 437, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "ssh2/sftp.pyx":426 + /* "ssh2/sftp.pyx":429 * self.close() * * def close(self): # <<<<<<<<<<<<<< @@ -7099,7 +7099,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_12close(struct __pyx_obj_4ssh return __pyx_r; } -/* "ssh2/sftp.pyx":436 +/* "ssh2/sftp.pyx":439 * return rc * * def read(self, size_t buffer_maxlen=c_ssh2._LIBSSH2_CHANNEL_WINDOW_DEFAULT): # <<<<<<<<<<<<<< @@ -7136,7 +7136,7 @@ static PyObject *__pyx_pw_4ssh2_4sftp_10SFTPHandle_15read(PyObject *__pyx_v_self } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "read") < 0)) __PYX_ERR(0, 436, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "read") < 0)) __PYX_ERR(0, 439, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -7147,14 +7147,14 @@ static PyObject *__pyx_pw_4ssh2_4sftp_10SFTPHandle_15read(PyObject *__pyx_v_self } } if (values[0]) { - __pyx_v_buffer_maxlen = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_buffer_maxlen == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 436, __pyx_L3_error) + __pyx_v_buffer_maxlen = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_buffer_maxlen == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 439, __pyx_L3_error) } else { __pyx_v_buffer_maxlen = __pyx_k__5; } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("read", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 436, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("read", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 439, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.sftp.SFTPHandle.read", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -7186,7 +7186,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_14read(struct __pyx_obj_4ssh2 PyObject *__pyx_t_11 = NULL; __Pyx_RefNannySetupContext("read", 0); - /* "ssh2/sftp.pyx":440 + /* "ssh2/sftp.pyx":443 * cdef bytes buf * cdef char *cbuf * with nogil: # <<<<<<<<<<<<<< @@ -7201,7 +7201,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_14read(struct __pyx_obj_4ssh2 #endif /*try:*/ { - /* "ssh2/sftp.pyx":441 + /* "ssh2/sftp.pyx":444 * cdef char *cbuf * with nogil: * cbuf = malloc(sizeof(char)*buffer_maxlen) # <<<<<<<<<<<<<< @@ -7210,7 +7210,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_14read(struct __pyx_obj_4ssh2 */ __pyx_v_cbuf = ((char *)malloc(((sizeof(char)) * __pyx_v_buffer_maxlen))); - /* "ssh2/sftp.pyx":442 + /* "ssh2/sftp.pyx":445 * with nogil: * cbuf = malloc(sizeof(char)*buffer_maxlen) * if cbuf is NULL: # <<<<<<<<<<<<<< @@ -7220,7 +7220,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_14read(struct __pyx_obj_4ssh2 __pyx_t_1 = ((__pyx_v_cbuf == NULL) != 0); if (__pyx_t_1) { - /* "ssh2/sftp.pyx":443 + /* "ssh2/sftp.pyx":446 * cbuf = malloc(sizeof(char)*buffer_maxlen) * if cbuf is NULL: * with gil: # <<<<<<<<<<<<<< @@ -7233,17 +7233,17 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_14read(struct __pyx_obj_4ssh2 #endif /*try:*/ { - /* "ssh2/sftp.pyx":444 + /* "ssh2/sftp.pyx":447 * if cbuf is NULL: * with gil: * raise MemoryError # <<<<<<<<<<<<<< * rc = c_sftp.libssh2_sftp_read( * self._handle, cbuf, buffer_maxlen) */ - PyErr_NoMemory(); __PYX_ERR(0, 444, __pyx_L8_error) + PyErr_NoMemory(); __PYX_ERR(0, 447, __pyx_L8_error) } - /* "ssh2/sftp.pyx":443 + /* "ssh2/sftp.pyx":446 * cbuf = malloc(sizeof(char)*buffer_maxlen) * if cbuf is NULL: * with gil: # <<<<<<<<<<<<<< @@ -7260,7 +7260,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_14read(struct __pyx_obj_4ssh2 } } - /* "ssh2/sftp.pyx":442 + /* "ssh2/sftp.pyx":445 * with nogil: * cbuf = malloc(sizeof(char)*buffer_maxlen) * if cbuf is NULL: # <<<<<<<<<<<<<< @@ -7269,7 +7269,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_14read(struct __pyx_obj_4ssh2 */ } - /* "ssh2/sftp.pyx":445 + /* "ssh2/sftp.pyx":448 * with gil: * raise MemoryError * rc = c_sftp.libssh2_sftp_read( # <<<<<<<<<<<<<< @@ -7279,7 +7279,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_14read(struct __pyx_obj_4ssh2 __pyx_v_rc = libssh2_sftp_read(__pyx_v_self->_handle, __pyx_v_cbuf, __pyx_v_buffer_maxlen); } - /* "ssh2/sftp.pyx":440 + /* "ssh2/sftp.pyx":443 * cdef bytes buf * cdef char *cbuf * with nogil: # <<<<<<<<<<<<<< @@ -7305,7 +7305,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_14read(struct __pyx_obj_4ssh2 } } - /* "ssh2/sftp.pyx":447 + /* "ssh2/sftp.pyx":450 * rc = c_sftp.libssh2_sftp_read( * self._handle, cbuf, buffer_maxlen) * try: # <<<<<<<<<<<<<< @@ -7314,7 +7314,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_14read(struct __pyx_obj_4ssh2 */ /*try:*/ { - /* "ssh2/sftp.pyx":448 + /* "ssh2/sftp.pyx":451 * self._handle, cbuf, buffer_maxlen) * try: * if rc > 0: # <<<<<<<<<<<<<< @@ -7324,19 +7324,19 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_14read(struct __pyx_obj_4ssh2 __pyx_t_1 = ((__pyx_v_rc > 0) != 0); if (__pyx_t_1) { - /* "ssh2/sftp.pyx":449 + /* "ssh2/sftp.pyx":452 * try: * if rc > 0: * buf = cbuf[:rc] # <<<<<<<<<<<<<< * else: * buf = b'' */ - __pyx_t_2 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_cbuf + 0, __pyx_v_rc - 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 449, __pyx_L11_error) + __pyx_t_2 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_cbuf + 0, __pyx_v_rc - 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 452, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_buf = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "ssh2/sftp.pyx":448 + /* "ssh2/sftp.pyx":451 * self._handle, cbuf, buffer_maxlen) * try: * if rc > 0: # <<<<<<<<<<<<<< @@ -7346,7 +7346,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_14read(struct __pyx_obj_4ssh2 goto __pyx_L13; } - /* "ssh2/sftp.pyx":451 + /* "ssh2/sftp.pyx":454 * buf = cbuf[:rc] * else: * buf = b'' # <<<<<<<<<<<<<< @@ -7360,7 +7360,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_14read(struct __pyx_obj_4ssh2 __pyx_L13:; } - /* "ssh2/sftp.pyx":453 + /* "ssh2/sftp.pyx":456 * buf = b'' * finally: * free(cbuf) # <<<<<<<<<<<<<< @@ -7408,7 +7408,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_14read(struct __pyx_obj_4ssh2 __pyx_L12:; } - /* "ssh2/sftp.pyx":454 + /* "ssh2/sftp.pyx":457 * finally: * free(cbuf) * return buf # <<<<<<<<<<<<<< @@ -7420,7 +7420,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_14read(struct __pyx_obj_4ssh2 __pyx_r = __pyx_v_buf; goto __pyx_L0; - /* "ssh2/sftp.pyx":436 + /* "ssh2/sftp.pyx":439 * return rc * * def read(self, size_t buffer_maxlen=c_ssh2._LIBSSH2_CHANNEL_WINDOW_DEFAULT): # <<<<<<<<<<<<<< @@ -7440,7 +7440,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_14read(struct __pyx_obj_4ssh2 return __pyx_r; } -/* "ssh2/sftp.pyx":456 +/* "ssh2/sftp.pyx":459 * return buf * * def readdir_ex(self, char *buffer, size_t buffer_maxlen, # <<<<<<<<<<<<<< @@ -7489,29 +7489,29 @@ static PyObject *__pyx_pw_4ssh2_4sftp_10SFTPHandle_17readdir_ex(PyObject *__pyx_ case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_buffer_maxlen)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("readdir_ex", 1, 5, 5, 1); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("readdir_ex", 1, 5, 5, 1); __PYX_ERR(0, 459, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_longentry)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("readdir_ex", 1, 5, 5, 2); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("readdir_ex", 1, 5, 5, 2); __PYX_ERR(0, 459, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_longentry_maxlen)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("readdir_ex", 1, 5, 5, 3); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("readdir_ex", 1, 5, 5, 3); __PYX_ERR(0, 459, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_attrs)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("readdir_ex", 1, 5, 5, 4); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("readdir_ex", 1, 5, 5, 4); __PYX_ERR(0, 459, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "readdir_ex") < 0)) __PYX_ERR(0, 456, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "readdir_ex") < 0)) __PYX_ERR(0, 459, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 5) { goto __pyx_L5_argtuple_error; @@ -7522,21 +7522,21 @@ static PyObject *__pyx_pw_4ssh2_4sftp_10SFTPHandle_17readdir_ex(PyObject *__pyx_ values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[4] = PyTuple_GET_ITEM(__pyx_args, 4); } - __pyx_v_buffer = __Pyx_PyObject_AsWritableString(values[0]); if (unlikely((!__pyx_v_buffer) && PyErr_Occurred())) __PYX_ERR(0, 456, __pyx_L3_error) - __pyx_v_buffer_maxlen = __Pyx_PyInt_As_size_t(values[1]); if (unlikely((__pyx_v_buffer_maxlen == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 456, __pyx_L3_error) - __pyx_v_longentry = __Pyx_PyObject_AsWritableString(values[2]); if (unlikely((!__pyx_v_longentry) && PyErr_Occurred())) __PYX_ERR(0, 457, __pyx_L3_error) - __pyx_v_longentry_maxlen = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_longentry_maxlen == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 458, __pyx_L3_error) + __pyx_v_buffer = __Pyx_PyObject_AsWritableString(values[0]); if (unlikely((!__pyx_v_buffer) && PyErr_Occurred())) __PYX_ERR(0, 459, __pyx_L3_error) + __pyx_v_buffer_maxlen = __Pyx_PyInt_As_size_t(values[1]); if (unlikely((__pyx_v_buffer_maxlen == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 459, __pyx_L3_error) + __pyx_v_longentry = __Pyx_PyObject_AsWritableString(values[2]); if (unlikely((!__pyx_v_longentry) && PyErr_Occurred())) __PYX_ERR(0, 460, __pyx_L3_error) + __pyx_v_longentry_maxlen = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_longentry_maxlen == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 461, __pyx_L3_error) __pyx_v_attrs = ((struct __pyx_obj_4ssh2_4sftp_SFTPAttributes *)values[4]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("readdir_ex", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("readdir_ex", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 459, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.sftp.SFTPHandle.readdir_ex", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_attrs), __pyx_ptype_4ssh2_4sftp_SFTPAttributes, 1, "attrs", 0))) __PYX_ERR(0, 459, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_attrs), __pyx_ptype_4ssh2_4sftp_SFTPAttributes, 1, "attrs", 0))) __PYX_ERR(0, 462, __pyx_L1_error) __pyx_r = __pyx_pf_4ssh2_4sftp_10SFTPHandle_16readdir_ex(((struct __pyx_obj_4ssh2_4sftp_SFTPHandle *)__pyx_v_self), __pyx_v_buffer, __pyx_v_buffer_maxlen, __pyx_v_longentry, __pyx_v_longentry_maxlen, __pyx_v_attrs); /* function exit code */ @@ -7553,7 +7553,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_16readdir_ex(CYTHON_UNUSED st __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("readdir_ex", 0); - /* "ssh2/sftp.pyx":461 + /* "ssh2/sftp.pyx":464 * SFTPAttributes attrs): * cdef char *cbuf * raise NotImplementedError # <<<<<<<<<<<<<< @@ -7561,9 +7561,9 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_16readdir_ex(CYTHON_UNUSED st * def readdir(self, SFTPAttributes attrs, */ __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); - __PYX_ERR(0, 461, __pyx_L1_error) + __PYX_ERR(0, 464, __pyx_L1_error) - /* "ssh2/sftp.pyx":456 + /* "ssh2/sftp.pyx":459 * return buf * * def readdir_ex(self, char *buffer, size_t buffer_maxlen, # <<<<<<<<<<<<<< @@ -7580,7 +7580,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_16readdir_ex(CYTHON_UNUSED st return __pyx_r; } -/* "ssh2/sftp.pyx":463 +/* "ssh2/sftp.pyx":466 * raise NotImplementedError * * def readdir(self, SFTPAttributes attrs, # <<<<<<<<<<<<<< @@ -7624,7 +7624,7 @@ static PyObject *__pyx_pw_4ssh2_4sftp_10SFTPHandle_19readdir(PyObject *__pyx_v_s } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "readdir") < 0)) __PYX_ERR(0, 463, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "readdir") < 0)) __PYX_ERR(0, 466, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -7637,20 +7637,20 @@ static PyObject *__pyx_pw_4ssh2_4sftp_10SFTPHandle_19readdir(PyObject *__pyx_v_s } __pyx_v_attrs = ((struct __pyx_obj_4ssh2_4sftp_SFTPAttributes *)values[0]); if (values[1]) { - __pyx_v_buffer_maxlen = __Pyx_PyInt_As_size_t(values[1]); if (unlikely((__pyx_v_buffer_maxlen == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 464, __pyx_L3_error) + __pyx_v_buffer_maxlen = __Pyx_PyInt_As_size_t(values[1]); if (unlikely((__pyx_v_buffer_maxlen == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 467, __pyx_L3_error) } else { __pyx_v_buffer_maxlen = __pyx_k__7; } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("readdir", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 463, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("readdir", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 466, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.sftp.SFTPHandle.readdir", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_attrs), __pyx_ptype_4ssh2_4sftp_SFTPAttributes, 1, "attrs", 0))) __PYX_ERR(0, 463, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_attrs), __pyx_ptype_4ssh2_4sftp_SFTPAttributes, 1, "attrs", 0))) __PYX_ERR(0, 466, __pyx_L1_error) __pyx_r = __pyx_pf_4ssh2_4sftp_10SFTPHandle_18readdir(((struct __pyx_obj_4ssh2_4sftp_SFTPHandle *)__pyx_v_self), __pyx_v_attrs, __pyx_v_buffer_maxlen); /* function exit code */ @@ -7667,7 +7667,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_18readdir(CYTHON_UNUSED struc __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("readdir", 0); - /* "ssh2/sftp.pyx":466 + /* "ssh2/sftp.pyx":469 * size_t buffer_maxlen=c_ssh2._LIBSSH2_CHANNEL_WINDOW_DEFAULT): * cdef char *cbuf * raise NotImplementedError # <<<<<<<<<<<<<< @@ -7675,9 +7675,9 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_18readdir(CYTHON_UNUSED struc * def write(self, bytes buf): */ __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); - __PYX_ERR(0, 466, __pyx_L1_error) + __PYX_ERR(0, 469, __pyx_L1_error) - /* "ssh2/sftp.pyx":463 + /* "ssh2/sftp.pyx":466 * raise NotImplementedError * * def readdir(self, SFTPAttributes attrs, # <<<<<<<<<<<<<< @@ -7694,7 +7694,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_18readdir(CYTHON_UNUSED struc return __pyx_r; } -/* "ssh2/sftp.pyx":468 +/* "ssh2/sftp.pyx":471 * raise NotImplementedError * * def write(self, bytes buf): # <<<<<<<<<<<<<< @@ -7709,7 +7709,7 @@ static PyObject *__pyx_pw_4ssh2_4sftp_10SFTPHandle_21write(PyObject *__pyx_v_sel PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("write (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_buf), (&PyBytes_Type), 1, "buf", 1))) __PYX_ERR(0, 468, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_buf), (&PyBytes_Type), 1, "buf", 1))) __PYX_ERR(0, 471, __pyx_L1_error) __pyx_r = __pyx_pf_4ssh2_4sftp_10SFTPHandle_20write(((struct __pyx_obj_4ssh2_4sftp_SFTPHandle *)__pyx_v_self), ((PyObject*)__pyx_v_buf)); /* function exit code */ @@ -7732,7 +7732,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_20write(struct __pyx_obj_4ssh PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("write", 0); - /* "ssh2/sftp.pyx":469 + /* "ssh2/sftp.pyx":472 * * def write(self, bytes buf): * cdef size_t _size = len(buf) # <<<<<<<<<<<<<< @@ -7741,22 +7741,22 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_20write(struct __pyx_obj_4ssh */ if (unlikely(__pyx_v_buf == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 469, __pyx_L1_error) + __PYX_ERR(0, 472, __pyx_L1_error) } - __pyx_t_1 = PyBytes_GET_SIZE(__pyx_v_buf); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 469, __pyx_L1_error) + __pyx_t_1 = PyBytes_GET_SIZE(__pyx_v_buf); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 472, __pyx_L1_error) __pyx_v__size = __pyx_t_1; - /* "ssh2/sftp.pyx":470 + /* "ssh2/sftp.pyx":473 * def write(self, bytes buf): * cdef size_t _size = len(buf) * cdef char *cbuf = buf # <<<<<<<<<<<<<< * cdef ssize_t rc * with nogil: */ - __pyx_t_2 = __Pyx_PyObject_AsWritableString(__pyx_v_buf); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 470, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_AsWritableString(__pyx_v_buf); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 473, __pyx_L1_error) __pyx_v_cbuf = __pyx_t_2; - /* "ssh2/sftp.pyx":472 + /* "ssh2/sftp.pyx":475 * cdef char *cbuf = buf * cdef ssize_t rc * with nogil: # <<<<<<<<<<<<<< @@ -7771,7 +7771,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_20write(struct __pyx_obj_4ssh #endif /*try:*/ { - /* "ssh2/sftp.pyx":473 + /* "ssh2/sftp.pyx":476 * cdef ssize_t rc * with nogil: * rc = c_sftp.libssh2_sftp_write(self._handle, cbuf, _size) # <<<<<<<<<<<<<< @@ -7781,7 +7781,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_20write(struct __pyx_obj_4ssh __pyx_v_rc = libssh2_sftp_write(__pyx_v_self->_handle, __pyx_v_cbuf, __pyx_v__size); } - /* "ssh2/sftp.pyx":472 + /* "ssh2/sftp.pyx":475 * cdef char *cbuf = buf * cdef ssize_t rc * with nogil: # <<<<<<<<<<<<<< @@ -7800,7 +7800,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_20write(struct __pyx_obj_4ssh } } - /* "ssh2/sftp.pyx":474 + /* "ssh2/sftp.pyx":477 * with nogil: * rc = c_sftp.libssh2_sftp_write(self._handle, cbuf, _size) * return rc # <<<<<<<<<<<<<< @@ -7808,13 +7808,13 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_20write(struct __pyx_obj_4ssh * def fsync(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_rc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 474, __pyx_L1_error) + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_rc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 477, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - /* "ssh2/sftp.pyx":468 + /* "ssh2/sftp.pyx":471 * raise NotImplementedError * * def write(self, bytes buf): # <<<<<<<<<<<<<< @@ -7833,7 +7833,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_20write(struct __pyx_obj_4ssh return __pyx_r; } -/* "ssh2/sftp.pyx":476 +/* "ssh2/sftp.pyx":479 * return rc * * def fsync(self): # <<<<<<<<<<<<<< @@ -7860,7 +7860,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_22fsync(CYTHON_UNUSED struct __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("fsync", 0); - /* "ssh2/sftp.pyx":477 + /* "ssh2/sftp.pyx":480 * * def fsync(self): * raise NotImplementedError # <<<<<<<<<<<<<< @@ -7868,9 +7868,9 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_22fsync(CYTHON_UNUSED struct * def seek(self, size_t offset): */ __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); - __PYX_ERR(0, 477, __pyx_L1_error) + __PYX_ERR(0, 480, __pyx_L1_error) - /* "ssh2/sftp.pyx":476 + /* "ssh2/sftp.pyx":479 * return rc * * def fsync(self): # <<<<<<<<<<<<<< @@ -7887,7 +7887,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_22fsync(CYTHON_UNUSED struct return __pyx_r; } -/* "ssh2/sftp.pyx":479 +/* "ssh2/sftp.pyx":482 * raise NotImplementedError * * def seek(self, size_t offset): # <<<<<<<<<<<<<< @@ -7904,7 +7904,7 @@ static PyObject *__pyx_pw_4ssh2_4sftp_10SFTPHandle_25seek(PyObject *__pyx_v_self __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("seek (wrapper)", 0); assert(__pyx_arg_offset); { - __pyx_v_offset = __Pyx_PyInt_As_size_t(__pyx_arg_offset); if (unlikely((__pyx_v_offset == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 479, __pyx_L3_error) + __pyx_v_offset = __Pyx_PyInt_As_size_t(__pyx_arg_offset); if (unlikely((__pyx_v_offset == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 482, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -7924,7 +7924,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_24seek(struct __pyx_obj_4ssh2 __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("seek", 0); - /* "ssh2/sftp.pyx":480 + /* "ssh2/sftp.pyx":483 * * def seek(self, size_t offset): * with nogil: # <<<<<<<<<<<<<< @@ -7939,7 +7939,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_24seek(struct __pyx_obj_4ssh2 #endif /*try:*/ { - /* "ssh2/sftp.pyx":481 + /* "ssh2/sftp.pyx":484 * def seek(self, size_t offset): * with nogil: * c_sftp.libssh2_sftp_seek(self._handle, offset) # <<<<<<<<<<<<<< @@ -7949,7 +7949,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_24seek(struct __pyx_obj_4ssh2 libssh2_sftp_seek(__pyx_v_self->_handle, __pyx_v_offset); } - /* "ssh2/sftp.pyx":480 + /* "ssh2/sftp.pyx":483 * * def seek(self, size_t offset): * with nogil: # <<<<<<<<<<<<<< @@ -7968,7 +7968,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_24seek(struct __pyx_obj_4ssh2 } } - /* "ssh2/sftp.pyx":479 + /* "ssh2/sftp.pyx":482 * raise NotImplementedError * * def seek(self, size_t offset): # <<<<<<<<<<<<<< @@ -7983,7 +7983,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_24seek(struct __pyx_obj_4ssh2 return __pyx_r; } -/* "ssh2/sftp.pyx":483 +/* "ssh2/sftp.pyx":486 * c_sftp.libssh2_sftp_seek(self._handle, offset) * * def seek64(self, uint64_t offset): # <<<<<<<<<<<<<< @@ -8000,7 +8000,7 @@ static PyObject *__pyx_pw_4ssh2_4sftp_10SFTPHandle_27seek64(PyObject *__pyx_v_se __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("seek64 (wrapper)", 0); assert(__pyx_arg_offset); { - __pyx_v_offset = __Pyx_PyInt_As_uint64_t(__pyx_arg_offset); if (unlikely((__pyx_v_offset == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 483, __pyx_L3_error) + __pyx_v_offset = __Pyx_PyInt_As_uint64_t(__pyx_arg_offset); if (unlikely((__pyx_v_offset == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 486, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -8020,7 +8020,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_26seek64(struct __pyx_obj_4ss __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("seek64", 0); - /* "ssh2/sftp.pyx":484 + /* "ssh2/sftp.pyx":487 * * def seek64(self, uint64_t offset): * with nogil: # <<<<<<<<<<<<<< @@ -8035,7 +8035,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_26seek64(struct __pyx_obj_4ss #endif /*try:*/ { - /* "ssh2/sftp.pyx":485 + /* "ssh2/sftp.pyx":488 * def seek64(self, uint64_t offset): * with nogil: * c_sftp.libssh2_sftp_seek64(self._handle, offset) # <<<<<<<<<<<<<< @@ -8045,7 +8045,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_26seek64(struct __pyx_obj_4ss libssh2_sftp_seek64(__pyx_v_self->_handle, __pyx_v_offset); } - /* "ssh2/sftp.pyx":484 + /* "ssh2/sftp.pyx":487 * * def seek64(self, uint64_t offset): * with nogil: # <<<<<<<<<<<<<< @@ -8064,7 +8064,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_26seek64(struct __pyx_obj_4ss } } - /* "ssh2/sftp.pyx":483 + /* "ssh2/sftp.pyx":486 * c_sftp.libssh2_sftp_seek(self._handle, offset) * * def seek64(self, uint64_t offset): # <<<<<<<<<<<<<< @@ -8079,7 +8079,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_26seek64(struct __pyx_obj_4ss return __pyx_r; } -/* "ssh2/sftp.pyx":487 +/* "ssh2/sftp.pyx":490 * c_sftp.libssh2_sftp_seek64(self._handle, offset) * * def rewind(self): # <<<<<<<<<<<<<< @@ -8106,7 +8106,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_28rewind(struct __pyx_obj_4ss __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("rewind", 0); - /* "ssh2/sftp.pyx":488 + /* "ssh2/sftp.pyx":491 * * def rewind(self): * with nogil: # <<<<<<<<<<<<<< @@ -8121,7 +8121,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_28rewind(struct __pyx_obj_4ss #endif /*try:*/ { - /* "ssh2/sftp.pyx":489 + /* "ssh2/sftp.pyx":492 * def rewind(self): * with nogil: * c_sftp.libssh2_sftp_rewind(self._handle) # <<<<<<<<<<<<<< @@ -8131,7 +8131,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_28rewind(struct __pyx_obj_4ss libssh2_sftp_rewind(__pyx_v_self->_handle); } - /* "ssh2/sftp.pyx":488 + /* "ssh2/sftp.pyx":491 * * def rewind(self): * with nogil: # <<<<<<<<<<<<<< @@ -8150,7 +8150,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_28rewind(struct __pyx_obj_4ss } } - /* "ssh2/sftp.pyx":487 + /* "ssh2/sftp.pyx":490 * c_sftp.libssh2_sftp_seek64(self._handle, offset) * * def rewind(self): # <<<<<<<<<<<<<< @@ -8165,7 +8165,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_28rewind(struct __pyx_obj_4ss return __pyx_r; } -/* "ssh2/sftp.pyx":491 +/* "ssh2/sftp.pyx":494 * c_sftp.libssh2_sftp_rewind(self._handle) * * def tell(self): # <<<<<<<<<<<<<< @@ -8194,7 +8194,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_30tell(struct __pyx_obj_4ssh2 PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("tell", 0); - /* "ssh2/sftp.pyx":493 + /* "ssh2/sftp.pyx":496 * def tell(self): * cdef size_t rc * with nogil: # <<<<<<<<<<<<<< @@ -8209,7 +8209,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_30tell(struct __pyx_obj_4ssh2 #endif /*try:*/ { - /* "ssh2/sftp.pyx":494 + /* "ssh2/sftp.pyx":497 * cdef size_t rc * with nogil: * rc = c_sftp.libssh2_sftp_tell(self._handle) # <<<<<<<<<<<<<< @@ -8219,7 +8219,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_30tell(struct __pyx_obj_4ssh2 __pyx_v_rc = libssh2_sftp_tell(__pyx_v_self->_handle); } - /* "ssh2/sftp.pyx":493 + /* "ssh2/sftp.pyx":496 * def tell(self): * cdef size_t rc * with nogil: # <<<<<<<<<<<<<< @@ -8238,7 +8238,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_30tell(struct __pyx_obj_4ssh2 } } - /* "ssh2/sftp.pyx":495 + /* "ssh2/sftp.pyx":498 * with nogil: * rc = c_sftp.libssh2_sftp_tell(self._handle) * return rc # <<<<<<<<<<<<<< @@ -8246,13 +8246,13 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_30tell(struct __pyx_obj_4ssh2 * def tell64(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 495, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 498, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/sftp.pyx":491 + /* "ssh2/sftp.pyx":494 * c_sftp.libssh2_sftp_rewind(self._handle) * * def tell(self): # <<<<<<<<<<<<<< @@ -8271,7 +8271,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_30tell(struct __pyx_obj_4ssh2 return __pyx_r; } -/* "ssh2/sftp.pyx":497 +/* "ssh2/sftp.pyx":500 * return rc * * def tell64(self): # <<<<<<<<<<<<<< @@ -8300,7 +8300,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_32tell64(struct __pyx_obj_4ss PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("tell64", 0); - /* "ssh2/sftp.pyx":499 + /* "ssh2/sftp.pyx":502 * def tell64(self): * cdef uint64_t rc * with nogil: # <<<<<<<<<<<<<< @@ -8315,7 +8315,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_32tell64(struct __pyx_obj_4ss #endif /*try:*/ { - /* "ssh2/sftp.pyx":500 + /* "ssh2/sftp.pyx":503 * cdef uint64_t rc * with nogil: * rc = c_sftp.libssh2_sftp_tell(self._handle) # <<<<<<<<<<<<<< @@ -8325,7 +8325,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_32tell64(struct __pyx_obj_4ss __pyx_v_rc = libssh2_sftp_tell(__pyx_v_self->_handle); } - /* "ssh2/sftp.pyx":499 + /* "ssh2/sftp.pyx":502 * def tell64(self): * cdef uint64_t rc * with nogil: # <<<<<<<<<<<<<< @@ -8344,7 +8344,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_32tell64(struct __pyx_obj_4ss } } - /* "ssh2/sftp.pyx":501 + /* "ssh2/sftp.pyx":504 * with nogil: * rc = c_sftp.libssh2_sftp_tell(self._handle) * return rc # <<<<<<<<<<<<<< @@ -8352,13 +8352,13 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_32tell64(struct __pyx_obj_4ss * def fstat_ex(self, SFTPAttributes attrs, int setstat): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_uint64_t(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 501, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint64_t(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 504, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/sftp.pyx":497 + /* "ssh2/sftp.pyx":500 * return rc * * def tell64(self): # <<<<<<<<<<<<<< @@ -8377,7 +8377,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_32tell64(struct __pyx_obj_4ss return __pyx_r; } -/* "ssh2/sftp.pyx":503 +/* "ssh2/sftp.pyx":506 * return rc * * def fstat_ex(self, SFTPAttributes attrs, int setstat): # <<<<<<<<<<<<<< @@ -8417,11 +8417,11 @@ static PyObject *__pyx_pw_4ssh2_4sftp_10SFTPHandle_35fstat_ex(PyObject *__pyx_v_ case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_setstat)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("fstat_ex", 1, 2, 2, 1); __PYX_ERR(0, 503, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("fstat_ex", 1, 2, 2, 1); __PYX_ERR(0, 506, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fstat_ex") < 0)) __PYX_ERR(0, 503, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fstat_ex") < 0)) __PYX_ERR(0, 506, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -8430,17 +8430,17 @@ static PyObject *__pyx_pw_4ssh2_4sftp_10SFTPHandle_35fstat_ex(PyObject *__pyx_v_ values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_attrs = ((struct __pyx_obj_4ssh2_4sftp_SFTPAttributes *)values[0]); - __pyx_v_setstat = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_setstat == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 503, __pyx_L3_error) + __pyx_v_setstat = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_setstat == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 506, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("fstat_ex", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 503, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("fstat_ex", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 506, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.sftp.SFTPHandle.fstat_ex", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_attrs), __pyx_ptype_4ssh2_4sftp_SFTPAttributes, 1, "attrs", 0))) __PYX_ERR(0, 503, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_attrs), __pyx_ptype_4ssh2_4sftp_SFTPAttributes, 1, "attrs", 0))) __PYX_ERR(0, 506, __pyx_L1_error) __pyx_r = __pyx_pf_4ssh2_4sftp_10SFTPHandle_34fstat_ex(((struct __pyx_obj_4ssh2_4sftp_SFTPHandle *)__pyx_v_self), __pyx_v_attrs, __pyx_v_setstat); /* function exit code */ @@ -8459,7 +8459,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_34fstat_ex(struct __pyx_obj_4 PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("fstat_ex", 0); - /* "ssh2/sftp.pyx":505 + /* "ssh2/sftp.pyx":508 * def fstat_ex(self, SFTPAttributes attrs, int setstat): * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -8474,7 +8474,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_34fstat_ex(struct __pyx_obj_4 #endif /*try:*/ { - /* "ssh2/sftp.pyx":506 + /* "ssh2/sftp.pyx":509 * cdef int rc * with nogil: * rc = c_sftp.libssh2_sftp_fstat_ex( # <<<<<<<<<<<<<< @@ -8484,7 +8484,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_34fstat_ex(struct __pyx_obj_4 __pyx_v_rc = libssh2_sftp_fstat_ex(__pyx_v_self->_handle, __pyx_v_attrs->_attrs, __pyx_v_setstat); } - /* "ssh2/sftp.pyx":505 + /* "ssh2/sftp.pyx":508 * def fstat_ex(self, SFTPAttributes attrs, int setstat): * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -8503,7 +8503,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_34fstat_ex(struct __pyx_obj_4 } } - /* "ssh2/sftp.pyx":508 + /* "ssh2/sftp.pyx":511 * rc = c_sftp.libssh2_sftp_fstat_ex( * self._handle, attrs._attrs, setstat) * return rc # <<<<<<<<<<<<<< @@ -8511,13 +8511,13 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_34fstat_ex(struct __pyx_obj_4 * def fstat(self, SFTPAttributes attrs): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 508, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 511, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/sftp.pyx":503 + /* "ssh2/sftp.pyx":506 * return rc * * def fstat_ex(self, SFTPAttributes attrs, int setstat): # <<<<<<<<<<<<<< @@ -8536,7 +8536,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_34fstat_ex(struct __pyx_obj_4 return __pyx_r; } -/* "ssh2/sftp.pyx":510 +/* "ssh2/sftp.pyx":513 * return rc * * def fstat(self, SFTPAttributes attrs): # <<<<<<<<<<<<<< @@ -8551,7 +8551,7 @@ static PyObject *__pyx_pw_4ssh2_4sftp_10SFTPHandle_37fstat(PyObject *__pyx_v_sel PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("fstat (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_attrs), __pyx_ptype_4ssh2_4sftp_SFTPAttributes, 1, "attrs", 0))) __PYX_ERR(0, 510, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_attrs), __pyx_ptype_4ssh2_4sftp_SFTPAttributes, 1, "attrs", 0))) __PYX_ERR(0, 513, __pyx_L1_error) __pyx_r = __pyx_pf_4ssh2_4sftp_10SFTPHandle_36fstat(((struct __pyx_obj_4ssh2_4sftp_SFTPHandle *)__pyx_v_self), ((struct __pyx_obj_4ssh2_4sftp_SFTPAttributes *)__pyx_v_attrs)); /* function exit code */ @@ -8570,7 +8570,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_36fstat(struct __pyx_obj_4ssh PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("fstat", 0); - /* "ssh2/sftp.pyx":512 + /* "ssh2/sftp.pyx":515 * def fstat(self, SFTPAttributes attrs): * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -8585,7 +8585,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_36fstat(struct __pyx_obj_4ssh #endif /*try:*/ { - /* "ssh2/sftp.pyx":513 + /* "ssh2/sftp.pyx":516 * cdef int rc * with nogil: * rc = c_sftp.libssh2_sftp_fstat(self._handle, attrs._attrs) # <<<<<<<<<<<<<< @@ -8595,7 +8595,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_36fstat(struct __pyx_obj_4ssh __pyx_v_rc = libssh2_sftp_fstat(__pyx_v_self->_handle, __pyx_v_attrs->_attrs); } - /* "ssh2/sftp.pyx":512 + /* "ssh2/sftp.pyx":515 * def fstat(self, SFTPAttributes attrs): * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -8614,7 +8614,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_36fstat(struct __pyx_obj_4ssh } } - /* "ssh2/sftp.pyx":514 + /* "ssh2/sftp.pyx":517 * with nogil: * rc = c_sftp.libssh2_sftp_fstat(self._handle, attrs._attrs) * return rc # <<<<<<<<<<<<<< @@ -8622,13 +8622,13 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_36fstat(struct __pyx_obj_4ssh * def fsetstat(self, SFTPAttributes attrs): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 514, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 517, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/sftp.pyx":510 + /* "ssh2/sftp.pyx":513 * return rc * * def fstat(self, SFTPAttributes attrs): # <<<<<<<<<<<<<< @@ -8647,7 +8647,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_36fstat(struct __pyx_obj_4ssh return __pyx_r; } -/* "ssh2/sftp.pyx":516 +/* "ssh2/sftp.pyx":519 * return rc * * def fsetstat(self, SFTPAttributes attrs): # <<<<<<<<<<<<<< @@ -8662,7 +8662,7 @@ static PyObject *__pyx_pw_4ssh2_4sftp_10SFTPHandle_39fsetstat(PyObject *__pyx_v_ PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("fsetstat (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_attrs), __pyx_ptype_4ssh2_4sftp_SFTPAttributes, 1, "attrs", 0))) __PYX_ERR(0, 516, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_attrs), __pyx_ptype_4ssh2_4sftp_SFTPAttributes, 1, "attrs", 0))) __PYX_ERR(0, 519, __pyx_L1_error) __pyx_r = __pyx_pf_4ssh2_4sftp_10SFTPHandle_38fsetstat(((struct __pyx_obj_4ssh2_4sftp_SFTPHandle *)__pyx_v_self), ((struct __pyx_obj_4ssh2_4sftp_SFTPAttributes *)__pyx_v_attrs)); /* function exit code */ @@ -8681,7 +8681,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_38fsetstat(struct __pyx_obj_4 PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("fsetstat", 0); - /* "ssh2/sftp.pyx":518 + /* "ssh2/sftp.pyx":521 * def fsetstat(self, SFTPAttributes attrs): * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -8696,7 +8696,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_38fsetstat(struct __pyx_obj_4 #endif /*try:*/ { - /* "ssh2/sftp.pyx":519 + /* "ssh2/sftp.pyx":522 * cdef int rc * with nogil: * rc = c_sftp.libssh2_sftp_fsetstat(self._handle, attrs._attrs) # <<<<<<<<<<<<<< @@ -8705,7 +8705,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_38fsetstat(struct __pyx_obj_4 __pyx_v_rc = libssh2_sftp_fsetstat(__pyx_v_self->_handle, __pyx_v_attrs->_attrs); } - /* "ssh2/sftp.pyx":518 + /* "ssh2/sftp.pyx":521 * def fsetstat(self, SFTPAttributes attrs): * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -8724,19 +8724,19 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_38fsetstat(struct __pyx_obj_4 } } - /* "ssh2/sftp.pyx":520 + /* "ssh2/sftp.pyx":523 * with nogil: * rc = c_sftp.libssh2_sftp_fsetstat(self._handle, attrs._attrs) * return rc # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 523, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/sftp.pyx":516 + /* "ssh2/sftp.pyx":519 * return rc * * def fsetstat(self, SFTPAttributes attrs): # <<<<<<<<<<<<<< @@ -9424,10 +9424,10 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {0, 0, 0, 0, 0, 0, 0} }; static int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) __PYX_ERR(0, 181, __pyx_L1_error) - __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(0, 282, __pyx_L1_error) + __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) __PYX_ERR(0, 184, __pyx_L1_error) + __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(0, 285, __pyx_L1_error) __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error) - __pyx_builtin_StopIteration = __Pyx_GetBuiltinName(__pyx_n_s_StopIteration); if (!__pyx_builtin_StopIteration) __PYX_ERR(0, 417, __pyx_L1_error) + __pyx_builtin_StopIteration = __Pyx_GetBuiltinName(__pyx_n_s_StopIteration); if (!__pyx_builtin_StopIteration) __PYX_ERR(0, 420, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; @@ -9596,20 +9596,20 @@ PyMODINIT_FUNC PyInit_sftp(void) if (__Pyx_ExportFunction("PySFTPHandle", (void (*)(void))__pyx_f_4ssh2_4sftp_PySFTPHandle, "PyObject *(LIBSSH2_SFTP_HANDLE *, struct __pyx_obj_4ssh2_4sftp_SFTP *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PySFTP", (void (*)(void))__pyx_f_4ssh2_4sftp_PySFTP, "PyObject *(LIBSSH2_SFTP *, struct __pyx_obj_4ssh2_7session_Session *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Type init code ---*/ - if (PyType_Ready(&__pyx_type_4ssh2_4sftp_SFTP) < 0) __PYX_ERR(0, 66, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_4ssh2_4sftp_SFTP) < 0) __PYX_ERR(0, 69, __pyx_L1_error) __pyx_type_4ssh2_4sftp_SFTP.tp_print = 0; - if (PyObject_SetAttrString(__pyx_m, "SFTP", (PyObject *)&__pyx_type_4ssh2_4sftp_SFTP) < 0) __PYX_ERR(0, 66, __pyx_L1_error) - if (__Pyx_setup_reduce((PyObject*)&__pyx_type_4ssh2_4sftp_SFTP) < 0) __PYX_ERR(0, 66, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "SFTP", (PyObject *)&__pyx_type_4ssh2_4sftp_SFTP) < 0) __PYX_ERR(0, 69, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_4ssh2_4sftp_SFTP) < 0) __PYX_ERR(0, 69, __pyx_L1_error) __pyx_ptype_4ssh2_4sftp_SFTP = &__pyx_type_4ssh2_4sftp_SFTP; - if (PyType_Ready(&__pyx_type_4ssh2_4sftp_SFTPAttributes) < 0) __PYX_ERR(0, 316, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_4ssh2_4sftp_SFTPAttributes) < 0) __PYX_ERR(0, 319, __pyx_L1_error) __pyx_type_4ssh2_4sftp_SFTPAttributes.tp_print = 0; - if (PyObject_SetAttrString(__pyx_m, "SFTPAttributes", (PyObject *)&__pyx_type_4ssh2_4sftp_SFTPAttributes) < 0) __PYX_ERR(0, 316, __pyx_L1_error) - if (__Pyx_setup_reduce((PyObject*)&__pyx_type_4ssh2_4sftp_SFTPAttributes) < 0) __PYX_ERR(0, 316, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "SFTPAttributes", (PyObject *)&__pyx_type_4ssh2_4sftp_SFTPAttributes) < 0) __PYX_ERR(0, 319, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_4ssh2_4sftp_SFTPAttributes) < 0) __PYX_ERR(0, 319, __pyx_L1_error) __pyx_ptype_4ssh2_4sftp_SFTPAttributes = &__pyx_type_4ssh2_4sftp_SFTPAttributes; - if (PyType_Ready(&__pyx_type_4ssh2_4sftp_SFTPHandle) < 0) __PYX_ERR(0, 395, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_4ssh2_4sftp_SFTPHandle) < 0) __PYX_ERR(0, 398, __pyx_L1_error) __pyx_type_4ssh2_4sftp_SFTPHandle.tp_print = 0; - if (PyObject_SetAttrString(__pyx_m, "SFTPHandle", (PyObject *)&__pyx_type_4ssh2_4sftp_SFTPHandle) < 0) __PYX_ERR(0, 395, __pyx_L1_error) - if (__Pyx_setup_reduce((PyObject*)&__pyx_type_4ssh2_4sftp_SFTPHandle) < 0) __PYX_ERR(0, 395, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "SFTPHandle", (PyObject *)&__pyx_type_4ssh2_4sftp_SFTPHandle) < 0) __PYX_ERR(0, 398, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_4ssh2_4sftp_SFTPHandle) < 0) __PYX_ERR(0, 398, __pyx_L1_error) __pyx_ptype_4ssh2_4sftp_SFTPHandle = &__pyx_type_4ssh2_4sftp_SFTPHandle; /*--- Type import code ---*/ __pyx_ptype_4ssh2_7session_Session = __Pyx_ImportType("ssh2.session", "Session", sizeof(struct __pyx_obj_4ssh2_7session_Session), 1); if (unlikely(!__pyx_ptype_4ssh2_7session_Session)) __PYX_ERR(2, 20, __pyx_L1_error) @@ -9617,7 +9617,7 @@ PyMODINIT_FUNC PyInit_sftp(void) __pyx_ptype_4ssh2_7channel_Channel = __Pyx_ImportType("ssh2.channel", "Channel", sizeof(struct __pyx_obj_4ssh2_7channel_Channel), 1); if (unlikely(!__pyx_ptype_4ssh2_7channel_Channel)) __PYX_ERR(3, 24, __pyx_L1_error) __pyx_ptype_4ssh2_10exceptions_AgentError = __Pyx_ImportType("ssh2.exceptions", "AgentError", sizeof(struct __pyx_obj_4ssh2_10exceptions_AgentError), 1); if (unlikely(!__pyx_ptype_4ssh2_10exceptions_AgentError)) __PYX_ERR(4, 17, __pyx_L1_error) __pyx_ptype_4ssh2_10exceptions_AuthenticationError = __Pyx_ImportType("ssh2.exceptions", "AuthenticationError", sizeof(struct __pyx_obj_4ssh2_10exceptions_AuthenticationError), 1); if (unlikely(!__pyx_ptype_4ssh2_10exceptions_AuthenticationError)) __PYX_ERR(4, 21, __pyx_L1_error) - __pyx_ptype_4ssh2_10exceptions_AgentConnectError = __Pyx_ImportType("ssh2.exceptions", "AgentConnectError", sizeof(struct __pyx_obj_4ssh2_10exceptions_AgentConnectError), 1); if (unlikely(!__pyx_ptype_4ssh2_10exceptions_AgentConnectError)) __PYX_ERR(4, 25, __pyx_L1_error) + __pyx_ptype_4ssh2_10exceptions_AgentConnectionError = __Pyx_ImportType("ssh2.exceptions", "AgentConnectionError", sizeof(struct __pyx_obj_4ssh2_10exceptions_AgentConnectionError), 1); if (unlikely(!__pyx_ptype_4ssh2_10exceptions_AgentConnectionError)) __PYX_ERR(4, 25, __pyx_L1_error) __pyx_ptype_4ssh2_10exceptions_AgentAuthenticationError = __Pyx_ImportType("ssh2.exceptions", "AgentAuthenticationError", sizeof(struct __pyx_obj_4ssh2_10exceptions_AgentAuthenticationError), 1); if (unlikely(!__pyx_ptype_4ssh2_10exceptions_AgentAuthenticationError)) __PYX_ERR(4, 29, __pyx_L1_error) __pyx_ptype_4ssh2_10exceptions_AgentListIdentitiesError = __Pyx_ImportType("ssh2.exceptions", "AgentListIdentitiesError", sizeof(struct __pyx_obj_4ssh2_10exceptions_AgentListIdentitiesError), 1); if (unlikely(!__pyx_ptype_4ssh2_10exceptions_AgentListIdentitiesError)) __PYX_ERR(4, 33, __pyx_L1_error) __pyx_ptype_4ssh2_10exceptions_AgentGetIdentityError = __Pyx_ImportType("ssh2.exceptions", "AgentGetIdentityError", sizeof(struct __pyx_obj_4ssh2_10exceptions_AgentGetIdentityError), 1); if (unlikely(!__pyx_ptype_4ssh2_10exceptions_AgentGetIdentityError)) __PYX_ERR(4, 37, __pyx_L1_error) @@ -9640,223 +9640,223 @@ PyMODINIT_FUNC PyInit_sftp(void) if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif - /* "ssh2/sftp.pyx":29 + /* "ssh2/sftp.pyx":32 * * # File Transfer Flags * LIBSSH2_FXF_READ = c_sftp.LIBSSH2_FXF_READ # <<<<<<<<<<<<<< * LIBSSH2_FXF_WRITE = c_sftp.LIBSSH2_FXF_WRITE * LIBSSH2_FXF_APPEND = c_sftp.LIBSSH2_FXF_APPEND */ - __pyx_t_3 = __Pyx_PyInt_From_int(LIBSSH2_FXF_READ); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 29, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(LIBSSH2_FXF_READ); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_FXF_READ, __pyx_t_3) < 0) __PYX_ERR(0, 29, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_FXF_READ, __pyx_t_3) < 0) __PYX_ERR(0, 32, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "ssh2/sftp.pyx":30 + /* "ssh2/sftp.pyx":33 * # File Transfer Flags * LIBSSH2_FXF_READ = c_sftp.LIBSSH2_FXF_READ * LIBSSH2_FXF_WRITE = c_sftp.LIBSSH2_FXF_WRITE # <<<<<<<<<<<<<< * LIBSSH2_FXF_APPEND = c_sftp.LIBSSH2_FXF_APPEND * LIBSSH2_FXF_CREAT = c_sftp.LIBSSH2_FXF_CREAT */ - __pyx_t_3 = __Pyx_PyInt_From_int(LIBSSH2_FXF_WRITE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 30, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(LIBSSH2_FXF_WRITE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_FXF_WRITE, __pyx_t_3) < 0) __PYX_ERR(0, 30, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_FXF_WRITE, __pyx_t_3) < 0) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "ssh2/sftp.pyx":31 + /* "ssh2/sftp.pyx":34 * LIBSSH2_FXF_READ = c_sftp.LIBSSH2_FXF_READ * LIBSSH2_FXF_WRITE = c_sftp.LIBSSH2_FXF_WRITE * LIBSSH2_FXF_APPEND = c_sftp.LIBSSH2_FXF_APPEND # <<<<<<<<<<<<<< * LIBSSH2_FXF_CREAT = c_sftp.LIBSSH2_FXF_CREAT * LIBSSH2_FXF_TRUNC = c_sftp.LIBSSH2_FXF_TRUNC */ - __pyx_t_3 = __Pyx_PyInt_From_int(LIBSSH2_FXF_APPEND); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 31, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(LIBSSH2_FXF_APPEND); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_FXF_APPEND, __pyx_t_3) < 0) __PYX_ERR(0, 31, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_FXF_APPEND, __pyx_t_3) < 0) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "ssh2/sftp.pyx":32 + /* "ssh2/sftp.pyx":35 * LIBSSH2_FXF_WRITE = c_sftp.LIBSSH2_FXF_WRITE * LIBSSH2_FXF_APPEND = c_sftp.LIBSSH2_FXF_APPEND * LIBSSH2_FXF_CREAT = c_sftp.LIBSSH2_FXF_CREAT # <<<<<<<<<<<<<< * LIBSSH2_FXF_TRUNC = c_sftp.LIBSSH2_FXF_TRUNC * LIBSSH2_FXF_EXCL = c_sftp.LIBSSH2_FXF_EXCL */ - __pyx_t_3 = __Pyx_PyInt_From_int(LIBSSH2_FXF_CREAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 32, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(LIBSSH2_FXF_CREAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_FXF_CREAT, __pyx_t_3) < 0) __PYX_ERR(0, 32, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_FXF_CREAT, __pyx_t_3) < 0) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "ssh2/sftp.pyx":33 + /* "ssh2/sftp.pyx":36 * LIBSSH2_FXF_APPEND = c_sftp.LIBSSH2_FXF_APPEND * LIBSSH2_FXF_CREAT = c_sftp.LIBSSH2_FXF_CREAT * LIBSSH2_FXF_TRUNC = c_sftp.LIBSSH2_FXF_TRUNC # <<<<<<<<<<<<<< * LIBSSH2_FXF_EXCL = c_sftp.LIBSSH2_FXF_EXCL * */ - __pyx_t_3 = __Pyx_PyInt_From_int(LIBSSH2_FXF_TRUNC); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 33, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(LIBSSH2_FXF_TRUNC); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_FXF_TRUNC, __pyx_t_3) < 0) __PYX_ERR(0, 33, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_FXF_TRUNC, __pyx_t_3) < 0) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "ssh2/sftp.pyx":34 + /* "ssh2/sftp.pyx":37 * LIBSSH2_FXF_CREAT = c_sftp.LIBSSH2_FXF_CREAT * LIBSSH2_FXF_TRUNC = c_sftp.LIBSSH2_FXF_TRUNC * LIBSSH2_FXF_EXCL = c_sftp.LIBSSH2_FXF_EXCL # <<<<<<<<<<<<<< * * # File mode masks */ - __pyx_t_3 = __Pyx_PyInt_From_int(LIBSSH2_FXF_EXCL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 34, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(LIBSSH2_FXF_EXCL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_FXF_EXCL, __pyx_t_3) < 0) __PYX_ERR(0, 34, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_FXF_EXCL, __pyx_t_3) < 0) __PYX_ERR(0, 37, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "ssh2/sftp.pyx":38 + /* "ssh2/sftp.pyx":41 * # File mode masks * # Read, write, execute/search by owner * LIBSSH2_SFTP_S_IRWXU = c_sftp.LIBSSH2_SFTP_S_IRWXU # <<<<<<<<<<<<<< * LIBSSH2_SFTP_S_IRUSR = c_sftp.LIBSSH2_SFTP_S_IRUSR * LIBSSH2_SFTP_S_IWUSR = c_sftp.LIBSSH2_SFTP_S_IWUSR */ - __pyx_t_3 = __Pyx_PyInt_From_int(LIBSSH2_SFTP_S_IRWXU); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 38, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(LIBSSH2_SFTP_S_IRWXU); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_SFTP_S_IRWXU, __pyx_t_3) < 0) __PYX_ERR(0, 38, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_SFTP_S_IRWXU, __pyx_t_3) < 0) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "ssh2/sftp.pyx":39 + /* "ssh2/sftp.pyx":42 * # Read, write, execute/search by owner * LIBSSH2_SFTP_S_IRWXU = c_sftp.LIBSSH2_SFTP_S_IRWXU * LIBSSH2_SFTP_S_IRUSR = c_sftp.LIBSSH2_SFTP_S_IRUSR # <<<<<<<<<<<<<< * LIBSSH2_SFTP_S_IWUSR = c_sftp.LIBSSH2_SFTP_S_IWUSR * LIBSSH2_SFTP_S_IXUSR = c_sftp.LIBSSH2_SFTP_S_IXUSR */ - __pyx_t_3 = __Pyx_PyInt_From_int(LIBSSH2_SFTP_S_IRUSR); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 39, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(LIBSSH2_SFTP_S_IRUSR); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_SFTP_S_IRUSR, __pyx_t_3) < 0) __PYX_ERR(0, 39, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_SFTP_S_IRUSR, __pyx_t_3) < 0) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "ssh2/sftp.pyx":40 + /* "ssh2/sftp.pyx":43 * LIBSSH2_SFTP_S_IRWXU = c_sftp.LIBSSH2_SFTP_S_IRWXU * LIBSSH2_SFTP_S_IRUSR = c_sftp.LIBSSH2_SFTP_S_IRUSR * LIBSSH2_SFTP_S_IWUSR = c_sftp.LIBSSH2_SFTP_S_IWUSR # <<<<<<<<<<<<<< * LIBSSH2_SFTP_S_IXUSR = c_sftp.LIBSSH2_SFTP_S_IXUSR * # Read, write, execute/search by group */ - __pyx_t_3 = __Pyx_PyInt_From_int(LIBSSH2_SFTP_S_IWUSR); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 40, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(LIBSSH2_SFTP_S_IWUSR); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_SFTP_S_IWUSR, __pyx_t_3) < 0) __PYX_ERR(0, 40, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_SFTP_S_IWUSR, __pyx_t_3) < 0) __PYX_ERR(0, 43, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "ssh2/sftp.pyx":41 + /* "ssh2/sftp.pyx":44 * LIBSSH2_SFTP_S_IRUSR = c_sftp.LIBSSH2_SFTP_S_IRUSR * LIBSSH2_SFTP_S_IWUSR = c_sftp.LIBSSH2_SFTP_S_IWUSR * LIBSSH2_SFTP_S_IXUSR = c_sftp.LIBSSH2_SFTP_S_IXUSR # <<<<<<<<<<<<<< * # Read, write, execute/search by group * LIBSSH2_SFTP_S_IRWXG = c_sftp.LIBSSH2_SFTP_S_IRWXG */ - __pyx_t_3 = __Pyx_PyInt_From_int(LIBSSH2_SFTP_S_IXUSR); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 41, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(LIBSSH2_SFTP_S_IXUSR); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_SFTP_S_IXUSR, __pyx_t_3) < 0) __PYX_ERR(0, 41, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_SFTP_S_IXUSR, __pyx_t_3) < 0) __PYX_ERR(0, 44, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "ssh2/sftp.pyx":43 + /* "ssh2/sftp.pyx":46 * LIBSSH2_SFTP_S_IXUSR = c_sftp.LIBSSH2_SFTP_S_IXUSR * # Read, write, execute/search by group * LIBSSH2_SFTP_S_IRWXG = c_sftp.LIBSSH2_SFTP_S_IRWXG # <<<<<<<<<<<<<< * LIBSSH2_SFTP_S_IRGRP = c_sftp.LIBSSH2_SFTP_S_IRGRP * LIBSSH2_SFTP_S_IWGRP = c_sftp.LIBSSH2_SFTP_S_IWGRP */ - __pyx_t_3 = __Pyx_PyInt_From_int(LIBSSH2_SFTP_S_IRWXG); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 43, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(LIBSSH2_SFTP_S_IRWXG); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_SFTP_S_IRWXG, __pyx_t_3) < 0) __PYX_ERR(0, 43, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_SFTP_S_IRWXG, __pyx_t_3) < 0) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "ssh2/sftp.pyx":44 + /* "ssh2/sftp.pyx":47 * # Read, write, execute/search by group * LIBSSH2_SFTP_S_IRWXG = c_sftp.LIBSSH2_SFTP_S_IRWXG * LIBSSH2_SFTP_S_IRGRP = c_sftp.LIBSSH2_SFTP_S_IRGRP # <<<<<<<<<<<<<< * LIBSSH2_SFTP_S_IWGRP = c_sftp.LIBSSH2_SFTP_S_IWGRP * LIBSSH2_SFTP_S_IXGRP = c_sftp.LIBSSH2_SFTP_S_IXGRP */ - __pyx_t_3 = __Pyx_PyInt_From_int(LIBSSH2_SFTP_S_IRGRP); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 44, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(LIBSSH2_SFTP_S_IRGRP); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_SFTP_S_IRGRP, __pyx_t_3) < 0) __PYX_ERR(0, 44, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_SFTP_S_IRGRP, __pyx_t_3) < 0) __PYX_ERR(0, 47, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "ssh2/sftp.pyx":45 + /* "ssh2/sftp.pyx":48 * LIBSSH2_SFTP_S_IRWXG = c_sftp.LIBSSH2_SFTP_S_IRWXG * LIBSSH2_SFTP_S_IRGRP = c_sftp.LIBSSH2_SFTP_S_IRGRP * LIBSSH2_SFTP_S_IWGRP = c_sftp.LIBSSH2_SFTP_S_IWGRP # <<<<<<<<<<<<<< * LIBSSH2_SFTP_S_IXGRP = c_sftp.LIBSSH2_SFTP_S_IXGRP * # Read, write, execute/search by others */ - __pyx_t_3 = __Pyx_PyInt_From_int(LIBSSH2_SFTP_S_IWGRP); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 45, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(LIBSSH2_SFTP_S_IWGRP); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_SFTP_S_IWGRP, __pyx_t_3) < 0) __PYX_ERR(0, 45, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_SFTP_S_IWGRP, __pyx_t_3) < 0) __PYX_ERR(0, 48, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "ssh2/sftp.pyx":46 + /* "ssh2/sftp.pyx":49 * LIBSSH2_SFTP_S_IRGRP = c_sftp.LIBSSH2_SFTP_S_IRGRP * LIBSSH2_SFTP_S_IWGRP = c_sftp.LIBSSH2_SFTP_S_IWGRP * LIBSSH2_SFTP_S_IXGRP = c_sftp.LIBSSH2_SFTP_S_IXGRP # <<<<<<<<<<<<<< * # Read, write, execute/search by others * LIBSSH2_SFTP_S_IRWXO = c_sftp.LIBSSH2_SFTP_S_IRWXO */ - __pyx_t_3 = __Pyx_PyInt_From_int(LIBSSH2_SFTP_S_IXGRP); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 46, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(LIBSSH2_SFTP_S_IXGRP); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_SFTP_S_IXGRP, __pyx_t_3) < 0) __PYX_ERR(0, 46, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_SFTP_S_IXGRP, __pyx_t_3) < 0) __PYX_ERR(0, 49, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "ssh2/sftp.pyx":48 + /* "ssh2/sftp.pyx":51 * LIBSSH2_SFTP_S_IXGRP = c_sftp.LIBSSH2_SFTP_S_IXGRP * # Read, write, execute/search by others * LIBSSH2_SFTP_S_IRWXO = c_sftp.LIBSSH2_SFTP_S_IRWXO # <<<<<<<<<<<<<< * LIBSSH2_SFTP_S_IROTH = c_sftp.LIBSSH2_SFTP_S_IROTH * LIBSSH2_SFTP_S_IWOTH = c_sftp.LIBSSH2_SFTP_S_IWOTH */ - __pyx_t_3 = __Pyx_PyInt_From_int(LIBSSH2_SFTP_S_IRWXO); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 48, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(LIBSSH2_SFTP_S_IRWXO); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_SFTP_S_IRWXO, __pyx_t_3) < 0) __PYX_ERR(0, 48, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_SFTP_S_IRWXO, __pyx_t_3) < 0) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "ssh2/sftp.pyx":49 + /* "ssh2/sftp.pyx":52 * # Read, write, execute/search by others * LIBSSH2_SFTP_S_IRWXO = c_sftp.LIBSSH2_SFTP_S_IRWXO * LIBSSH2_SFTP_S_IROTH = c_sftp.LIBSSH2_SFTP_S_IROTH # <<<<<<<<<<<<<< * LIBSSH2_SFTP_S_IWOTH = c_sftp.LIBSSH2_SFTP_S_IWOTH * LIBSSH2_SFTP_S_IXOTH = c_sftp.LIBSSH2_SFTP_S_IXOTH */ - __pyx_t_3 = __Pyx_PyInt_From_int(LIBSSH2_SFTP_S_IROTH); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 49, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(LIBSSH2_SFTP_S_IROTH); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_SFTP_S_IROTH, __pyx_t_3) < 0) __PYX_ERR(0, 49, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_SFTP_S_IROTH, __pyx_t_3) < 0) __PYX_ERR(0, 52, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "ssh2/sftp.pyx":50 + /* "ssh2/sftp.pyx":53 * LIBSSH2_SFTP_S_IRWXO = c_sftp.LIBSSH2_SFTP_S_IRWXO * LIBSSH2_SFTP_S_IROTH = c_sftp.LIBSSH2_SFTP_S_IROTH * LIBSSH2_SFTP_S_IWOTH = c_sftp.LIBSSH2_SFTP_S_IWOTH # <<<<<<<<<<<<<< * LIBSSH2_SFTP_S_IXOTH = c_sftp.LIBSSH2_SFTP_S_IXOTH * */ - __pyx_t_3 = __Pyx_PyInt_From_int(LIBSSH2_SFTP_S_IWOTH); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 50, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(LIBSSH2_SFTP_S_IWOTH); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_SFTP_S_IWOTH, __pyx_t_3) < 0) __PYX_ERR(0, 50, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_SFTP_S_IWOTH, __pyx_t_3) < 0) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "ssh2/sftp.pyx":51 + /* "ssh2/sftp.pyx":54 * LIBSSH2_SFTP_S_IROTH = c_sftp.LIBSSH2_SFTP_S_IROTH * LIBSSH2_SFTP_S_IWOTH = c_sftp.LIBSSH2_SFTP_S_IWOTH * LIBSSH2_SFTP_S_IXOTH = c_sftp.LIBSSH2_SFTP_S_IXOTH # <<<<<<<<<<<<<< * * */ - __pyx_t_3 = __Pyx_PyInt_From_int(LIBSSH2_SFTP_S_IXOTH); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 51, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(LIBSSH2_SFTP_S_IXOTH); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_SFTP_S_IXOTH, __pyx_t_3) < 0) __PYX_ERR(0, 51, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_SFTP_S_IXOTH, __pyx_t_3) < 0) __PYX_ERR(0, 54, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "ssh2/sftp.pyx":436 + /* "ssh2/sftp.pyx":439 * return rc * * def read(self, size_t buffer_maxlen=c_ssh2._LIBSSH2_CHANNEL_WINDOW_DEFAULT): # <<<<<<<<<<<<<< @@ -9865,7 +9865,7 @@ PyMODINIT_FUNC PyInit_sftp(void) */ __pyx_k__5 = LIBSSH2_CHANNEL_WINDOW_DEFAULT; - /* "ssh2/sftp.pyx":464 + /* "ssh2/sftp.pyx":467 * * def readdir(self, SFTPAttributes attrs, * size_t buffer_maxlen=c_ssh2._LIBSSH2_CHANNEL_WINDOW_DEFAULT): # <<<<<<<<<<<<<< diff --git a/ssh2/utils.c b/ssh2/utils.c index 35bce36f..d18c22b7 100644 --- a/ssh2/utils.c +++ b/ssh2/utils.c @@ -3,18 +3,18 @@ /* BEGIN: Cython Metadata { "distutils": { - "depends": [], + "depends": [], "extra_compile_args": [ "-ggdb" - ], + ], "libraries": [ "ssh2" - ], - "name": "ssh2.utils", + ], + "name": "ssh2.utils", "sources": [ "ssh2/utils.pyx" ] - }, + }, "module_name": "ssh2.utils" } END: Cython Metadata */ @@ -488,6 +488,7 @@ static CYTHON_INLINE float __PYX_NAN() { #define __PYX_HAVE__ssh2__utils #define __PYX_HAVE_API__ssh2__utils +#include #include #include #include @@ -973,6 +974,8 @@ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* Module declarations from 'cpython.version' */ +/* Module declarations from 'libc.stdint' */ + /* Module declarations from 'libc.stddef' */ /* Module declarations from 'libc.time' */ diff --git a/tests/test_ssh2.py b/tests/test_ssh2.py index 3d31fe1c..80f5e610 100644 --- a/tests/test_ssh2.py +++ b/tests/test_ssh2.py @@ -305,3 +305,66 @@ def test_sftp_symlink_realpath_lstat(self): finally: os.unlink(symlink_target) os.unlink(remote_filename) + + def test_scp_recv2(self): + self.assertEqual(self._auth(), 0) + test_data = b"data" + remote_filename = os.sep.join([os.path.dirname(__file__), + "remote_test_file"]) + with open(remote_filename, 'wb') as fh: + fh.write(test_data) + try: + (file_chan, fileinfo) = self.session.scp_recv2(remote_filename) + except TypeError: + os.unlink(remote_filename) + raise + try: + total = 0 + size, data = file_chan.read(size=fileinfo.st_size) + total += size + while total < fileinfo.st_size: + total += size + size, data = file_chan.read() + self.assertEqual(total, fileinfo.st_size) + except Exception: + raise + finally: + os.unlink(remote_filename) + + def test_scp_send(self): + self.assertEqual(self._auth(), 0) + test_data = b"data" + remote_filename = os.sep.join([os.path.dirname(__file__), + "remote_test_file"]) + to_copy = os.sep.join([os.path.dirname(__file__), + "copied"]) + with open(remote_filename, 'wb') as fh: + fh.write(test_data) + fileinfo = os.stat(remote_filename) + try: + chan = self.session.scp_send( + to_copy, fileinfo.st_mode & 777, fileinfo.st_size) + with open(remote_filename, 'rb') as local_fh: + for data in local_fh: + chan.write(data) + chan.send_eof() + chan.wait_eof() + chan.wait_closed() + self.assertEqual(os.stat(to_copy).st_size, + os.stat(remote_filename).st_size) + except Exception: + raise + finally: + os.unlink(remote_filename) + os.unlink(to_copy) + + def test_session_get_set(self): + self.assertEqual(self._auth(), 0) + self.session.set_timeout(10) + self.assertEqual(self.session.get_timeout(), 10) + self.session.set_timeout(0) + self.assertEqual(self.session.get_timeout(), 0) + self.session.set_blocking(0) + self.assertEqual(self.session.get_blocking(), 0) + self.session.set_blocking(1) + self.assertEqual(self.session.get_blocking(), 1) From 7abd6c306ee8dfbabe9cc068c033a141d0e0f892 Mon Sep 17 00:00:00 2001 From: Pan Date: Sun, 6 Aug 2017 12:47:44 +0100 Subject: [PATCH 2/6] Implemented scp recv method, updated definition --- ssh2/c_ssh2.pxd | 18 +- ssh2/session.c | 952 ++++++++++++++++++++++----------------------- ssh2/session.pyx | 28 +- tests/test_ssh2.py | 25 ++ 4 files changed, 521 insertions(+), 502 deletions(-) diff --git a/ssh2/c_ssh2.pxd b/ssh2/c_ssh2.pxd index f7541359..67123d6e 100644 --- a/ssh2/c_ssh2.pxd +++ b/ssh2/c_ssh2.pxd @@ -16,7 +16,7 @@ from libc.stdint cimport uint64_t from libc.time cimport time_t -from posix.types cimport (blkcnt_t, blksize_t, dev_t, gid_t, ino_t, mode_t, +from posix.types cimport (blkcnt_t, blksize_t, dev_t, gid_t, ino_t, nlink_t, off_t, time_t, uid_t) @@ -32,20 +32,6 @@ cdef extern from "libssh2.h" nogil: _LIBSSH2_CHANNEL_FLUSH_EXTENDED_DATA "LIBSSH2_CHANNEL_FLUSH_EXTENDED_DATA" _LIBSSH2_CHANNEL_FLUSH_ALL "LIBSSH2_CHANNEL_FLUSH_ALL" ctypedef long long libssh2_int64_t - ctypedef struct stat: - dev_t st_dev - ino_t st_ino - mode_t st_mode - nlink_t st_nlink - uid_t st_uid - gid_t st_gid - dev_t st_rdev - off_t st_size - blksize_t st_blksize - blkcnt_t st_blocks - time_t st_atime - time_t st_mtime - time_t st_ctime ctypedef uint64_t libssh2_struct_stat_size ctypedef struct libssh2_struct_stat: dev_t st_dev @@ -325,7 +311,7 @@ cdef extern from "libssh2.h" nogil: # libssh2_scp_recv is DEPRECATED, do not use! LIBSSH2_CHANNEL *libssh2_scp_recv(LIBSSH2_SESSION *session, const char *path, - stat *sb) + libssh2_struct_stat *sb) # Use libssh2_scp_recv2 for large (> 2GB) file support on windows LIBSSH2_CHANNEL *libssh2_scp_recv2(LIBSSH2_SESSION *session, const char *path, diff --git a/ssh2/session.c b/ssh2/session.c index 54b2f1ca..fbba8126 100644 --- a/ssh2/session.c +++ b/ssh2/session.c @@ -944,7 +944,7 @@ struct __pyx_obj_4ssh2_7session_Session { -/* "ssh2/session.pyx":34 +/* "ssh2/session.pyx":33 * * * cdef class Session: # <<<<<<<<<<<<<< @@ -1427,7 +1427,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_42forward_listen(struct __pyx_ static PyObject *__pyx_pf_4ssh2_7session_7Session_44forward_listen_ex(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, PyObject *__pyx_v_host, int __pyx_v_port, int __pyx_v_bound_port, int __pyx_v_queue_maxsize); /* proto */ static PyObject *__pyx_pf_4ssh2_7session_7Session_46sftp_init(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_4ssh2_7session_7Session_48last_error(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_4ssh2_7session_7Session_50scp_recv2(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, PyObject *__pyx_v_path); /* proto */ +static PyObject *__pyx_pf_4ssh2_7session_7Session_50scp_recv(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, PyObject *__pyx_v_path); /* proto */ static PyObject *__pyx_pf_4ssh2_7session_7Session_52scp_send(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, PyObject *__pyx_v_path, int __pyx_v_mode, size_t __pyx_v_size); /* proto */ static PyObject *__pyx_pf_4ssh2_7session_7Session_54scp_send64(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, PyObject *__pyx_v_path, int __pyx_v_mode, uint64_t __pyx_v_size, time_t __pyx_v_mtime, time_t __pyx_v_atime); /* proto */ static PyObject *__pyx_pf_4ssh2_7session_7Session_56__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self); /* proto */ @@ -1439,7 +1439,7 @@ static PyObject *__pyx_tuple__4; static PyObject *__pyx_tuple__6; static PyObject *__pyx_tuple__7; -/* "ssh2/session.pyx":38 +/* "ssh2/session.pyx":37 * """LibSSH2 Session class providing session functions""" * * def __cinit__(self): # <<<<<<<<<<<<<< @@ -1469,7 +1469,7 @@ static int __pyx_pf_4ssh2_7session_7Session___cinit__(struct __pyx_obj_4ssh2_7se int __pyx_t_1; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "ssh2/session.pyx":39 + /* "ssh2/session.pyx":38 * * def __cinit__(self): * with nogil: # <<<<<<<<<<<<<< @@ -1484,7 +1484,7 @@ static int __pyx_pf_4ssh2_7session_7Session___cinit__(struct __pyx_obj_4ssh2_7se #endif /*try:*/ { - /* "ssh2/session.pyx":40 + /* "ssh2/session.pyx":39 * def __cinit__(self): * with nogil: * self._session = c_ssh2.libssh2_session_init() # <<<<<<<<<<<<<< @@ -1493,7 +1493,7 @@ static int __pyx_pf_4ssh2_7session_7Session___cinit__(struct __pyx_obj_4ssh2_7se */ __pyx_v_self->_session = libssh2_session_init(); - /* "ssh2/session.pyx":41 + /* "ssh2/session.pyx":40 * with nogil: * self._session = c_ssh2.libssh2_session_init() * if self._session is NULL: # <<<<<<<<<<<<<< @@ -1503,7 +1503,7 @@ static int __pyx_pf_4ssh2_7session_7Session___cinit__(struct __pyx_obj_4ssh2_7se __pyx_t_1 = ((__pyx_v_self->_session == NULL) != 0); if (__pyx_t_1) { - /* "ssh2/session.pyx":42 + /* "ssh2/session.pyx":41 * self._session = c_ssh2.libssh2_session_init() * if self._session is NULL: * with gil: # <<<<<<<<<<<<<< @@ -1516,17 +1516,17 @@ static int __pyx_pf_4ssh2_7session_7Session___cinit__(struct __pyx_obj_4ssh2_7se #endif /*try:*/ { - /* "ssh2/session.pyx":43 + /* "ssh2/session.pyx":42 * if self._session is NULL: * with gil: * raise MemoryError # <<<<<<<<<<<<<< * * def __dealloc__(self): */ - PyErr_NoMemory(); __PYX_ERR(0, 43, __pyx_L8_error) + PyErr_NoMemory(); __PYX_ERR(0, 42, __pyx_L8_error) } - /* "ssh2/session.pyx":42 + /* "ssh2/session.pyx":41 * self._session = c_ssh2.libssh2_session_init() * if self._session is NULL: * with gil: # <<<<<<<<<<<<<< @@ -1543,7 +1543,7 @@ static int __pyx_pf_4ssh2_7session_7Session___cinit__(struct __pyx_obj_4ssh2_7se } } - /* "ssh2/session.pyx":41 + /* "ssh2/session.pyx":40 * with nogil: * self._session = c_ssh2.libssh2_session_init() * if self._session is NULL: # <<<<<<<<<<<<<< @@ -1553,7 +1553,7 @@ static int __pyx_pf_4ssh2_7session_7Session___cinit__(struct __pyx_obj_4ssh2_7se } } - /* "ssh2/session.pyx":39 + /* "ssh2/session.pyx":38 * * def __cinit__(self): * with nogil: # <<<<<<<<<<<<<< @@ -1579,7 +1579,7 @@ static int __pyx_pf_4ssh2_7session_7Session___cinit__(struct __pyx_obj_4ssh2_7se } } - /* "ssh2/session.pyx":38 + /* "ssh2/session.pyx":37 * """LibSSH2 Session class providing session functions""" * * def __cinit__(self): # <<<<<<<<<<<<<< @@ -1598,7 +1598,7 @@ static int __pyx_pf_4ssh2_7session_7Session___cinit__(struct __pyx_obj_4ssh2_7se return __pyx_r; } -/* "ssh2/session.pyx":45 +/* "ssh2/session.pyx":44 * raise MemoryError * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -1621,7 +1621,7 @@ static void __pyx_pf_4ssh2_7session_7Session_2__dealloc__(struct __pyx_obj_4ssh2 __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "ssh2/session.pyx":46 + /* "ssh2/session.pyx":45 * * def __dealloc__(self): * with nogil: # <<<<<<<<<<<<<< @@ -1636,7 +1636,7 @@ static void __pyx_pf_4ssh2_7session_7Session_2__dealloc__(struct __pyx_obj_4ssh2 #endif /*try:*/ { - /* "ssh2/session.pyx":47 + /* "ssh2/session.pyx":46 * def __dealloc__(self): * with nogil: * c_ssh2.libssh2_session_disconnect( # <<<<<<<<<<<<<< @@ -1645,7 +1645,7 @@ static void __pyx_pf_4ssh2_7session_7Session_2__dealloc__(struct __pyx_obj_4ssh2 */ libssh2_session_disconnect(__pyx_v_self->_session, ((char const *)"end")); - /* "ssh2/session.pyx":49 + /* "ssh2/session.pyx":48 * c_ssh2.libssh2_session_disconnect( * self._session, "end") * c_ssh2.libssh2_session_free(self._session) # <<<<<<<<<<<<<< @@ -1655,7 +1655,7 @@ static void __pyx_pf_4ssh2_7session_7Session_2__dealloc__(struct __pyx_obj_4ssh2 libssh2_session_free(__pyx_v_self->_session); } - /* "ssh2/session.pyx":46 + /* "ssh2/session.pyx":45 * * def __dealloc__(self): * with nogil: # <<<<<<<<<<<<<< @@ -1674,7 +1674,7 @@ static void __pyx_pf_4ssh2_7session_7Session_2__dealloc__(struct __pyx_obj_4ssh2 } } - /* "ssh2/session.pyx":45 + /* "ssh2/session.pyx":44 * raise MemoryError * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -1686,7 +1686,7 @@ static void __pyx_pf_4ssh2_7session_7Session_2__dealloc__(struct __pyx_obj_4ssh2 __Pyx_RefNannyFinishContext(); } -/* "ssh2/session.pyx":51 +/* "ssh2/session.pyx":50 * c_ssh2.libssh2_session_free(self._session) * * def disconnect(self): # <<<<<<<<<<<<<< @@ -1713,7 +1713,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_4disconnect(struct __pyx_obj_4 __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("disconnect", 0); - /* "ssh2/session.pyx":52 + /* "ssh2/session.pyx":51 * * def disconnect(self): * with nogil: # <<<<<<<<<<<<<< @@ -1728,7 +1728,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_4disconnect(struct __pyx_obj_4 #endif /*try:*/ { - /* "ssh2/session.pyx":53 + /* "ssh2/session.pyx":52 * def disconnect(self): * with nogil: * c_ssh2.libssh2_session_disconnect(self._session, "end") # <<<<<<<<<<<<<< @@ -1738,7 +1738,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_4disconnect(struct __pyx_obj_4 libssh2_session_disconnect(__pyx_v_self->_session, ((char const *)"end")); } - /* "ssh2/session.pyx":52 + /* "ssh2/session.pyx":51 * * def disconnect(self): * with nogil: # <<<<<<<<<<<<<< @@ -1757,7 +1757,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_4disconnect(struct __pyx_obj_4 } } - /* "ssh2/session.pyx":51 + /* "ssh2/session.pyx":50 * c_ssh2.libssh2_session_free(self._session) * * def disconnect(self): # <<<<<<<<<<<<<< @@ -1772,7 +1772,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_4disconnect(struct __pyx_obj_4 return __pyx_r; } -/* "ssh2/session.pyx":55 +/* "ssh2/session.pyx":54 * c_ssh2.libssh2_session_disconnect(self._session, "end") * * def handshake(self, sock not None): # <<<<<<<<<<<<<< @@ -1788,7 +1788,7 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_7handshake(PyObject *__pyx_v_s __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("handshake (wrapper)", 0); if (unlikely(((PyObject *)__pyx_v_sock) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "sock"); __PYX_ERR(0, 55, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "sock"); __PYX_ERR(0, 54, __pyx_L1_error) } __pyx_r = __pyx_pf_4ssh2_7session_7Session_6handshake(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), ((PyObject *)__pyx_v_sock)); @@ -1813,17 +1813,17 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_6handshake(struct __pyx_obj_4s PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("handshake", 0); - /* "ssh2/session.pyx":56 + /* "ssh2/session.pyx":55 * * def handshake(self, sock not None): * cdef int _sock = PyObject_AsFileDescriptor(sock) # <<<<<<<<<<<<<< * cdef int rc * with nogil: */ - __pyx_t_1 = PyObject_AsFileDescriptor(__pyx_v_sock); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 56, __pyx_L1_error) + __pyx_t_1 = PyObject_AsFileDescriptor(__pyx_v_sock); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 55, __pyx_L1_error) __pyx_v__sock = __pyx_t_1; - /* "ssh2/session.pyx":58 + /* "ssh2/session.pyx":57 * cdef int _sock = PyObject_AsFileDescriptor(sock) * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -1838,7 +1838,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_6handshake(struct __pyx_obj_4s #endif /*try:*/ { - /* "ssh2/session.pyx":59 + /* "ssh2/session.pyx":58 * cdef int rc * with nogil: * rc = c_ssh2.libssh2_session_handshake(self._session, _sock) # <<<<<<<<<<<<<< @@ -1847,7 +1847,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_6handshake(struct __pyx_obj_4s */ __pyx_v_rc = libssh2_session_handshake(__pyx_v_self->_session, __pyx_v__sock); - /* "ssh2/session.pyx":60 + /* "ssh2/session.pyx":59 * with nogil: * rc = c_ssh2.libssh2_session_handshake(self._session, _sock) * if rc != 0 and rc != c_ssh2._LIBSSH2_ERROR_EAGAIN: # <<<<<<<<<<<<<< @@ -1865,7 +1865,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_6handshake(struct __pyx_obj_4s __pyx_L7_bool_binop_done:; if (__pyx_t_2) { - /* "ssh2/session.pyx":61 + /* "ssh2/session.pyx":60 * rc = c_ssh2.libssh2_session_handshake(self._session, _sock) * if rc != 0 and rc != c_ssh2._LIBSSH2_ERROR_EAGAIN: * with gil: # <<<<<<<<<<<<<< @@ -1878,24 +1878,24 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_6handshake(struct __pyx_obj_4s #endif /*try:*/ { - /* "ssh2/session.pyx":64 + /* "ssh2/session.pyx":63 * raise SessionHandshakeError( * "SSH session handshake failed with error code %s", * rc) # <<<<<<<<<<<<<< * return rc * */ - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 64, __pyx_L10_error) + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 63, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_4); - /* "ssh2/session.pyx":62 + /* "ssh2/session.pyx":61 * if rc != 0 and rc != c_ssh2._LIBSSH2_ERROR_EAGAIN: * with gil: * raise SessionHandshakeError( # <<<<<<<<<<<<<< * "SSH session handshake failed with error code %s", * rc) */ - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 62, __pyx_L10_error) + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 61, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_kp_s_SSH_session_handshake_failed_wit); __Pyx_GIVEREF(__pyx_kp_s_SSH_session_handshake_failed_wit); @@ -1903,15 +1903,15 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_6handshake(struct __pyx_obj_4s __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4ssh2_10exceptions_SessionHandshakeError), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 62, __pyx_L10_error) + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4ssh2_10exceptions_SessionHandshakeError), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 61, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(0, 62, __pyx_L10_error) + __PYX_ERR(0, 61, __pyx_L10_error) } - /* "ssh2/session.pyx":61 + /* "ssh2/session.pyx":60 * rc = c_ssh2.libssh2_session_handshake(self._session, _sock) * if rc != 0 and rc != c_ssh2._LIBSSH2_ERROR_EAGAIN: * with gil: # <<<<<<<<<<<<<< @@ -1928,7 +1928,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_6handshake(struct __pyx_obj_4s } } - /* "ssh2/session.pyx":60 + /* "ssh2/session.pyx":59 * with nogil: * rc = c_ssh2.libssh2_session_handshake(self._session, _sock) * if rc != 0 and rc != c_ssh2._LIBSSH2_ERROR_EAGAIN: # <<<<<<<<<<<<<< @@ -1938,7 +1938,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_6handshake(struct __pyx_obj_4s } } - /* "ssh2/session.pyx":58 + /* "ssh2/session.pyx":57 * cdef int _sock = PyObject_AsFileDescriptor(sock) * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -1964,7 +1964,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_6handshake(struct __pyx_obj_4s } } - /* "ssh2/session.pyx":65 + /* "ssh2/session.pyx":64 * "SSH session handshake failed with error code %s", * rc) * return rc # <<<<<<<<<<<<<< @@ -1972,13 +1972,13 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_6handshake(struct __pyx_obj_4s * def startup(self, sock): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 65, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":55 + /* "ssh2/session.pyx":54 * c_ssh2.libssh2_session_disconnect(self._session, "end") * * def handshake(self, sock not None): # <<<<<<<<<<<<<< @@ -1998,7 +1998,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_6handshake(struct __pyx_obj_4s return __pyx_r; } -/* "ssh2/session.pyx":67 +/* "ssh2/session.pyx":66 * return rc * * def startup(self, sock): # <<<<<<<<<<<<<< @@ -2032,17 +2032,17 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_8startup(struct __pyx_obj_4ssh PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("startup", 0); - /* "ssh2/session.pyx":69 + /* "ssh2/session.pyx":68 * def startup(self, sock): * """Deprecated - use self.handshake""" * cdef int _sock = PyObject_AsFileDescriptor(sock) # <<<<<<<<<<<<<< * cdef int rc * with nogil: */ - __pyx_t_1 = PyObject_AsFileDescriptor(__pyx_v_sock); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 69, __pyx_L1_error) + __pyx_t_1 = PyObject_AsFileDescriptor(__pyx_v_sock); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 68, __pyx_L1_error) __pyx_v__sock = __pyx_t_1; - /* "ssh2/session.pyx":71 + /* "ssh2/session.pyx":70 * cdef int _sock = PyObject_AsFileDescriptor(sock) * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -2057,7 +2057,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_8startup(struct __pyx_obj_4ssh #endif /*try:*/ { - /* "ssh2/session.pyx":72 + /* "ssh2/session.pyx":71 * cdef int rc * with nogil: * rc = c_ssh2.libssh2_session_startup(self._session, _sock) # <<<<<<<<<<<<<< @@ -2066,7 +2066,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_8startup(struct __pyx_obj_4ssh */ __pyx_v_rc = libssh2_session_startup(__pyx_v_self->_session, __pyx_v__sock); - /* "ssh2/session.pyx":73 + /* "ssh2/session.pyx":72 * with nogil: * rc = c_ssh2.libssh2_session_startup(self._session, _sock) * if rc != 0 and rc != c_ssh2._LIBSSH2_ERROR_EAGAIN: # <<<<<<<<<<<<<< @@ -2084,7 +2084,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_8startup(struct __pyx_obj_4ssh __pyx_L7_bool_binop_done:; if (__pyx_t_2) { - /* "ssh2/session.pyx":74 + /* "ssh2/session.pyx":73 * rc = c_ssh2.libssh2_session_startup(self._session, _sock) * if rc != 0 and rc != c_ssh2._LIBSSH2_ERROR_EAGAIN: * with gil: # <<<<<<<<<<<<<< @@ -2097,24 +2097,24 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_8startup(struct __pyx_obj_4ssh #endif /*try:*/ { - /* "ssh2/session.pyx":77 + /* "ssh2/session.pyx":76 * raise SessionStartupError( * "SSH session startup failed with error code %s", * rc) # <<<<<<<<<<<<<< * return rc * */ - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 77, __pyx_L10_error) + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 76, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_4); - /* "ssh2/session.pyx":75 + /* "ssh2/session.pyx":74 * if rc != 0 and rc != c_ssh2._LIBSSH2_ERROR_EAGAIN: * with gil: * raise SessionStartupError( # <<<<<<<<<<<<<< * "SSH session startup failed with error code %s", * rc) */ - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 75, __pyx_L10_error) + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 74, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_kp_s_SSH_session_startup_failed_with); __Pyx_GIVEREF(__pyx_kp_s_SSH_session_startup_failed_with); @@ -2122,15 +2122,15 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_8startup(struct __pyx_obj_4ssh __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4ssh2_10exceptions_SessionStartupError), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 75, __pyx_L10_error) + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4ssh2_10exceptions_SessionStartupError), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 74, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(0, 75, __pyx_L10_error) + __PYX_ERR(0, 74, __pyx_L10_error) } - /* "ssh2/session.pyx":74 + /* "ssh2/session.pyx":73 * rc = c_ssh2.libssh2_session_startup(self._session, _sock) * if rc != 0 and rc != c_ssh2._LIBSSH2_ERROR_EAGAIN: * with gil: # <<<<<<<<<<<<<< @@ -2147,7 +2147,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_8startup(struct __pyx_obj_4ssh } } - /* "ssh2/session.pyx":73 + /* "ssh2/session.pyx":72 * with nogil: * rc = c_ssh2.libssh2_session_startup(self._session, _sock) * if rc != 0 and rc != c_ssh2._LIBSSH2_ERROR_EAGAIN: # <<<<<<<<<<<<<< @@ -2157,7 +2157,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_8startup(struct __pyx_obj_4ssh } } - /* "ssh2/session.pyx":71 + /* "ssh2/session.pyx":70 * cdef int _sock = PyObject_AsFileDescriptor(sock) * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -2183,7 +2183,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_8startup(struct __pyx_obj_4ssh } } - /* "ssh2/session.pyx":78 + /* "ssh2/session.pyx":77 * "SSH session startup failed with error code %s", * rc) * return rc # <<<<<<<<<<<<<< @@ -2191,13 +2191,13 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_8startup(struct __pyx_obj_4ssh * def set_blocking(self, bint blocking): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 78, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":67 + /* "ssh2/session.pyx":66 * return rc * * def startup(self, sock): # <<<<<<<<<<<<<< @@ -2217,7 +2217,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_8startup(struct __pyx_obj_4ssh return __pyx_r; } -/* "ssh2/session.pyx":80 +/* "ssh2/session.pyx":79 * return rc * * def set_blocking(self, bint blocking): # <<<<<<<<<<<<<< @@ -2234,7 +2234,7 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_11set_blocking(PyObject *__pyx __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_blocking (wrapper)", 0); assert(__pyx_arg_blocking); { - __pyx_v_blocking = __Pyx_PyObject_IsTrue(__pyx_arg_blocking); if (unlikely((__pyx_v_blocking == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 80, __pyx_L3_error) + __pyx_v_blocking = __Pyx_PyObject_IsTrue(__pyx_arg_blocking); if (unlikely((__pyx_v_blocking == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 79, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -2254,7 +2254,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_10set_blocking(struct __pyx_ob __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_blocking", 0); - /* "ssh2/session.pyx":86 + /* "ssh2/session.pyx":85 * Session default is blocking unless set otherwise. * :type blocking: bool""" * with nogil: # <<<<<<<<<<<<<< @@ -2269,7 +2269,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_10set_blocking(struct __pyx_ob #endif /*try:*/ { - /* "ssh2/session.pyx":87 + /* "ssh2/session.pyx":86 * :type blocking: bool""" * with nogil: * c_ssh2.libssh2_session_set_blocking( # <<<<<<<<<<<<<< @@ -2279,7 +2279,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_10set_blocking(struct __pyx_ob libssh2_session_set_blocking(__pyx_v_self->_session, __pyx_v_blocking); } - /* "ssh2/session.pyx":86 + /* "ssh2/session.pyx":85 * Session default is blocking unless set otherwise. * :type blocking: bool""" * with nogil: # <<<<<<<<<<<<<< @@ -2298,7 +2298,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_10set_blocking(struct __pyx_ob } } - /* "ssh2/session.pyx":80 + /* "ssh2/session.pyx":79 * return rc * * def set_blocking(self, bint blocking): # <<<<<<<<<<<<<< @@ -2313,7 +2313,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_10set_blocking(struct __pyx_ob return __pyx_r; } -/* "ssh2/session.pyx":90 +/* "ssh2/session.pyx":89 * self._session, blocking) * * def get_blocking(self): # <<<<<<<<<<<<<< @@ -2343,7 +2343,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_12get_blocking(struct __pyx_ob int __pyx_t_2; __Pyx_RefNannySetupContext("get_blocking", 0); - /* "ssh2/session.pyx":95 + /* "ssh2/session.pyx":94 * :rtype: bool""" * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -2358,7 +2358,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_12get_blocking(struct __pyx_ob #endif /*try:*/ { - /* "ssh2/session.pyx":96 + /* "ssh2/session.pyx":95 * cdef int rc * with nogil: * rc = c_ssh2.libssh2_session_get_blocking(self._session) # <<<<<<<<<<<<<< @@ -2368,7 +2368,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_12get_blocking(struct __pyx_ob __pyx_v_rc = libssh2_session_get_blocking(__pyx_v_self->_session); } - /* "ssh2/session.pyx":95 + /* "ssh2/session.pyx":94 * :rtype: bool""" * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -2387,7 +2387,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_12get_blocking(struct __pyx_ob } } - /* "ssh2/session.pyx":97 + /* "ssh2/session.pyx":96 * with nogil: * rc = c_ssh2.libssh2_session_get_blocking(self._session) * return bool(rc) # <<<<<<<<<<<<<< @@ -2395,17 +2395,17 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_12get_blocking(struct __pyx_ob * def set_timeout(self, long timeout): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 97, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":90 + /* "ssh2/session.pyx":89 * self._session, blocking) * * def get_blocking(self): # <<<<<<<<<<<<<< @@ -2424,7 +2424,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_12get_blocking(struct __pyx_ob return __pyx_r; } -/* "ssh2/session.pyx":99 +/* "ssh2/session.pyx":98 * return bool(rc) * * def set_timeout(self, long timeout): # <<<<<<<<<<<<<< @@ -2434,14 +2434,14 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_12get_blocking(struct __pyx_ob /* Python wrapper */ static PyObject *__pyx_pw_4ssh2_7session_7Session_15set_timeout(PyObject *__pyx_v_self, PyObject *__pyx_arg_timeout); /*proto*/ -static char __pyx_doc_4ssh2_7session_7Session_14set_timeout[] = "Session.set_timeout(self, long timeout)\nSet the timeout in milliseconds for how long a blocking the libssh2\n function calls may wait until they consider the situation an error and\n return :py:class:`ssh2.error_codes.LIBSSH2_ERROR_TIMEOUT`.\n\n By default or if you set the timeout to zero, libssh2 has no timeout \n for blocking functions.\n :param timeout: Milliseconds to wait before timeout."; +static char __pyx_doc_4ssh2_7session_7Session_14set_timeout[] = "Session.set_timeout(self, long timeout)\nSet the timeout in milliseconds for how long a blocking the libssh2\n function calls may wait until they consider the situation an error and\n return :py:class:`ssh2.error_codes.LIBSSH2_ERROR_TIMEOUT`.\n\n By default or if you set the timeout to zero, libssh2 has no timeout\n for blocking functions.\n :param timeout: Milliseconds to wait before timeout."; static PyObject *__pyx_pw_4ssh2_7session_7Session_15set_timeout(PyObject *__pyx_v_self, PyObject *__pyx_arg_timeout) { long __pyx_v_timeout; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_timeout (wrapper)", 0); assert(__pyx_arg_timeout); { - __pyx_v_timeout = __Pyx_PyInt_As_long(__pyx_arg_timeout); if (unlikely((__pyx_v_timeout == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 99, __pyx_L3_error) + __pyx_v_timeout = __Pyx_PyInt_As_long(__pyx_arg_timeout); if (unlikely((__pyx_v_timeout == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 98, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -2461,7 +2461,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_14set_timeout(struct __pyx_obj __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_timeout", 0); - /* "ssh2/session.pyx":107 + /* "ssh2/session.pyx":106 * for blocking functions. * :param timeout: Milliseconds to wait before timeout.""" * with nogil: # <<<<<<<<<<<<<< @@ -2476,7 +2476,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_14set_timeout(struct __pyx_obj #endif /*try:*/ { - /* "ssh2/session.pyx":108 + /* "ssh2/session.pyx":107 * :param timeout: Milliseconds to wait before timeout.""" * with nogil: * c_ssh2.libssh2_session_set_timeout(self._session, timeout) # <<<<<<<<<<<<<< @@ -2486,7 +2486,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_14set_timeout(struct __pyx_obj libssh2_session_set_timeout(__pyx_v_self->_session, __pyx_v_timeout); } - /* "ssh2/session.pyx":107 + /* "ssh2/session.pyx":106 * for blocking functions. * :param timeout: Milliseconds to wait before timeout.""" * with nogil: # <<<<<<<<<<<<<< @@ -2505,7 +2505,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_14set_timeout(struct __pyx_obj } } - /* "ssh2/session.pyx":99 + /* "ssh2/session.pyx":98 * return bool(rc) * * def set_timeout(self, long timeout): # <<<<<<<<<<<<<< @@ -2520,7 +2520,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_14set_timeout(struct __pyx_obj return __pyx_r; } -/* "ssh2/session.pyx":110 +/* "ssh2/session.pyx":109 * c_ssh2.libssh2_session_set_timeout(self._session, timeout) * * def get_timeout(self): # <<<<<<<<<<<<<< @@ -2549,7 +2549,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_16get_timeout(struct __pyx_obj PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("get_timeout", 0); - /* "ssh2/session.pyx":113 + /* "ssh2/session.pyx":112 * """Get current session timeout setting""" * cdef long timeout * with nogil: # <<<<<<<<<<<<<< @@ -2564,7 +2564,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_16get_timeout(struct __pyx_obj #endif /*try:*/ { - /* "ssh2/session.pyx":114 + /* "ssh2/session.pyx":113 * cdef long timeout * with nogil: * timeout = c_ssh2.libssh2_session_get_timeout(self._session) # <<<<<<<<<<<<<< @@ -2574,7 +2574,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_16get_timeout(struct __pyx_obj __pyx_v_timeout = libssh2_session_get_timeout(__pyx_v_self->_session); } - /* "ssh2/session.pyx":113 + /* "ssh2/session.pyx":112 * """Get current session timeout setting""" * cdef long timeout * with nogil: # <<<<<<<<<<<<<< @@ -2593,7 +2593,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_16get_timeout(struct __pyx_obj } } - /* "ssh2/session.pyx":115 + /* "ssh2/session.pyx":114 * with nogil: * timeout = c_ssh2.libssh2_session_get_timeout(self._session) * return timeout # <<<<<<<<<<<<<< @@ -2601,13 +2601,13 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_16get_timeout(struct __pyx_obj * def userauth_authenticated(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_timeout); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 115, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_timeout); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":110 + /* "ssh2/session.pyx":109 * c_ssh2.libssh2_session_set_timeout(self._session, timeout) * * def get_timeout(self): # <<<<<<<<<<<<<< @@ -2626,7 +2626,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_16get_timeout(struct __pyx_obj return __pyx_r; } -/* "ssh2/session.pyx":117 +/* "ssh2/session.pyx":116 * return timeout * * def userauth_authenticated(self): # <<<<<<<<<<<<<< @@ -2656,7 +2656,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_18userauth_authenticated(struc PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("userauth_authenticated", 0); - /* "ssh2/session.pyx":122 + /* "ssh2/session.pyx":121 * :rtype: bool""" * cdef bint rc * with nogil: # <<<<<<<<<<<<<< @@ -2671,7 +2671,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_18userauth_authenticated(struc #endif /*try:*/ { - /* "ssh2/session.pyx":123 + /* "ssh2/session.pyx":122 * cdef bint rc * with nogil: * rc = c_ssh2.libssh2_userauth_authenticated(self._session) # <<<<<<<<<<<<<< @@ -2681,7 +2681,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_18userauth_authenticated(struc __pyx_v_rc = libssh2_userauth_authenticated(__pyx_v_self->_session); } - /* "ssh2/session.pyx":122 + /* "ssh2/session.pyx":121 * :rtype: bool""" * cdef bint rc * with nogil: # <<<<<<<<<<<<<< @@ -2700,7 +2700,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_18userauth_authenticated(struc } } - /* "ssh2/session.pyx":124 + /* "ssh2/session.pyx":123 * with nogil: * rc = c_ssh2.libssh2_userauth_authenticated(self._session) * return bool(rc) # <<<<<<<<<<<<<< @@ -2709,13 +2709,13 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_18userauth_authenticated(struc */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_v_rc; - __pyx_t_2 = __Pyx_PyBool_FromLong((!(!__pyx_t_1))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 124, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBool_FromLong((!(!__pyx_t_1))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":117 + /* "ssh2/session.pyx":116 * return timeout * * def userauth_authenticated(self): # <<<<<<<<<<<<<< @@ -2734,7 +2734,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_18userauth_authenticated(struc return __pyx_r; } -/* "ssh2/session.pyx":126 +/* "ssh2/session.pyx":125 * return bool(rc) * * def userauth_list(self, username not None): # <<<<<<<<<<<<<< @@ -2750,7 +2750,7 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_21userauth_list(PyObject *__py __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("userauth_list (wrapper)", 0); if (unlikely(((PyObject *)__pyx_v_username) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "username"); __PYX_ERR(0, 126, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "username"); __PYX_ERR(0, 125, __pyx_L1_error) } __pyx_r = __pyx_pf_4ssh2_7session_7Session_20userauth_list(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), ((PyObject *)__pyx_v_username)); @@ -2776,7 +2776,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_20userauth_list(struct __pyx_o PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("userauth_list", 0); - /* "ssh2/session.pyx":130 + /* "ssh2/session.pyx":129 * * :rtype: list""" * cdef char *_username = to_bytes(username) # <<<<<<<<<<<<<< @@ -2785,7 +2785,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_20userauth_list(struct __pyx_o */ __pyx_v__username = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_username); - /* "ssh2/session.pyx":131 + /* "ssh2/session.pyx":130 * :rtype: list""" * cdef char *_username = to_bytes(username) * cdef size_t username_len = len(_username) # <<<<<<<<<<<<<< @@ -2795,7 +2795,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_20userauth_list(struct __pyx_o __pyx_t_1 = strlen(__pyx_v__username); __pyx_v_username_len = __pyx_t_1; - /* "ssh2/session.pyx":134 + /* "ssh2/session.pyx":133 * cdef char *_auth * cdef str auth * with nogil: # <<<<<<<<<<<<<< @@ -2810,7 +2810,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_20userauth_list(struct __pyx_o #endif /*try:*/ { - /* "ssh2/session.pyx":135 + /* "ssh2/session.pyx":134 * cdef str auth * with nogil: * _auth = c_ssh2.libssh2_userauth_list( # <<<<<<<<<<<<<< @@ -2820,7 +2820,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_20userauth_list(struct __pyx_o __pyx_v__auth = libssh2_userauth_list(__pyx_v_self->_session, __pyx_v__username, __pyx_v_username_len); } - /* "ssh2/session.pyx":134 + /* "ssh2/session.pyx":133 * cdef char *_auth * cdef str auth * with nogil: # <<<<<<<<<<<<<< @@ -2839,7 +2839,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_20userauth_list(struct __pyx_o } } - /* "ssh2/session.pyx":137 + /* "ssh2/session.pyx":136 * _auth = c_ssh2.libssh2_userauth_list( * self._session, _username, username_len) * if _auth is NULL: # <<<<<<<<<<<<<< @@ -2849,7 +2849,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_20userauth_list(struct __pyx_o __pyx_t_2 = ((__pyx_v__auth == NULL) != 0); if (__pyx_t_2) { - /* "ssh2/session.pyx":138 + /* "ssh2/session.pyx":137 * self._session, _username, username_len) * if _auth is NULL: * return # <<<<<<<<<<<<<< @@ -2860,7 +2860,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_20userauth_list(struct __pyx_o __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "ssh2/session.pyx":137 + /* "ssh2/session.pyx":136 * _auth = c_ssh2.libssh2_userauth_list( * self._session, _username, username_len) * if _auth is NULL: # <<<<<<<<<<<<<< @@ -2869,20 +2869,20 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_20userauth_list(struct __pyx_o */ } - /* "ssh2/session.pyx":139 + /* "ssh2/session.pyx":138 * if _auth is NULL: * return * auth = to_str(_auth) # <<<<<<<<<<<<<< * return auth.split(',') * */ - __pyx_t_3 = __pyx_f_4ssh2_5utils_to_str(__pyx_v__auth); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 139, __pyx_L1_error) + __pyx_t_3 = __pyx_f_4ssh2_5utils_to_str(__pyx_v__auth); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (!(likely(PyString_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(0, 139, __pyx_L1_error) + if (!(likely(PyString_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(0, 138, __pyx_L1_error) __pyx_v_auth = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; - /* "ssh2/session.pyx":140 + /* "ssh2/session.pyx":139 * return * auth = to_str(_auth) * return auth.split(',') # <<<<<<<<<<<<<< @@ -2890,16 +2890,16 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_20userauth_list(struct __pyx_o * def userauth_publickey_fromfile(self, username not None, */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_auth, __pyx_n_s_split); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 140, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_auth, __pyx_n_s_split); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 140, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":126 + /* "ssh2/session.pyx":125 * return bool(rc) * * def userauth_list(self, username not None): # <<<<<<<<<<<<<< @@ -2920,7 +2920,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_20userauth_list(struct __pyx_o return __pyx_r; } -/* "ssh2/session.pyx":142 +/* "ssh2/session.pyx":141 * return auth.split(',') * * def userauth_publickey_fromfile(self, username not None, # <<<<<<<<<<<<<< @@ -2966,23 +2966,23 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_23userauth_publickey_fromfile( case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_publickey)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("userauth_publickey_fromfile", 1, 4, 4, 1); __PYX_ERR(0, 142, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("userauth_publickey_fromfile", 1, 4, 4, 1); __PYX_ERR(0, 141, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_privatekey)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("userauth_publickey_fromfile", 1, 4, 4, 2); __PYX_ERR(0, 142, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("userauth_publickey_fromfile", 1, 4, 4, 2); __PYX_ERR(0, 141, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_passphrase)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("userauth_publickey_fromfile", 1, 4, 4, 3); __PYX_ERR(0, 142, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("userauth_publickey_fromfile", 1, 4, 4, 3); __PYX_ERR(0, 141, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "userauth_publickey_fromfile") < 0)) __PYX_ERR(0, 142, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "userauth_publickey_fromfile") < 0)) __PYX_ERR(0, 141, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; @@ -2999,23 +2999,23 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_23userauth_publickey_fromfile( } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("userauth_publickey_fromfile", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 142, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("userauth_publickey_fromfile", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 141, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.session.Session.userauth_publickey_fromfile", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(((PyObject *)__pyx_v_username) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "username"); __PYX_ERR(0, 142, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "username"); __PYX_ERR(0, 141, __pyx_L1_error) } if (unlikely(((PyObject *)__pyx_v_publickey) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "publickey"); __PYX_ERR(0, 143, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "publickey"); __PYX_ERR(0, 142, __pyx_L1_error) } if (unlikely(((PyObject *)__pyx_v_privatekey) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "privatekey"); __PYX_ERR(0, 144, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "privatekey"); __PYX_ERR(0, 143, __pyx_L1_error) } if (unlikely(((PyObject *)__pyx_v_passphrase) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "passphrase"); __PYX_ERR(0, 145, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "passphrase"); __PYX_ERR(0, 144, __pyx_L1_error) } __pyx_r = __pyx_pf_4ssh2_7session_7Session_22userauth_publickey_fromfile(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), __pyx_v_username, __pyx_v_publickey, __pyx_v_privatekey, __pyx_v_passphrase); @@ -3039,7 +3039,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_22userauth_publickey_fromfile( PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("userauth_publickey_fromfile", 0); - /* "ssh2/session.pyx":150 + /* "ssh2/session.pyx":149 * :rtype: int""" * cdef int rc * cdef char *_username = to_bytes(username) # <<<<<<<<<<<<<< @@ -3048,7 +3048,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_22userauth_publickey_fromfile( */ __pyx_v__username = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_username); - /* "ssh2/session.pyx":151 + /* "ssh2/session.pyx":150 * cdef int rc * cdef char *_username = to_bytes(username) * cdef char *_publickey = to_bytes(publickey) # <<<<<<<<<<<<<< @@ -3057,7 +3057,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_22userauth_publickey_fromfile( */ __pyx_v__publickey = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_publickey); - /* "ssh2/session.pyx":152 + /* "ssh2/session.pyx":151 * cdef char *_username = to_bytes(username) * cdef char *_publickey = to_bytes(publickey) * cdef char *_privatekey = to_bytes(privatekey) # <<<<<<<<<<<<<< @@ -3066,7 +3066,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_22userauth_publickey_fromfile( */ __pyx_v__privatekey = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_privatekey); - /* "ssh2/session.pyx":153 + /* "ssh2/session.pyx":152 * cdef char *_publickey = to_bytes(publickey) * cdef char *_privatekey = to_bytes(privatekey) * cdef char *_passphrase = to_bytes(passphrase) # <<<<<<<<<<<<<< @@ -3075,7 +3075,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_22userauth_publickey_fromfile( */ __pyx_v__passphrase = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_passphrase); - /* "ssh2/session.pyx":154 + /* "ssh2/session.pyx":153 * cdef char *_privatekey = to_bytes(privatekey) * cdef char *_passphrase = to_bytes(passphrase) * with nogil: # <<<<<<<<<<<<<< @@ -3090,7 +3090,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_22userauth_publickey_fromfile( #endif /*try:*/ { - /* "ssh2/session.pyx":155 + /* "ssh2/session.pyx":154 * cdef char *_passphrase = to_bytes(passphrase) * with nogil: * rc = c_ssh2.libssh2_userauth_publickey_fromfile( # <<<<<<<<<<<<<< @@ -3100,7 +3100,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_22userauth_publickey_fromfile( __pyx_v_rc = libssh2_userauth_publickey_fromfile(__pyx_v_self->_session, __pyx_v__username, __pyx_v__publickey, __pyx_v__privatekey, __pyx_v__passphrase); } - /* "ssh2/session.pyx":154 + /* "ssh2/session.pyx":153 * cdef char *_privatekey = to_bytes(privatekey) * cdef char *_passphrase = to_bytes(passphrase) * with nogil: # <<<<<<<<<<<<<< @@ -3119,7 +3119,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_22userauth_publickey_fromfile( } } - /* "ssh2/session.pyx":157 + /* "ssh2/session.pyx":156 * rc = c_ssh2.libssh2_userauth_publickey_fromfile( * self._session, _username, _publickey, _privatekey, _passphrase) * return rc # <<<<<<<<<<<<<< @@ -3127,13 +3127,13 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_22userauth_publickey_fromfile( * def userauth_publickey(self, username not None, */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 157, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":142 + /* "ssh2/session.pyx":141 * return auth.split(',') * * def userauth_publickey_fromfile(self, username not None, # <<<<<<<<<<<<<< @@ -3152,7 +3152,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_22userauth_publickey_fromfile( return __pyx_r; } -/* "ssh2/session.pyx":159 +/* "ssh2/session.pyx":158 * return rc * * def userauth_publickey(self, username not None, # <<<<<<<<<<<<<< @@ -3192,11 +3192,11 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_25userauth_publickey(PyObject case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pubkeydata)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("userauth_publickey", 1, 2, 2, 1); __PYX_ERR(0, 159, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("userauth_publickey", 1, 2, 2, 1); __PYX_ERR(0, 158, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "userauth_publickey") < 0)) __PYX_ERR(0, 159, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "userauth_publickey") < 0)) __PYX_ERR(0, 158, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -3209,16 +3209,16 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_25userauth_publickey(PyObject } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("userauth_publickey", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 159, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("userauth_publickey", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 158, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.session.Session.userauth_publickey", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(((PyObject *)__pyx_v_username) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "username"); __PYX_ERR(0, 159, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "username"); __PYX_ERR(0, 158, __pyx_L1_error) } - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pubkeydata), (&PyBytes_Type), 0, "pubkeydata", 1))) __PYX_ERR(0, 160, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pubkeydata), (&PyBytes_Type), 0, "pubkeydata", 1))) __PYX_ERR(0, 159, __pyx_L1_error) __pyx_r = __pyx_pf_4ssh2_7session_7Session_24userauth_publickey(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), __pyx_v_username, __pyx_v_pubkeydata); /* function exit code */ @@ -3242,7 +3242,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_24userauth_publickey(struct __ PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("userauth_publickey", 0); - /* "ssh2/session.pyx":171 + /* "ssh2/session.pyx":170 * """ * cdef int rc * cdef char *_username = to_bytes(username) # <<<<<<<<<<<<<< @@ -3251,27 +3251,27 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_24userauth_publickey(struct __ */ __pyx_v__username = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_username); - /* "ssh2/session.pyx":172 + /* "ssh2/session.pyx":171 * cdef int rc * cdef char *_username = to_bytes(username) * cdef unsigned char *_pubkeydata = pubkeydata # <<<<<<<<<<<<<< * cdef size_t pubkeydata_len = len(pubkeydata) * with nogil: */ - __pyx_t_1 = __Pyx_PyObject_AsWritableUString(__pyx_v_pubkeydata); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(0, 172, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_AsWritableUString(__pyx_v_pubkeydata); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(0, 171, __pyx_L1_error) __pyx_v__pubkeydata = __pyx_t_1; - /* "ssh2/session.pyx":173 + /* "ssh2/session.pyx":172 * cdef char *_username = to_bytes(username) * cdef unsigned char *_pubkeydata = pubkeydata * cdef size_t pubkeydata_len = len(pubkeydata) # <<<<<<<<<<<<<< * with nogil: * rc = c_ssh2.libssh2_userauth_publickey( */ - __pyx_t_2 = PyBytes_GET_SIZE(__pyx_v_pubkeydata); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 173, __pyx_L1_error) + __pyx_t_2 = PyBytes_GET_SIZE(__pyx_v_pubkeydata); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 172, __pyx_L1_error) __pyx_v_pubkeydata_len = __pyx_t_2; - /* "ssh2/session.pyx":174 + /* "ssh2/session.pyx":173 * cdef unsigned char *_pubkeydata = pubkeydata * cdef size_t pubkeydata_len = len(pubkeydata) * with nogil: # <<<<<<<<<<<<<< @@ -3286,7 +3286,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_24userauth_publickey(struct __ #endif /*try:*/ { - /* "ssh2/session.pyx":175 + /* "ssh2/session.pyx":174 * cdef size_t pubkeydata_len = len(pubkeydata) * with nogil: * rc = c_ssh2.libssh2_userauth_publickey( # <<<<<<<<<<<<<< @@ -3296,7 +3296,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_24userauth_publickey(struct __ __pyx_v_rc = libssh2_userauth_publickey(__pyx_v_self->_session, __pyx_v__username, __pyx_v__pubkeydata, __pyx_v_pubkeydata_len, NULL, NULL); } - /* "ssh2/session.pyx":174 + /* "ssh2/session.pyx":173 * cdef unsigned char *_pubkeydata = pubkeydata * cdef size_t pubkeydata_len = len(pubkeydata) * with nogil: # <<<<<<<<<<<<<< @@ -3315,7 +3315,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_24userauth_publickey(struct __ } } - /* "ssh2/session.pyx":178 + /* "ssh2/session.pyx":177 * self._session, _username, _pubkeydata, * pubkeydata_len, NULL, NULL) * return rc # <<<<<<<<<<<<<< @@ -3323,13 +3323,13 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_24userauth_publickey(struct __ * def userauth_hostbased_fromfile(self, */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 178, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":159 + /* "ssh2/session.pyx":158 * return rc * * def userauth_publickey(self, username not None, # <<<<<<<<<<<<<< @@ -3348,7 +3348,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_24userauth_publickey(struct __ return __pyx_r; } -/* "ssh2/session.pyx":180 +/* "ssh2/session.pyx":179 * return rc * * def userauth_hostbased_fromfile(self, # <<<<<<<<<<<<<< @@ -3397,29 +3397,29 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_27userauth_hostbased_fromfile( case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_publickey)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("userauth_hostbased_fromfile", 1, 5, 5, 1); __PYX_ERR(0, 180, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("userauth_hostbased_fromfile", 1, 5, 5, 1); __PYX_ERR(0, 179, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_privatekey)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("userauth_hostbased_fromfile", 1, 5, 5, 2); __PYX_ERR(0, 180, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("userauth_hostbased_fromfile", 1, 5, 5, 2); __PYX_ERR(0, 179, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_passphrase)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("userauth_hostbased_fromfile", 1, 5, 5, 3); __PYX_ERR(0, 180, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("userauth_hostbased_fromfile", 1, 5, 5, 3); __PYX_ERR(0, 179, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_hostname)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("userauth_hostbased_fromfile", 1, 5, 5, 4); __PYX_ERR(0, 180, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("userauth_hostbased_fromfile", 1, 5, 5, 4); __PYX_ERR(0, 179, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "userauth_hostbased_fromfile") < 0)) __PYX_ERR(0, 180, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "userauth_hostbased_fromfile") < 0)) __PYX_ERR(0, 179, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 5) { goto __pyx_L5_argtuple_error; @@ -3438,26 +3438,26 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_27userauth_hostbased_fromfile( } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("userauth_hostbased_fromfile", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 180, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("userauth_hostbased_fromfile", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 179, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.session.Session.userauth_hostbased_fromfile", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(((PyObject *)__pyx_v_username) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "username"); __PYX_ERR(0, 181, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "username"); __PYX_ERR(0, 180, __pyx_L1_error) } if (unlikely(((PyObject *)__pyx_v_publickey) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "publickey"); __PYX_ERR(0, 182, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "publickey"); __PYX_ERR(0, 181, __pyx_L1_error) } if (unlikely(((PyObject *)__pyx_v_privatekey) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "privatekey"); __PYX_ERR(0, 183, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "privatekey"); __PYX_ERR(0, 182, __pyx_L1_error) } if (unlikely(((PyObject *)__pyx_v_passphrase) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "passphrase"); __PYX_ERR(0, 184, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "passphrase"); __PYX_ERR(0, 183, __pyx_L1_error) } if (unlikely(((PyObject *)__pyx_v_hostname) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "hostname"); __PYX_ERR(0, 185, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "hostname"); __PYX_ERR(0, 184, __pyx_L1_error) } __pyx_r = __pyx_pf_4ssh2_7session_7Session_26userauth_hostbased_fromfile(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), __pyx_v_username, __pyx_v_publickey, __pyx_v_privatekey, __pyx_v_passphrase, __pyx_v_hostname); @@ -3482,7 +3482,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_26userauth_hostbased_fromfile( PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("userauth_hostbased_fromfile", 0); - /* "ssh2/session.pyx":187 + /* "ssh2/session.pyx":186 * hostname not None): * cdef int rc * cdef char *_username = to_bytes(username) # <<<<<<<<<<<<<< @@ -3491,7 +3491,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_26userauth_hostbased_fromfile( */ __pyx_v__username = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_username); - /* "ssh2/session.pyx":188 + /* "ssh2/session.pyx":187 * cdef int rc * cdef char *_username = to_bytes(username) * cdef char *_publickey = to_bytes(publickey) # <<<<<<<<<<<<<< @@ -3500,7 +3500,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_26userauth_hostbased_fromfile( */ __pyx_v__publickey = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_publickey); - /* "ssh2/session.pyx":189 + /* "ssh2/session.pyx":188 * cdef char *_username = to_bytes(username) * cdef char *_publickey = to_bytes(publickey) * cdef char *_privatekey = to_bytes(privatekey) # <<<<<<<<<<<<<< @@ -3509,7 +3509,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_26userauth_hostbased_fromfile( */ __pyx_v__privatekey = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_privatekey); - /* "ssh2/session.pyx":190 + /* "ssh2/session.pyx":189 * cdef char *_publickey = to_bytes(publickey) * cdef char *_privatekey = to_bytes(privatekey) * cdef char *_passphrase = to_bytes(passphrase) # <<<<<<<<<<<<<< @@ -3518,7 +3518,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_26userauth_hostbased_fromfile( */ __pyx_v__passphrase = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_passphrase); - /* "ssh2/session.pyx":191 + /* "ssh2/session.pyx":190 * cdef char *_privatekey = to_bytes(privatekey) * cdef char *_passphrase = to_bytes(passphrase) * cdef char *_hostname = to_bytes(hostname) # <<<<<<<<<<<<<< @@ -3527,7 +3527,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_26userauth_hostbased_fromfile( */ __pyx_v__hostname = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_hostname); - /* "ssh2/session.pyx":192 + /* "ssh2/session.pyx":191 * cdef char *_passphrase = to_bytes(passphrase) * cdef char *_hostname = to_bytes(hostname) * with nogil: # <<<<<<<<<<<<<< @@ -3542,7 +3542,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_26userauth_hostbased_fromfile( #endif /*try:*/ { - /* "ssh2/session.pyx":193 + /* "ssh2/session.pyx":192 * cdef char *_hostname = to_bytes(hostname) * with nogil: * rc = c_ssh2.libssh2_userauth_hostbased_fromfile( # <<<<<<<<<<<<<< @@ -3552,7 +3552,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_26userauth_hostbased_fromfile( __pyx_v_rc = libssh2_userauth_hostbased_fromfile(__pyx_v_self->_session, __pyx_v__username, __pyx_v__publickey, __pyx_v__privatekey, __pyx_v__passphrase, __pyx_v__hostname); } - /* "ssh2/session.pyx":192 + /* "ssh2/session.pyx":191 * cdef char *_passphrase = to_bytes(passphrase) * cdef char *_hostname = to_bytes(hostname) * with nogil: # <<<<<<<<<<<<<< @@ -3571,7 +3571,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_26userauth_hostbased_fromfile( } } - /* "ssh2/session.pyx":196 + /* "ssh2/session.pyx":195 * self._session, _username, _publickey, * _privatekey, _passphrase, _hostname) * return rc # <<<<<<<<<<<<<< @@ -3579,13 +3579,13 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_26userauth_hostbased_fromfile( * # def userauth_publickey_frommemory(self, */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 196, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":180 + /* "ssh2/session.pyx":179 * return rc * * def userauth_hostbased_fromfile(self, # <<<<<<<<<<<<<< @@ -3604,7 +3604,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_26userauth_hostbased_fromfile( return __pyx_r; } -/* "ssh2/session.pyx":214 +/* "ssh2/session.pyx":213 * # return rc * * def userauth_password(self, username not None, password not None): # <<<<<<<<<<<<<< @@ -3644,11 +3644,11 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_29userauth_password(PyObject * case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_password)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("userauth_password", 1, 2, 2, 1); __PYX_ERR(0, 214, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("userauth_password", 1, 2, 2, 1); __PYX_ERR(0, 213, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "userauth_password") < 0)) __PYX_ERR(0, 214, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "userauth_password") < 0)) __PYX_ERR(0, 213, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -3661,17 +3661,17 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_29userauth_password(PyObject * } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("userauth_password", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 214, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("userauth_password", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 213, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.session.Session.userauth_password", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(((PyObject *)__pyx_v_username) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "username"); __PYX_ERR(0, 214, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "username"); __PYX_ERR(0, 213, __pyx_L1_error) } if (unlikely(((PyObject *)__pyx_v_password) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "password"); __PYX_ERR(0, 214, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "password"); __PYX_ERR(0, 213, __pyx_L1_error) } __pyx_r = __pyx_pf_4ssh2_7session_7Session_28userauth_password(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), __pyx_v_username, __pyx_v_password); @@ -3693,7 +3693,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_28userauth_password(struct __p PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("userauth_password", 0); - /* "ssh2/session.pyx":222 + /* "ssh2/session.pyx":221 * :type password: str""" * cdef int rc * cdef const char *_username = to_bytes(username) # <<<<<<<<<<<<<< @@ -3702,7 +3702,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_28userauth_password(struct __p */ __pyx_v__username = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_username); - /* "ssh2/session.pyx":223 + /* "ssh2/session.pyx":222 * cdef int rc * cdef const char *_username = to_bytes(username) * cdef const char *_password = to_bytes(password) # <<<<<<<<<<<<<< @@ -3711,7 +3711,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_28userauth_password(struct __p */ __pyx_v__password = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_password); - /* "ssh2/session.pyx":224 + /* "ssh2/session.pyx":223 * cdef const char *_username = to_bytes(username) * cdef const char *_password = to_bytes(password) * with nogil: # <<<<<<<<<<<<<< @@ -3726,7 +3726,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_28userauth_password(struct __p #endif /*try:*/ { - /* "ssh2/session.pyx":225 + /* "ssh2/session.pyx":224 * cdef const char *_password = to_bytes(password) * with nogil: * rc = c_ssh2.libssh2_userauth_password( # <<<<<<<<<<<<<< @@ -3736,7 +3736,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_28userauth_password(struct __p __pyx_v_rc = libssh2_userauth_password(__pyx_v_self->_session, __pyx_v__username, __pyx_v__password); } - /* "ssh2/session.pyx":224 + /* "ssh2/session.pyx":223 * cdef const char *_username = to_bytes(username) * cdef const char *_password = to_bytes(password) * with nogil: # <<<<<<<<<<<<<< @@ -3755,7 +3755,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_28userauth_password(struct __p } } - /* "ssh2/session.pyx":227 + /* "ssh2/session.pyx":226 * rc = c_ssh2.libssh2_userauth_password( * self._session, _username, _password) * return rc # <<<<<<<<<<<<<< @@ -3763,13 +3763,13 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_28userauth_password(struct __p * def agent_init(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 227, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":214 + /* "ssh2/session.pyx":213 * # return rc * * def userauth_password(self, username not None, password not None): # <<<<<<<<<<<<<< @@ -3788,7 +3788,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_28userauth_password(struct __p return __pyx_r; } -/* "ssh2/session.pyx":229 +/* "ssh2/session.pyx":228 * return rc * * def agent_init(self): # <<<<<<<<<<<<<< @@ -3818,7 +3818,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_30agent_init(struct __pyx_obj_ PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("agent_init", 0); - /* "ssh2/session.pyx":234 + /* "ssh2/session.pyx":233 * :rtype: :py:class:`ssh2.agent.Agent` * """ * cdef c_ssh2.LIBSSH2_AGENT *agent = self._agent_init() # <<<<<<<<<<<<<< @@ -3827,7 +3827,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_30agent_init(struct __pyx_obj_ */ __pyx_v_agent = ((struct __pyx_vtabstruct_4ssh2_7session_Session *)__pyx_v_self->__pyx_vtab)->_agent_init(__pyx_v_self); - /* "ssh2/session.pyx":235 + /* "ssh2/session.pyx":234 * """ * cdef c_ssh2.LIBSSH2_AGENT *agent = self._agent_init() * if agent is NULL: # <<<<<<<<<<<<<< @@ -3837,7 +3837,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_30agent_init(struct __pyx_obj_ __pyx_t_1 = ((__pyx_v_agent == NULL) != 0); if (__pyx_t_1) { - /* "ssh2/session.pyx":236 + /* "ssh2/session.pyx":235 * cdef c_ssh2.LIBSSH2_AGENT *agent = self._agent_init() * if agent is NULL: * return # <<<<<<<<<<<<<< @@ -3848,7 +3848,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_30agent_init(struct __pyx_obj_ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "ssh2/session.pyx":235 + /* "ssh2/session.pyx":234 * """ * cdef c_ssh2.LIBSSH2_AGENT *agent = self._agent_init() * if agent is NULL: # <<<<<<<<<<<<<< @@ -3857,7 +3857,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_30agent_init(struct __pyx_obj_ */ } - /* "ssh2/session.pyx":237 + /* "ssh2/session.pyx":236 * if agent is NULL: * return * return PyAgent(agent, self) # <<<<<<<<<<<<<< @@ -3865,13 +3865,13 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_30agent_init(struct __pyx_obj_ * cdef c_ssh2.LIBSSH2_AGENT * _agent_init(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __pyx_f_4ssh2_5agent_PyAgent(__pyx_v_agent, __pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 237, __pyx_L1_error) + __pyx_t_2 = __pyx_f_4ssh2_5agent_PyAgent(__pyx_v_agent, __pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":229 + /* "ssh2/session.pyx":228 * return rc * * def agent_init(self): # <<<<<<<<<<<<<< @@ -3890,7 +3890,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_30agent_init(struct __pyx_obj_ return __pyx_r; } -/* "ssh2/session.pyx":239 +/* "ssh2/session.pyx":238 * return PyAgent(agent, self) * * cdef c_ssh2.LIBSSH2_AGENT * _agent_init(self): # <<<<<<<<<<<<<< @@ -3905,7 +3905,7 @@ static LIBSSH2_AGENT *__pyx_f_4ssh2_7session_7Session__agent_init(struct __pyx_o int __pyx_t_1; __Pyx_RefNannySetupContext("_agent_init", 0); - /* "ssh2/session.pyx":241 + /* "ssh2/session.pyx":240 * cdef c_ssh2.LIBSSH2_AGENT * _agent_init(self): * cdef c_ssh2.LIBSSH2_AGENT *agent * with nogil: # <<<<<<<<<<<<<< @@ -3920,7 +3920,7 @@ static LIBSSH2_AGENT *__pyx_f_4ssh2_7session_7Session__agent_init(struct __pyx_o #endif /*try:*/ { - /* "ssh2/session.pyx":242 + /* "ssh2/session.pyx":241 * cdef c_ssh2.LIBSSH2_AGENT *agent * with nogil: * agent = c_ssh2.libssh2_agent_init(self._session) # <<<<<<<<<<<<<< @@ -3929,7 +3929,7 @@ static LIBSSH2_AGENT *__pyx_f_4ssh2_7session_7Session__agent_init(struct __pyx_o */ __pyx_v_agent = libssh2_agent_init(__pyx_v_self->_session); - /* "ssh2/session.pyx":243 + /* "ssh2/session.pyx":242 * with nogil: * agent = c_ssh2.libssh2_agent_init(self._session) * if agent is NULL: # <<<<<<<<<<<<<< @@ -3939,7 +3939,7 @@ static LIBSSH2_AGENT *__pyx_f_4ssh2_7session_7Session__agent_init(struct __pyx_o __pyx_t_1 = ((__pyx_v_agent == NULL) != 0); if (__pyx_t_1) { - /* "ssh2/session.pyx":244 + /* "ssh2/session.pyx":243 * agent = c_ssh2.libssh2_agent_init(self._session) * if agent is NULL: * with gil: # <<<<<<<<<<<<<< @@ -3952,17 +3952,17 @@ static LIBSSH2_AGENT *__pyx_f_4ssh2_7session_7Session__agent_init(struct __pyx_o #endif /*try:*/ { - /* "ssh2/session.pyx":245 + /* "ssh2/session.pyx":244 * if agent is NULL: * with gil: * raise MemoryError # <<<<<<<<<<<<<< * return agent * */ - PyErr_NoMemory(); __PYX_ERR(0, 245, __pyx_L8_error) + PyErr_NoMemory(); __PYX_ERR(0, 244, __pyx_L8_error) } - /* "ssh2/session.pyx":244 + /* "ssh2/session.pyx":243 * agent = c_ssh2.libssh2_agent_init(self._session) * if agent is NULL: * with gil: # <<<<<<<<<<<<<< @@ -3979,7 +3979,7 @@ static LIBSSH2_AGENT *__pyx_f_4ssh2_7session_7Session__agent_init(struct __pyx_o } } - /* "ssh2/session.pyx":243 + /* "ssh2/session.pyx":242 * with nogil: * agent = c_ssh2.libssh2_agent_init(self._session) * if agent is NULL: # <<<<<<<<<<<<<< @@ -3988,7 +3988,7 @@ static LIBSSH2_AGENT *__pyx_f_4ssh2_7session_7Session__agent_init(struct __pyx_o */ } - /* "ssh2/session.pyx":246 + /* "ssh2/session.pyx":245 * with gil: * raise MemoryError * return agent # <<<<<<<<<<<<<< @@ -3999,7 +3999,7 @@ static LIBSSH2_AGENT *__pyx_f_4ssh2_7session_7Session__agent_init(struct __pyx_o goto __pyx_L3_return; } - /* "ssh2/session.pyx":241 + /* "ssh2/session.pyx":240 * cdef c_ssh2.LIBSSH2_AGENT * _agent_init(self): * cdef c_ssh2.LIBSSH2_AGENT *agent * with nogil: # <<<<<<<<<<<<<< @@ -4024,7 +4024,7 @@ static LIBSSH2_AGENT *__pyx_f_4ssh2_7session_7Session__agent_init(struct __pyx_o } } - /* "ssh2/session.pyx":239 + /* "ssh2/session.pyx":238 * return PyAgent(agent, self) * * cdef c_ssh2.LIBSSH2_AGENT * _agent_init(self): # <<<<<<<<<<<<<< @@ -4041,7 +4041,7 @@ static LIBSSH2_AGENT *__pyx_f_4ssh2_7session_7Session__agent_init(struct __pyx_o return __pyx_r; } -/* "ssh2/session.pyx":248 +/* "ssh2/session.pyx":247 * return agent * * cdef c_ssh2.LIBSSH2_AGENT * init_connect_agent(self) nogil except NULL: # <<<<<<<<<<<<<< @@ -4063,7 +4063,7 @@ static LIBSSH2_AGENT *__pyx_f_4ssh2_7session_7Session_init_connect_agent(struct __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif - /* "ssh2/session.pyx":249 + /* "ssh2/session.pyx":248 * * cdef c_ssh2.LIBSSH2_AGENT * init_connect_agent(self) nogil except NULL: * agent = c_ssh2.libssh2_agent_init(self._session) # <<<<<<<<<<<<<< @@ -4073,7 +4073,7 @@ static LIBSSH2_AGENT *__pyx_f_4ssh2_7session_7Session_init_connect_agent(struct /*try:*/ { __pyx_v_agent = libssh2_agent_init(__pyx_v_self->_session); - /* "ssh2/session.pyx":250 + /* "ssh2/session.pyx":249 * cdef c_ssh2.LIBSSH2_AGENT * init_connect_agent(self) nogil except NULL: * agent = c_ssh2.libssh2_agent_init(self._session) * if agent is NULL: # <<<<<<<<<<<<<< @@ -4083,7 +4083,7 @@ static LIBSSH2_AGENT *__pyx_f_4ssh2_7session_7Session_init_connect_agent(struct __pyx_t_1 = ((__pyx_v_agent == NULL) != 0); if (__pyx_t_1) { - /* "ssh2/session.pyx":251 + /* "ssh2/session.pyx":250 * agent = c_ssh2.libssh2_agent_init(self._session) * if agent is NULL: * with gil: # <<<<<<<<<<<<<< @@ -4096,17 +4096,17 @@ static LIBSSH2_AGENT *__pyx_f_4ssh2_7session_7Session_init_connect_agent(struct #endif /*try:*/ { - /* "ssh2/session.pyx":252 + /* "ssh2/session.pyx":251 * if agent is NULL: * with gil: * raise MemoryError # <<<<<<<<<<<<<< * if c_ssh2.libssh2_agent_connect(agent) != 0: * c_ssh2.libssh2_agent_free(agent) */ - PyErr_NoMemory(); __PYX_ERR(0, 252, __pyx_L8_error) + PyErr_NoMemory(); __PYX_ERR(0, 251, __pyx_L8_error) } - /* "ssh2/session.pyx":251 + /* "ssh2/session.pyx":250 * agent = c_ssh2.libssh2_agent_init(self._session) * if agent is NULL: * with gil: # <<<<<<<<<<<<<< @@ -4123,7 +4123,7 @@ static LIBSSH2_AGENT *__pyx_f_4ssh2_7session_7Session_init_connect_agent(struct } } - /* "ssh2/session.pyx":250 + /* "ssh2/session.pyx":249 * cdef c_ssh2.LIBSSH2_AGENT * init_connect_agent(self) nogil except NULL: * agent = c_ssh2.libssh2_agent_init(self._session) * if agent is NULL: # <<<<<<<<<<<<<< @@ -4132,7 +4132,7 @@ static LIBSSH2_AGENT *__pyx_f_4ssh2_7session_7Session_init_connect_agent(struct */ } - /* "ssh2/session.pyx":253 + /* "ssh2/session.pyx":252 * with gil: * raise MemoryError * if c_ssh2.libssh2_agent_connect(agent) != 0: # <<<<<<<<<<<<<< @@ -4142,7 +4142,7 @@ static LIBSSH2_AGENT *__pyx_f_4ssh2_7session_7Session_init_connect_agent(struct __pyx_t_1 = ((libssh2_agent_connect(__pyx_v_agent) != 0) != 0); if (__pyx_t_1) { - /* "ssh2/session.pyx":254 + /* "ssh2/session.pyx":253 * raise MemoryError * if c_ssh2.libssh2_agent_connect(agent) != 0: * c_ssh2.libssh2_agent_free(agent) # <<<<<<<<<<<<<< @@ -4151,7 +4151,7 @@ static LIBSSH2_AGENT *__pyx_f_4ssh2_7session_7Session_init_connect_agent(struct */ libssh2_agent_free(__pyx_v_agent); - /* "ssh2/session.pyx":255 + /* "ssh2/session.pyx":254 * if c_ssh2.libssh2_agent_connect(agent) != 0: * c_ssh2.libssh2_agent_free(agent) * with gil: # <<<<<<<<<<<<<< @@ -4164,21 +4164,21 @@ static LIBSSH2_AGENT *__pyx_f_4ssh2_7session_7Session_init_connect_agent(struct #endif /*try:*/ { - /* "ssh2/session.pyx":256 + /* "ssh2/session.pyx":255 * c_ssh2.libssh2_agent_free(agent) * with gil: * raise AgentConnectionError("Unable to connect to agent") # <<<<<<<<<<<<<< * return agent * */ - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4ssh2_10exceptions_AgentConnectionError), __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 256, __pyx_L12_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4ssh2_10exceptions_AgentConnectionError), __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 255, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 256, __pyx_L12_error) + __PYX_ERR(0, 255, __pyx_L12_error) } - /* "ssh2/session.pyx":255 + /* "ssh2/session.pyx":254 * if c_ssh2.libssh2_agent_connect(agent) != 0: * c_ssh2.libssh2_agent_free(agent) * with gil: # <<<<<<<<<<<<<< @@ -4195,7 +4195,7 @@ static LIBSSH2_AGENT *__pyx_f_4ssh2_7session_7Session_init_connect_agent(struct } } - /* "ssh2/session.pyx":253 + /* "ssh2/session.pyx":252 * with gil: * raise MemoryError * if c_ssh2.libssh2_agent_connect(agent) != 0: # <<<<<<<<<<<<<< @@ -4204,7 +4204,7 @@ static LIBSSH2_AGENT *__pyx_f_4ssh2_7session_7Session_init_connect_agent(struct */ } - /* "ssh2/session.pyx":257 + /* "ssh2/session.pyx":256 * with gil: * raise AgentConnectionError("Unable to connect to agent") * return agent # <<<<<<<<<<<<<< @@ -4215,7 +4215,7 @@ static LIBSSH2_AGENT *__pyx_f_4ssh2_7session_7Session_init_connect_agent(struct goto __pyx_L3_return; } - /* "ssh2/session.pyx":249 + /* "ssh2/session.pyx":248 * * cdef c_ssh2.LIBSSH2_AGENT * init_connect_agent(self) nogil except NULL: * agent = c_ssh2.libssh2_agent_init(self._session) # <<<<<<<<<<<<<< @@ -4237,7 +4237,7 @@ static LIBSSH2_AGENT *__pyx_f_4ssh2_7session_7Session_init_connect_agent(struct } } - /* "ssh2/session.pyx":248 + /* "ssh2/session.pyx":247 * return agent * * cdef c_ssh2.LIBSSH2_AGENT * init_connect_agent(self) nogil except NULL: # <<<<<<<<<<<<<< @@ -4259,7 +4259,7 @@ static LIBSSH2_AGENT *__pyx_f_4ssh2_7session_7Session_init_connect_agent(struct return __pyx_r; } -/* "ssh2/session.pyx":259 +/* "ssh2/session.pyx":258 * return agent * * def agent_auth(self, username not None): # <<<<<<<<<<<<<< @@ -4275,7 +4275,7 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_33agent_auth(PyObject *__pyx_v __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("agent_auth (wrapper)", 0); if (unlikely(((PyObject *)__pyx_v_username) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "username"); __PYX_ERR(0, 259, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "username"); __PYX_ERR(0, 258, __pyx_L1_error) } __pyx_r = __pyx_pf_4ssh2_7session_7Session_32agent_auth(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), ((PyObject *)__pyx_v_username)); @@ -4301,7 +4301,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_32agent_auth(struct __pyx_obj_ int __pyx_t_4; __Pyx_RefNannySetupContext("agent_auth", 0); - /* "ssh2/session.pyx":287 + /* "ssh2/session.pyx":286 * :rtype: None * """ * cdef char *_username = to_bytes(username) # <<<<<<<<<<<<<< @@ -4310,7 +4310,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_32agent_auth(struct __pyx_obj_ */ __pyx_v__username = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_username); - /* "ssh2/session.pyx":288 + /* "ssh2/session.pyx":287 * """ * cdef char *_username = to_bytes(username) * cdef c_ssh2.LIBSSH2_AGENT *agent = NULL # <<<<<<<<<<<<<< @@ -4319,7 +4319,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_32agent_auth(struct __pyx_obj_ */ __pyx_v_agent = NULL; - /* "ssh2/session.pyx":289 + /* "ssh2/session.pyx":288 * cdef char *_username = to_bytes(username) * cdef c_ssh2.LIBSSH2_AGENT *agent = NULL * cdef c_ssh2.libssh2_agent_publickey *identity = NULL # <<<<<<<<<<<<<< @@ -4328,7 +4328,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_32agent_auth(struct __pyx_obj_ */ __pyx_v_identity = NULL; - /* "ssh2/session.pyx":290 + /* "ssh2/session.pyx":289 * cdef c_ssh2.LIBSSH2_AGENT *agent = NULL * cdef c_ssh2.libssh2_agent_publickey *identity = NULL * cdef c_ssh2.libssh2_agent_publickey *prev = NULL # <<<<<<<<<<<<<< @@ -4337,7 +4337,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_32agent_auth(struct __pyx_obj_ */ __pyx_v_prev = NULL; - /* "ssh2/session.pyx":291 + /* "ssh2/session.pyx":290 * cdef c_ssh2.libssh2_agent_publickey *identity = NULL * cdef c_ssh2.libssh2_agent_publickey *prev = NULL * with nogil: # <<<<<<<<<<<<<< @@ -4352,17 +4352,17 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_32agent_auth(struct __pyx_obj_ #endif /*try:*/ { - /* "ssh2/session.pyx":292 + /* "ssh2/session.pyx":291 * cdef c_ssh2.libssh2_agent_publickey *prev = NULL * with nogil: * agent = self.init_connect_agent() # <<<<<<<<<<<<<< * if c_ssh2.libssh2_agent_list_identities(agent) != 0: * clear_agent(agent) */ - __pyx_t_1 = ((struct __pyx_vtabstruct_4ssh2_7session_Session *)__pyx_v_self->__pyx_vtab)->init_connect_agent(__pyx_v_self); if (unlikely(__pyx_t_1 == NULL)) __PYX_ERR(0, 292, __pyx_L4_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_4ssh2_7session_Session *)__pyx_v_self->__pyx_vtab)->init_connect_agent(__pyx_v_self); if (unlikely(__pyx_t_1 == NULL)) __PYX_ERR(0, 291, __pyx_L4_error) __pyx_v_agent = __pyx_t_1; - /* "ssh2/session.pyx":293 + /* "ssh2/session.pyx":292 * with nogil: * agent = self.init_connect_agent() * if c_ssh2.libssh2_agent_list_identities(agent) != 0: # <<<<<<<<<<<<<< @@ -4372,7 +4372,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_32agent_auth(struct __pyx_obj_ __pyx_t_2 = ((libssh2_agent_list_identities(__pyx_v_agent) != 0) != 0); if (__pyx_t_2) { - /* "ssh2/session.pyx":294 + /* "ssh2/session.pyx":293 * agent = self.init_connect_agent() * if c_ssh2.libssh2_agent_list_identities(agent) != 0: * clear_agent(agent) # <<<<<<<<<<<<<< @@ -4381,7 +4381,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_32agent_auth(struct __pyx_obj_ */ __pyx_f_4ssh2_5agent_clear_agent(__pyx_v_agent); - /* "ssh2/session.pyx":295 + /* "ssh2/session.pyx":294 * if c_ssh2.libssh2_agent_list_identities(agent) != 0: * clear_agent(agent) * with gil: # <<<<<<<<<<<<<< @@ -4394,21 +4394,21 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_32agent_auth(struct __pyx_obj_ #endif /*try:*/ { - /* "ssh2/session.pyx":296 + /* "ssh2/session.pyx":295 * clear_agent(agent) * with gil: * raise AgentListIdentitiesError( # <<<<<<<<<<<<<< * "Failure requesting identities from agent") * while 1: */ - __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4ssh2_10exceptions_AgentListIdentitiesError), __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 296, __pyx_L8_error) + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4ssh2_10exceptions_AgentListIdentitiesError), __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 295, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 296, __pyx_L8_error) + __PYX_ERR(0, 295, __pyx_L8_error) } - /* "ssh2/session.pyx":295 + /* "ssh2/session.pyx":294 * if c_ssh2.libssh2_agent_list_identities(agent) != 0: * clear_agent(agent) * with gil: # <<<<<<<<<<<<<< @@ -4425,7 +4425,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_32agent_auth(struct __pyx_obj_ } } - /* "ssh2/session.pyx":293 + /* "ssh2/session.pyx":292 * with nogil: * agent = self.init_connect_agent() * if c_ssh2.libssh2_agent_list_identities(agent) != 0: # <<<<<<<<<<<<<< @@ -4434,7 +4434,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_32agent_auth(struct __pyx_obj_ */ } - /* "ssh2/session.pyx":298 + /* "ssh2/session.pyx":297 * raise AgentListIdentitiesError( * "Failure requesting identities from agent") * while 1: # <<<<<<<<<<<<<< @@ -4443,16 +4443,16 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_32agent_auth(struct __pyx_obj_ */ while (1) { - /* "ssh2/session.pyx":299 + /* "ssh2/session.pyx":298 * "Failure requesting identities from agent") * while 1: * auth_identity(_username, agent, &identity, prev) # <<<<<<<<<<<<<< * if c_ssh2.libssh2_agent_userauth( * agent, _username, identity) == 0: */ - __pyx_t_4 = __pyx_f_4ssh2_5agent_auth_identity(__pyx_v__username, __pyx_v_agent, (&__pyx_v_identity), __pyx_v_prev); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 299, __pyx_L4_error) + __pyx_t_4 = __pyx_f_4ssh2_5agent_auth_identity(__pyx_v__username, __pyx_v_agent, (&__pyx_v_identity), __pyx_v_prev); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 298, __pyx_L4_error) - /* "ssh2/session.pyx":301 + /* "ssh2/session.pyx":300 * auth_identity(_username, agent, &identity, prev) * if c_ssh2.libssh2_agent_userauth( * agent, _username, identity) == 0: # <<<<<<<<<<<<<< @@ -4461,7 +4461,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_32agent_auth(struct __pyx_obj_ */ __pyx_t_2 = ((libssh2_agent_userauth(__pyx_v_agent, __pyx_v__username, __pyx_v_identity) == 0) != 0); - /* "ssh2/session.pyx":300 + /* "ssh2/session.pyx":299 * while 1: * auth_identity(_username, agent, &identity, prev) * if c_ssh2.libssh2_agent_userauth( # <<<<<<<<<<<<<< @@ -4470,7 +4470,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_32agent_auth(struct __pyx_obj_ */ if (__pyx_t_2) { - /* "ssh2/session.pyx":302 + /* "ssh2/session.pyx":301 * if c_ssh2.libssh2_agent_userauth( * agent, _username, identity) == 0: * break # <<<<<<<<<<<<<< @@ -4479,7 +4479,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_32agent_auth(struct __pyx_obj_ */ goto __pyx_L11_break; - /* "ssh2/session.pyx":300 + /* "ssh2/session.pyx":299 * while 1: * auth_identity(_username, agent, &identity, prev) * if c_ssh2.libssh2_agent_userauth( # <<<<<<<<<<<<<< @@ -4488,7 +4488,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_32agent_auth(struct __pyx_obj_ */ } - /* "ssh2/session.pyx":303 + /* "ssh2/session.pyx":302 * agent, _username, identity) == 0: * break * prev = identity # <<<<<<<<<<<<<< @@ -4499,7 +4499,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_32agent_auth(struct __pyx_obj_ } __pyx_L11_break:; - /* "ssh2/session.pyx":304 + /* "ssh2/session.pyx":303 * break * prev = identity * clear_agent(agent) # <<<<<<<<<<<<<< @@ -4509,7 +4509,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_32agent_auth(struct __pyx_obj_ __pyx_f_4ssh2_5agent_clear_agent(__pyx_v_agent); } - /* "ssh2/session.pyx":291 + /* "ssh2/session.pyx":290 * cdef c_ssh2.libssh2_agent_publickey *identity = NULL * cdef c_ssh2.libssh2_agent_publickey *prev = NULL * with nogil: # <<<<<<<<<<<<<< @@ -4535,7 +4535,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_32agent_auth(struct __pyx_obj_ } } - /* "ssh2/session.pyx":259 + /* "ssh2/session.pyx":258 * return agent * * def agent_auth(self, username not None): # <<<<<<<<<<<<<< @@ -4556,7 +4556,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_32agent_auth(struct __pyx_obj_ return __pyx_r; } -/* "ssh2/session.pyx":306 +/* "ssh2/session.pyx":305 * clear_agent(agent) * * def open_session(self): # <<<<<<<<<<<<<< @@ -4586,7 +4586,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_34open_session(struct __pyx_ob PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("open_session", 0); - /* "ssh2/session.pyx":312 + /* "ssh2/session.pyx":311 * """ * cdef c_ssh2.LIBSSH2_CHANNEL *channel * with nogil: # <<<<<<<<<<<<<< @@ -4601,7 +4601,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_34open_session(struct __pyx_ob #endif /*try:*/ { - /* "ssh2/session.pyx":313 + /* "ssh2/session.pyx":312 * cdef c_ssh2.LIBSSH2_CHANNEL *channel * with nogil: * channel = c_ssh2.libssh2_channel_open_session( # <<<<<<<<<<<<<< @@ -4610,7 +4610,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_34open_session(struct __pyx_ob */ __pyx_v_channel = libssh2_channel_open_session(__pyx_v_self->_session); - /* "ssh2/session.pyx":315 + /* "ssh2/session.pyx":314 * channel = c_ssh2.libssh2_channel_open_session( * self._session) * if channel is NULL: # <<<<<<<<<<<<<< @@ -4620,7 +4620,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_34open_session(struct __pyx_ob __pyx_t_1 = ((__pyx_v_channel == NULL) != 0); if (__pyx_t_1) { - /* "ssh2/session.pyx":316 + /* "ssh2/session.pyx":315 * self._session) * if channel is NULL: * with gil: # <<<<<<<<<<<<<< @@ -4633,7 +4633,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_34open_session(struct __pyx_ob #endif /*try:*/ { - /* "ssh2/session.pyx":317 + /* "ssh2/session.pyx":316 * if channel is NULL: * with gil: * return None # <<<<<<<<<<<<<< @@ -4646,7 +4646,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_34open_session(struct __pyx_ob goto __pyx_L7_return; } - /* "ssh2/session.pyx":316 + /* "ssh2/session.pyx":315 * self._session) * if channel is NULL: * with gil: # <<<<<<<<<<<<<< @@ -4663,7 +4663,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_34open_session(struct __pyx_ob } } - /* "ssh2/session.pyx":315 + /* "ssh2/session.pyx":314 * channel = c_ssh2.libssh2_channel_open_session( * self._session) * if channel is NULL: # <<<<<<<<<<<<<< @@ -4673,7 +4673,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_34open_session(struct __pyx_ob } } - /* "ssh2/session.pyx":312 + /* "ssh2/session.pyx":311 * """ * cdef c_ssh2.LIBSSH2_CHANNEL *channel * with nogil: # <<<<<<<<<<<<<< @@ -4699,7 +4699,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_34open_session(struct __pyx_ob } } - /* "ssh2/session.pyx":318 + /* "ssh2/session.pyx":317 * with gil: * return None * return PyChannel(channel, self) # <<<<<<<<<<<<<< @@ -4707,13 +4707,13 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_34open_session(struct __pyx_ob * def direct_tcpip_ex(self, host not None, int port, */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __pyx_f_4ssh2_7channel_PyChannel(__pyx_v_channel, __pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 318, __pyx_L1_error) + __pyx_t_2 = __pyx_f_4ssh2_7channel_PyChannel(__pyx_v_channel, __pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 317, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":306 + /* "ssh2/session.pyx":305 * clear_agent(agent) * * def open_session(self): # <<<<<<<<<<<<<< @@ -4732,7 +4732,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_34open_session(struct __pyx_ob return __pyx_r; } -/* "ssh2/session.pyx":320 +/* "ssh2/session.pyx":319 * return PyChannel(channel, self) * * def direct_tcpip_ex(self, host not None, int port, # <<<<<<<<<<<<<< @@ -4778,23 +4778,23 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_37direct_tcpip_ex(PyObject *__ case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_port)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("direct_tcpip_ex", 1, 4, 4, 1); __PYX_ERR(0, 320, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("direct_tcpip_ex", 1, 4, 4, 1); __PYX_ERR(0, 319, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_shost)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("direct_tcpip_ex", 1, 4, 4, 2); __PYX_ERR(0, 320, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("direct_tcpip_ex", 1, 4, 4, 2); __PYX_ERR(0, 319, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_sport)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("direct_tcpip_ex", 1, 4, 4, 3); __PYX_ERR(0, 320, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("direct_tcpip_ex", 1, 4, 4, 3); __PYX_ERR(0, 319, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "direct_tcpip_ex") < 0)) __PYX_ERR(0, 320, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "direct_tcpip_ex") < 0)) __PYX_ERR(0, 319, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; @@ -4805,23 +4805,23 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_37direct_tcpip_ex(PyObject *__ values[3] = PyTuple_GET_ITEM(__pyx_args, 3); } __pyx_v_host = values[0]; - __pyx_v_port = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_port == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 320, __pyx_L3_error) + __pyx_v_port = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_port == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 319, __pyx_L3_error) __pyx_v_shost = values[2]; - __pyx_v_sport = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_sport == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 321, __pyx_L3_error) + __pyx_v_sport = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_sport == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 320, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("direct_tcpip_ex", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 320, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("direct_tcpip_ex", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 319, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.session.Session.direct_tcpip_ex", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(((PyObject *)__pyx_v_host) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "host"); __PYX_ERR(0, 320, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "host"); __PYX_ERR(0, 319, __pyx_L1_error) } if (unlikely(((PyObject *)__pyx_v_shost) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "shost"); __PYX_ERR(0, 321, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "shost"); __PYX_ERR(0, 320, __pyx_L1_error) } __pyx_r = __pyx_pf_4ssh2_7session_7Session_36direct_tcpip_ex(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), __pyx_v_host, __pyx_v_port, __pyx_v_shost, __pyx_v_sport); @@ -4844,7 +4844,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_36direct_tcpip_ex(struct __pyx PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("direct_tcpip_ex", 0); - /* "ssh2/session.pyx":323 + /* "ssh2/session.pyx":322 * shost not None, int sport): * cdef c_ssh2.LIBSSH2_CHANNEL *channel * cdef char *_host = to_bytes(host) # <<<<<<<<<<<<<< @@ -4853,7 +4853,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_36direct_tcpip_ex(struct __pyx */ __pyx_v__host = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_host); - /* "ssh2/session.pyx":324 + /* "ssh2/session.pyx":323 * cdef c_ssh2.LIBSSH2_CHANNEL *channel * cdef char *_host = to_bytes(host) * cdef char *_shost = to_bytes(shost) # <<<<<<<<<<<<<< @@ -4862,7 +4862,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_36direct_tcpip_ex(struct __pyx */ __pyx_v__shost = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_shost); - /* "ssh2/session.pyx":325 + /* "ssh2/session.pyx":324 * cdef char *_host = to_bytes(host) * cdef char *_shost = to_bytes(shost) * with nogil: # <<<<<<<<<<<<<< @@ -4877,7 +4877,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_36direct_tcpip_ex(struct __pyx #endif /*try:*/ { - /* "ssh2/session.pyx":326 + /* "ssh2/session.pyx":325 * cdef char *_shost = to_bytes(shost) * with nogil: * channel = c_ssh2.libssh2_channel_direct_tcpip_ex( # <<<<<<<<<<<<<< @@ -4886,7 +4886,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_36direct_tcpip_ex(struct __pyx */ __pyx_v_channel = libssh2_channel_direct_tcpip_ex(__pyx_v_self->_session, __pyx_v__host, __pyx_v_port, __pyx_v__shost, __pyx_v_sport); - /* "ssh2/session.pyx":328 + /* "ssh2/session.pyx":327 * channel = c_ssh2.libssh2_channel_direct_tcpip_ex( * self._session, _host, port, _shost, sport) * if channel is NULL: # <<<<<<<<<<<<<< @@ -4896,7 +4896,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_36direct_tcpip_ex(struct __pyx __pyx_t_1 = ((__pyx_v_channel == NULL) != 0); if (__pyx_t_1) { - /* "ssh2/session.pyx":329 + /* "ssh2/session.pyx":328 * self._session, _host, port, _shost, sport) * if channel is NULL: * with gil: # <<<<<<<<<<<<<< @@ -4909,7 +4909,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_36direct_tcpip_ex(struct __pyx #endif /*try:*/ { - /* "ssh2/session.pyx":330 + /* "ssh2/session.pyx":329 * if channel is NULL: * with gil: * return # <<<<<<<<<<<<<< @@ -4921,7 +4921,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_36direct_tcpip_ex(struct __pyx goto __pyx_L7_return; } - /* "ssh2/session.pyx":329 + /* "ssh2/session.pyx":328 * self._session, _host, port, _shost, sport) * if channel is NULL: * with gil: # <<<<<<<<<<<<<< @@ -4938,7 +4938,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_36direct_tcpip_ex(struct __pyx } } - /* "ssh2/session.pyx":328 + /* "ssh2/session.pyx":327 * channel = c_ssh2.libssh2_channel_direct_tcpip_ex( * self._session, _host, port, _shost, sport) * if channel is NULL: # <<<<<<<<<<<<<< @@ -4948,7 +4948,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_36direct_tcpip_ex(struct __pyx } } - /* "ssh2/session.pyx":325 + /* "ssh2/session.pyx":324 * cdef char *_host = to_bytes(host) * cdef char *_shost = to_bytes(shost) * with nogil: # <<<<<<<<<<<<<< @@ -4974,7 +4974,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_36direct_tcpip_ex(struct __pyx } } - /* "ssh2/session.pyx":331 + /* "ssh2/session.pyx":330 * with gil: * return * return PyChannel(channel, self) # <<<<<<<<<<<<<< @@ -4982,13 +4982,13 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_36direct_tcpip_ex(struct __pyx * def direct_tcpip(self, host not None, int port): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __pyx_f_4ssh2_7channel_PyChannel(__pyx_v_channel, __pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 331, __pyx_L1_error) + __pyx_t_2 = __pyx_f_4ssh2_7channel_PyChannel(__pyx_v_channel, __pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":320 + /* "ssh2/session.pyx":319 * return PyChannel(channel, self) * * def direct_tcpip_ex(self, host not None, int port, # <<<<<<<<<<<<<< @@ -5007,7 +5007,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_36direct_tcpip_ex(struct __pyx return __pyx_r; } -/* "ssh2/session.pyx":333 +/* "ssh2/session.pyx":332 * return PyChannel(channel, self) * * def direct_tcpip(self, host not None, int port): # <<<<<<<<<<<<<< @@ -5047,11 +5047,11 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_39direct_tcpip(PyObject *__pyx case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_port)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("direct_tcpip", 1, 2, 2, 1); __PYX_ERR(0, 333, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("direct_tcpip", 1, 2, 2, 1); __PYX_ERR(0, 332, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "direct_tcpip") < 0)) __PYX_ERR(0, 333, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "direct_tcpip") < 0)) __PYX_ERR(0, 332, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -5060,18 +5060,18 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_39direct_tcpip(PyObject *__pyx values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_host = values[0]; - __pyx_v_port = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_port == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 333, __pyx_L3_error) + __pyx_v_port = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_port == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 332, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("direct_tcpip", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 333, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("direct_tcpip", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 332, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.session.Session.direct_tcpip", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(((PyObject *)__pyx_v_host) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "host"); __PYX_ERR(0, 333, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "host"); __PYX_ERR(0, 332, __pyx_L1_error) } __pyx_r = __pyx_pf_4ssh2_7session_7Session_38direct_tcpip(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), __pyx_v_host, __pyx_v_port); @@ -5093,7 +5093,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_38direct_tcpip(struct __pyx_ob PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("direct_tcpip", 0); - /* "ssh2/session.pyx":335 + /* "ssh2/session.pyx":334 * def direct_tcpip(self, host not None, int port): * cdef c_ssh2.LIBSSH2_CHANNEL *channel * cdef char *_host = to_bytes(host) # <<<<<<<<<<<<<< @@ -5102,7 +5102,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_38direct_tcpip(struct __pyx_ob */ __pyx_v__host = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_host); - /* "ssh2/session.pyx":336 + /* "ssh2/session.pyx":335 * cdef c_ssh2.LIBSSH2_CHANNEL *channel * cdef char *_host = to_bytes(host) * with nogil: # <<<<<<<<<<<<<< @@ -5117,7 +5117,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_38direct_tcpip(struct __pyx_ob #endif /*try:*/ { - /* "ssh2/session.pyx":337 + /* "ssh2/session.pyx":336 * cdef char *_host = to_bytes(host) * with nogil: * channel = c_ssh2.libssh2_channel_direct_tcpip( # <<<<<<<<<<<<<< @@ -5126,7 +5126,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_38direct_tcpip(struct __pyx_ob */ __pyx_v_channel = libssh2_channel_direct_tcpip(__pyx_v_self->_session, __pyx_v__host, __pyx_v_port); - /* "ssh2/session.pyx":339 + /* "ssh2/session.pyx":338 * channel = c_ssh2.libssh2_channel_direct_tcpip( * self._session, _host, port) * if channel is NULL: # <<<<<<<<<<<<<< @@ -5136,7 +5136,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_38direct_tcpip(struct __pyx_ob __pyx_t_1 = ((__pyx_v_channel == NULL) != 0); if (__pyx_t_1) { - /* "ssh2/session.pyx":340 + /* "ssh2/session.pyx":339 * self._session, _host, port) * if channel is NULL: * with gil: # <<<<<<<<<<<<<< @@ -5149,7 +5149,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_38direct_tcpip(struct __pyx_ob #endif /*try:*/ { - /* "ssh2/session.pyx":341 + /* "ssh2/session.pyx":340 * if channel is NULL: * with gil: * return # <<<<<<<<<<<<<< @@ -5161,7 +5161,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_38direct_tcpip(struct __pyx_ob goto __pyx_L7_return; } - /* "ssh2/session.pyx":340 + /* "ssh2/session.pyx":339 * self._session, _host, port) * if channel is NULL: * with gil: # <<<<<<<<<<<<<< @@ -5178,7 +5178,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_38direct_tcpip(struct __pyx_ob } } - /* "ssh2/session.pyx":339 + /* "ssh2/session.pyx":338 * channel = c_ssh2.libssh2_channel_direct_tcpip( * self._session, _host, port) * if channel is NULL: # <<<<<<<<<<<<<< @@ -5188,7 +5188,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_38direct_tcpip(struct __pyx_ob } } - /* "ssh2/session.pyx":336 + /* "ssh2/session.pyx":335 * cdef c_ssh2.LIBSSH2_CHANNEL *channel * cdef char *_host = to_bytes(host) * with nogil: # <<<<<<<<<<<<<< @@ -5214,7 +5214,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_38direct_tcpip(struct __pyx_ob } } - /* "ssh2/session.pyx":342 + /* "ssh2/session.pyx":341 * with gil: * return * return PyChannel(channel, self) # <<<<<<<<<<<<<< @@ -5222,13 +5222,13 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_38direct_tcpip(struct __pyx_ob * def blockdirections(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __pyx_f_4ssh2_7channel_PyChannel(__pyx_v_channel, __pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 342, __pyx_L1_error) + __pyx_t_2 = __pyx_f_4ssh2_7channel_PyChannel(__pyx_v_channel, __pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":333 + /* "ssh2/session.pyx":332 * return PyChannel(channel, self) * * def direct_tcpip(self, host not None, int port): # <<<<<<<<<<<<<< @@ -5247,7 +5247,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_38direct_tcpip(struct __pyx_ob return __pyx_r; } -/* "ssh2/session.pyx":344 +/* "ssh2/session.pyx":343 * return PyChannel(channel, self) * * def blockdirections(self): # <<<<<<<<<<<<<< @@ -5276,7 +5276,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_40blockdirections(struct __pyx PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("blockdirections", 0); - /* "ssh2/session.pyx":346 + /* "ssh2/session.pyx":345 * def blockdirections(self): * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -5291,7 +5291,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_40blockdirections(struct __pyx #endif /*try:*/ { - /* "ssh2/session.pyx":347 + /* "ssh2/session.pyx":346 * cdef int rc * with nogil: * rc = c_ssh2.libssh2_session_block_directions( # <<<<<<<<<<<<<< @@ -5301,7 +5301,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_40blockdirections(struct __pyx __pyx_v_rc = libssh2_session_block_directions(__pyx_v_self->_session); } - /* "ssh2/session.pyx":346 + /* "ssh2/session.pyx":345 * def blockdirections(self): * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -5320,7 +5320,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_40blockdirections(struct __pyx } } - /* "ssh2/session.pyx":349 + /* "ssh2/session.pyx":348 * rc = c_ssh2.libssh2_session_block_directions( * self._session) * return rc # <<<<<<<<<<<<<< @@ -5328,13 +5328,13 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_40blockdirections(struct __pyx * def forward_listen(self, int port): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 349, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 348, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":344 + /* "ssh2/session.pyx":343 * return PyChannel(channel, self) * * def blockdirections(self): # <<<<<<<<<<<<<< @@ -5353,7 +5353,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_40blockdirections(struct __pyx return __pyx_r; } -/* "ssh2/session.pyx":351 +/* "ssh2/session.pyx":350 * return rc * * def forward_listen(self, int port): # <<<<<<<<<<<<<< @@ -5370,7 +5370,7 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_43forward_listen(PyObject *__p __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("forward_listen (wrapper)", 0); assert(__pyx_arg_port); { - __pyx_v_port = __Pyx_PyInt_As_int(__pyx_arg_port); if (unlikely((__pyx_v_port == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 351, __pyx_L3_error) + __pyx_v_port = __Pyx_PyInt_As_int(__pyx_arg_port); if (unlikely((__pyx_v_port == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 350, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -5393,7 +5393,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_42forward_listen(struct __pyx_ PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("forward_listen", 0); - /* "ssh2/session.pyx":353 + /* "ssh2/session.pyx":352 * def forward_listen(self, int port): * cdef c_ssh2.LIBSSH2_LISTENER *listener * with nogil: # <<<<<<<<<<<<<< @@ -5408,7 +5408,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_42forward_listen(struct __pyx_ #endif /*try:*/ { - /* "ssh2/session.pyx":354 + /* "ssh2/session.pyx":353 * cdef c_ssh2.LIBSSH2_LISTENER *listener * with nogil: * listener = c_ssh2.libssh2_channel_forward_listen( # <<<<<<<<<<<<<< @@ -5418,7 +5418,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_42forward_listen(struct __pyx_ __pyx_v_listener = libssh2_channel_forward_listen(__pyx_v_self->_session, __pyx_v_port); } - /* "ssh2/session.pyx":353 + /* "ssh2/session.pyx":352 * def forward_listen(self, int port): * cdef c_ssh2.LIBSSH2_LISTENER *listener * with nogil: # <<<<<<<<<<<<<< @@ -5437,7 +5437,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_42forward_listen(struct __pyx_ } } - /* "ssh2/session.pyx":356 + /* "ssh2/session.pyx":355 * listener = c_ssh2.libssh2_channel_forward_listen( * self._session, port) * if listener is NULL: # <<<<<<<<<<<<<< @@ -5447,7 +5447,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_42forward_listen(struct __pyx_ __pyx_t_1 = ((__pyx_v_listener == NULL) != 0); if (__pyx_t_1) { - /* "ssh2/session.pyx":357 + /* "ssh2/session.pyx":356 * self._session, port) * if listener is NULL: * return # <<<<<<<<<<<<<< @@ -5458,7 +5458,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_42forward_listen(struct __pyx_ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "ssh2/session.pyx":356 + /* "ssh2/session.pyx":355 * listener = c_ssh2.libssh2_channel_forward_listen( * self._session, port) * if listener is NULL: # <<<<<<<<<<<<<< @@ -5467,7 +5467,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_42forward_listen(struct __pyx_ */ } - /* "ssh2/session.pyx":358 + /* "ssh2/session.pyx":357 * if listener is NULL: * return * return PyListener(listener, self) # <<<<<<<<<<<<<< @@ -5475,13 +5475,13 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_42forward_listen(struct __pyx_ * def forward_listen_ex(self, host not None, int port, */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __pyx_f_4ssh2_8listener_PyListener(__pyx_v_listener, __pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 358, __pyx_L1_error) + __pyx_t_2 = __pyx_f_4ssh2_8listener_PyListener(__pyx_v_listener, __pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":351 + /* "ssh2/session.pyx":350 * return rc * * def forward_listen(self, int port): # <<<<<<<<<<<<<< @@ -5500,7 +5500,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_42forward_listen(struct __pyx_ return __pyx_r; } -/* "ssh2/session.pyx":360 +/* "ssh2/session.pyx":359 * return PyListener(listener, self) * * def forward_listen_ex(self, host not None, int port, # <<<<<<<<<<<<<< @@ -5546,23 +5546,23 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_45forward_listen_ex(PyObject * case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_port)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("forward_listen_ex", 1, 4, 4, 1); __PYX_ERR(0, 360, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("forward_listen_ex", 1, 4, 4, 1); __PYX_ERR(0, 359, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bound_port)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("forward_listen_ex", 1, 4, 4, 2); __PYX_ERR(0, 360, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("forward_listen_ex", 1, 4, 4, 2); __PYX_ERR(0, 359, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_queue_maxsize)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("forward_listen_ex", 1, 4, 4, 3); __PYX_ERR(0, 360, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("forward_listen_ex", 1, 4, 4, 3); __PYX_ERR(0, 359, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "forward_listen_ex") < 0)) __PYX_ERR(0, 360, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "forward_listen_ex") < 0)) __PYX_ERR(0, 359, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; @@ -5573,20 +5573,20 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_45forward_listen_ex(PyObject * values[3] = PyTuple_GET_ITEM(__pyx_args, 3); } __pyx_v_host = values[0]; - __pyx_v_port = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_port == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 360, __pyx_L3_error) - __pyx_v_bound_port = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_bound_port == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 361, __pyx_L3_error) - __pyx_v_queue_maxsize = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_queue_maxsize == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 361, __pyx_L3_error) + __pyx_v_port = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_port == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 359, __pyx_L3_error) + __pyx_v_bound_port = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_bound_port == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 360, __pyx_L3_error) + __pyx_v_queue_maxsize = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_queue_maxsize == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 360, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("forward_listen_ex", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 360, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("forward_listen_ex", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 359, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.session.Session.forward_listen_ex", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(((PyObject *)__pyx_v_host) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "host"); __PYX_ERR(0, 360, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "host"); __PYX_ERR(0, 359, __pyx_L1_error) } __pyx_r = __pyx_pf_4ssh2_7session_7Session_44forward_listen_ex(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), __pyx_v_host, __pyx_v_port, __pyx_v_bound_port, __pyx_v_queue_maxsize); @@ -5608,7 +5608,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_44forward_listen_ex(struct __p PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("forward_listen_ex", 0); - /* "ssh2/session.pyx":363 + /* "ssh2/session.pyx":362 * int bound_port, int queue_maxsize): * cdef c_ssh2.LIBSSH2_LISTENER *listener * cdef char *_host = to_bytes(host) # <<<<<<<<<<<<<< @@ -5617,7 +5617,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_44forward_listen_ex(struct __p */ __pyx_v__host = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_host); - /* "ssh2/session.pyx":364 + /* "ssh2/session.pyx":363 * cdef c_ssh2.LIBSSH2_LISTENER *listener * cdef char *_host = to_bytes(host) * with nogil: # <<<<<<<<<<<<<< @@ -5632,7 +5632,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_44forward_listen_ex(struct __p #endif /*try:*/ { - /* "ssh2/session.pyx":365 + /* "ssh2/session.pyx":364 * cdef char *_host = to_bytes(host) * with nogil: * listener = c_ssh2.libssh2_channel_forward_listen_ex( # <<<<<<<<<<<<<< @@ -5642,7 +5642,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_44forward_listen_ex(struct __p __pyx_v_listener = libssh2_channel_forward_listen_ex(__pyx_v_self->_session, __pyx_v__host, __pyx_v_port, (&__pyx_v_bound_port), __pyx_v_queue_maxsize); } - /* "ssh2/session.pyx":364 + /* "ssh2/session.pyx":363 * cdef c_ssh2.LIBSSH2_LISTENER *listener * cdef char *_host = to_bytes(host) * with nogil: # <<<<<<<<<<<<<< @@ -5661,7 +5661,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_44forward_listen_ex(struct __p } } - /* "ssh2/session.pyx":367 + /* "ssh2/session.pyx":366 * listener = c_ssh2.libssh2_channel_forward_listen_ex( * self._session, _host, port, &bound_port, queue_maxsize) * if listener is NULL: # <<<<<<<<<<<<<< @@ -5671,7 +5671,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_44forward_listen_ex(struct __p __pyx_t_1 = ((__pyx_v_listener == NULL) != 0); if (__pyx_t_1) { - /* "ssh2/session.pyx":368 + /* "ssh2/session.pyx":367 * self._session, _host, port, &bound_port, queue_maxsize) * if listener is NULL: * return # <<<<<<<<<<<<<< @@ -5682,7 +5682,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_44forward_listen_ex(struct __p __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "ssh2/session.pyx":367 + /* "ssh2/session.pyx":366 * listener = c_ssh2.libssh2_channel_forward_listen_ex( * self._session, _host, port, &bound_port, queue_maxsize) * if listener is NULL: # <<<<<<<<<<<<<< @@ -5691,7 +5691,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_44forward_listen_ex(struct __p */ } - /* "ssh2/session.pyx":369 + /* "ssh2/session.pyx":368 * if listener is NULL: * return * return PyListener(listener, self) # <<<<<<<<<<<<<< @@ -5699,13 +5699,13 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_44forward_listen_ex(struct __p * def sftp_init(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __pyx_f_4ssh2_8listener_PyListener(__pyx_v_listener, __pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 369, __pyx_L1_error) + __pyx_t_2 = __pyx_f_4ssh2_8listener_PyListener(__pyx_v_listener, __pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 368, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":360 + /* "ssh2/session.pyx":359 * return PyListener(listener, self) * * def forward_listen_ex(self, host not None, int port, # <<<<<<<<<<<<<< @@ -5724,7 +5724,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_44forward_listen_ex(struct __p return __pyx_r; } -/* "ssh2/session.pyx":371 +/* "ssh2/session.pyx":370 * return PyListener(listener, self) * * def sftp_init(self): # <<<<<<<<<<<<<< @@ -5754,7 +5754,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_46sftp_init(struct __pyx_obj_4 PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("sftp_init", 0); - /* "ssh2/session.pyx":377 + /* "ssh2/session.pyx":376 * """ * cdef c_sftp.LIBSSH2_SFTP *_sftp * with nogil: # <<<<<<<<<<<<<< @@ -5769,7 +5769,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_46sftp_init(struct __pyx_obj_4 #endif /*try:*/ { - /* "ssh2/session.pyx":378 + /* "ssh2/session.pyx":377 * cdef c_sftp.LIBSSH2_SFTP *_sftp * with nogil: * _sftp = c_sftp.libssh2_sftp_init(self._session) # <<<<<<<<<<<<<< @@ -5779,7 +5779,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_46sftp_init(struct __pyx_obj_4 __pyx_v__sftp = libssh2_sftp_init(__pyx_v_self->_session); } - /* "ssh2/session.pyx":377 + /* "ssh2/session.pyx":376 * """ * cdef c_sftp.LIBSSH2_SFTP *_sftp * with nogil: # <<<<<<<<<<<<<< @@ -5798,7 +5798,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_46sftp_init(struct __pyx_obj_4 } } - /* "ssh2/session.pyx":379 + /* "ssh2/session.pyx":378 * with nogil: * _sftp = c_sftp.libssh2_sftp_init(self._session) * if _sftp is NULL: # <<<<<<<<<<<<<< @@ -5808,7 +5808,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_46sftp_init(struct __pyx_obj_4 __pyx_t_1 = ((__pyx_v__sftp == NULL) != 0); if (__pyx_t_1) { - /* "ssh2/session.pyx":380 + /* "ssh2/session.pyx":379 * _sftp = c_sftp.libssh2_sftp_init(self._session) * if _sftp is NULL: * return # <<<<<<<<<<<<<< @@ -5819,7 +5819,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_46sftp_init(struct __pyx_obj_4 __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "ssh2/session.pyx":379 + /* "ssh2/session.pyx":378 * with nogil: * _sftp = c_sftp.libssh2_sftp_init(self._session) * if _sftp is NULL: # <<<<<<<<<<<<<< @@ -5828,7 +5828,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_46sftp_init(struct __pyx_obj_4 */ } - /* "ssh2/session.pyx":381 + /* "ssh2/session.pyx":380 * if _sftp is NULL: * return * return PySFTP(_sftp, self) # <<<<<<<<<<<<<< @@ -5836,13 +5836,13 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_46sftp_init(struct __pyx_obj_4 * def last_error(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __pyx_f_4ssh2_4sftp_PySFTP(__pyx_v__sftp, __pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 381, __pyx_L1_error) + __pyx_t_2 = __pyx_f_4ssh2_4sftp_PySFTP(__pyx_v__sftp, __pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":371 + /* "ssh2/session.pyx":370 * return PyListener(listener, self) * * def sftp_init(self): # <<<<<<<<<<<<<< @@ -5861,7 +5861,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_46sftp_init(struct __pyx_obj_4 return __pyx_r; } -/* "ssh2/session.pyx":383 +/* "ssh2/session.pyx":382 * return PySFTP(_sftp, self) * * def last_error(self): # <<<<<<<<<<<<<< @@ -5900,7 +5900,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_48last_error(struct __pyx_obj_ PyObject *__pyx_t_7 = NULL; __Pyx_RefNannySetupContext("last_error", 0); - /* "ssh2/session.pyx":389 + /* "ssh2/session.pyx":388 * :rtype: str * """ * cdef char **_error_msg = NULL # <<<<<<<<<<<<<< @@ -5909,7 +5909,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_48last_error(struct __pyx_obj_ */ __pyx_v__error_msg = NULL; - /* "ssh2/session.pyx":391 + /* "ssh2/session.pyx":390 * cdef char **_error_msg = NULL * cdef bytes msg * cdef int errmsg_len = 0 # <<<<<<<<<<<<<< @@ -5918,7 +5918,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_48last_error(struct __pyx_obj_ */ __pyx_v_errmsg_len = 0; - /* "ssh2/session.pyx":393 + /* "ssh2/session.pyx":392 * cdef int errmsg_len = 0 * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -5933,7 +5933,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_48last_error(struct __pyx_obj_ #endif /*try:*/ { - /* "ssh2/session.pyx":394 + /* "ssh2/session.pyx":393 * cdef int rc * with nogil: * rc = c_ssh2.libssh2_session_last_error( # <<<<<<<<<<<<<< @@ -5943,7 +5943,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_48last_error(struct __pyx_obj_ __pyx_v_rc = libssh2_session_last_error(__pyx_v_self->_session, __pyx_v__error_msg, (&__pyx_v_errmsg_len), 0); } - /* "ssh2/session.pyx":393 + /* "ssh2/session.pyx":392 * cdef int errmsg_len = 0 * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -5962,7 +5962,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_48last_error(struct __pyx_obj_ } } - /* "ssh2/session.pyx":396 + /* "ssh2/session.pyx":395 * rc = c_ssh2.libssh2_session_last_error( * self._session, _error_msg, &errmsg_len, 0) * if errmsg_len > 0 and _error_msg is not NULL: # <<<<<<<<<<<<<< @@ -5980,7 +5980,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_48last_error(struct __pyx_obj_ __pyx_L7_bool_binop_done:; if (__pyx_t_1) { - /* "ssh2/session.pyx":397 + /* "ssh2/session.pyx":396 * self._session, _error_msg, &errmsg_len, 0) * if errmsg_len > 0 and _error_msg is not NULL: * for line in _error_msg[:errmsg_len]: # <<<<<<<<<<<<<< @@ -5992,24 +5992,24 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_48last_error(struct __pyx_obj_ __pyx_t_3 = __pyx_t_5; __pyx_v_line = (__pyx_t_3[0]); - /* "ssh2/session.pyx":398 + /* "ssh2/session.pyx":397 * if errmsg_len > 0 and _error_msg is not NULL: * for line in _error_msg[:errmsg_len]: * msg += line # <<<<<<<<<<<<<< * else: * msg = b'' */ - if (unlikely(!__pyx_v_msg)) { __Pyx_RaiseUnboundLocalError("msg"); __PYX_ERR(0, 398, __pyx_L1_error) } - __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_line); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 398, __pyx_L1_error) + if (unlikely(!__pyx_v_msg)) { __Pyx_RaiseUnboundLocalError("msg"); __PYX_ERR(0, 397, __pyx_L1_error) } + __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_line); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 397, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PyNumber_InPlaceAdd(__pyx_v_msg, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 398, __pyx_L1_error) + __pyx_t_7 = PyNumber_InPlaceAdd(__pyx_v_msg, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 397, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF_SET(__pyx_v_msg, ((PyObject*)__pyx_t_7)); __pyx_t_7 = 0; } - /* "ssh2/session.pyx":396 + /* "ssh2/session.pyx":395 * rc = c_ssh2.libssh2_session_last_error( * self._session, _error_msg, &errmsg_len, 0) * if errmsg_len > 0 and _error_msg is not NULL: # <<<<<<<<<<<<<< @@ -6019,7 +6019,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_48last_error(struct __pyx_obj_ goto __pyx_L6; } - /* "ssh2/session.pyx":400 + /* "ssh2/session.pyx":399 * msg += line * else: * msg = b'' # <<<<<<<<<<<<<< @@ -6032,20 +6032,20 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_48last_error(struct __pyx_obj_ } __pyx_L6:; - /* "ssh2/session.pyx":401 + /* "ssh2/session.pyx":400 * else: * msg = b'' * return msg # <<<<<<<<<<<<<< * - * def scp_recv2(self, path not None): + * def scp_recv(self, path not None): */ __Pyx_XDECREF(__pyx_r); - if (unlikely(!__pyx_v_msg)) { __Pyx_RaiseUnboundLocalError("msg"); __PYX_ERR(0, 401, __pyx_L1_error) } + if (unlikely(!__pyx_v_msg)) { __Pyx_RaiseUnboundLocalError("msg"); __PYX_ERR(0, 400, __pyx_L1_error) } __Pyx_INCREF(__pyx_v_msg); __pyx_r = __pyx_v_msg; goto __pyx_L0; - /* "ssh2/session.pyx":383 + /* "ssh2/session.pyx":382 * return PySFTP(_sftp, self) * * def last_error(self): # <<<<<<<<<<<<<< @@ -6066,25 +6066,25 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_48last_error(struct __pyx_obj_ return __pyx_r; } -/* "ssh2/session.pyx":403 +/* "ssh2/session.pyx":402 * return msg * - * def scp_recv2(self, path not None): # <<<<<<<<<<<<<< - * """Receive file via SCP. - * + * def scp_recv(self, path not None): # <<<<<<<<<<<<<< + * cdef char *_path = to_bytes(path) + * cdef FileInfo fileinfo = FileInfo() */ /* Python wrapper */ -static PyObject *__pyx_pw_4ssh2_7session_7Session_51scp_recv2(PyObject *__pyx_v_self, PyObject *__pyx_v_path); /*proto*/ -static char __pyx_doc_4ssh2_7session_7Session_50scp_recv2[] = "Session.scp_recv2(self, path)\nReceive file via SCP.\n\n :param path: File path to receive.\n :type path: str\n\n :rtype: tuple(:py:class:`ssh2.channel.Channel`,\n :py:class:`ssh2.fileinfo.FileInfo)"; -static PyObject *__pyx_pw_4ssh2_7session_7Session_51scp_recv2(PyObject *__pyx_v_self, PyObject *__pyx_v_path) { +static PyObject *__pyx_pw_4ssh2_7session_7Session_51scp_recv(PyObject *__pyx_v_self, PyObject *__pyx_v_path); /*proto*/ +static char __pyx_doc_4ssh2_7session_7Session_50scp_recv[] = "Session.scp_recv(self, path)"; +static PyObject *__pyx_pw_4ssh2_7session_7Session_51scp_recv(PyObject *__pyx_v_self, PyObject *__pyx_v_path) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("scp_recv2 (wrapper)", 0); + __Pyx_RefNannySetupContext("scp_recv (wrapper)", 0); if (unlikely(((PyObject *)__pyx_v_path) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "path"); __PYX_ERR(0, 403, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "path"); __PYX_ERR(0, 402, __pyx_L1_error) } - __pyx_r = __pyx_pf_4ssh2_7session_7Session_50scp_recv2(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), ((PyObject *)__pyx_v_path)); + __pyx_r = __pyx_pf_4ssh2_7session_7Session_50scp_recv(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), ((PyObject *)__pyx_v_path)); /* function exit code */ goto __pyx_L0; @@ -6095,43 +6095,43 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_51scp_recv2(PyObject *__pyx_v_ return __pyx_r; } -static PyObject *__pyx_pf_4ssh2_7session_7Session_50scp_recv2(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, PyObject *__pyx_v_path) { - struct __pyx_obj_4ssh2_8fileinfo_FileInfo *__pyx_v_fileinfo = 0; +static PyObject *__pyx_pf_4ssh2_7session_7Session_50scp_recv(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, PyObject *__pyx_v_path) { char *__pyx_v__path; + struct __pyx_obj_4ssh2_8fileinfo_FileInfo *__pyx_v_fileinfo = 0; LIBSSH2_CHANNEL *__pyx_v_channel; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; - __Pyx_RefNannySetupContext("scp_recv2", 0); + __Pyx_RefNannySetupContext("scp_recv", 0); - /* "ssh2/session.pyx":411 - * :rtype: tuple(:py:class:`ssh2.channel.Channel`, - * :py:class:`ssh2.fileinfo.FileInfo)""" - * cdef FileInfo fileinfo = FileInfo() # <<<<<<<<<<<<<< + /* "ssh2/session.pyx":403 + * + * def scp_recv(self, path not None): + * cdef char *_path = to_bytes(path) # <<<<<<<<<<<<<< + * cdef FileInfo fileinfo = FileInfo() + * cdef c_ssh2.LIBSSH2_CHANNEL *channel + */ + __pyx_v__path = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_path); + + /* "ssh2/session.pyx":404 + * def scp_recv(self, path not None): * cdef char *_path = to_bytes(path) + * cdef FileInfo fileinfo = FileInfo() # <<<<<<<<<<<<<< * cdef c_ssh2.LIBSSH2_CHANNEL *channel + * with nogil: */ - __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4ssh2_8fileinfo_FileInfo), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 411, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4ssh2_8fileinfo_FileInfo), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 404, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_fileinfo = ((struct __pyx_obj_4ssh2_8fileinfo_FileInfo *)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/session.pyx":412 - * :py:class:`ssh2.fileinfo.FileInfo)""" + /* "ssh2/session.pyx":406 * cdef FileInfo fileinfo = FileInfo() - * cdef char *_path = to_bytes(path) # <<<<<<<<<<<<<< - * cdef c_ssh2.LIBSSH2_CHANNEL *channel - * with nogil: - */ - __pyx_v__path = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_path); - - /* "ssh2/session.pyx":414 - * cdef char *_path = to_bytes(path) * cdef c_ssh2.LIBSSH2_CHANNEL *channel * with nogil: # <<<<<<<<<<<<<< - * channel = c_ssh2.libssh2_scp_recv2( + * channel = c_ssh2.libssh2_scp_recv( * self._session, _path, fileinfo._stat) */ { @@ -6142,21 +6142,21 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_50scp_recv2(struct __pyx_obj_4 #endif /*try:*/ { - /* "ssh2/session.pyx":415 + /* "ssh2/session.pyx":407 * cdef c_ssh2.LIBSSH2_CHANNEL *channel * with nogil: - * channel = c_ssh2.libssh2_scp_recv2( # <<<<<<<<<<<<<< + * channel = c_ssh2.libssh2_scp_recv( # <<<<<<<<<<<<<< * self._session, _path, fileinfo._stat) * if channel is not NULL: */ - __pyx_v_channel = libssh2_scp_recv2(__pyx_v_self->_session, __pyx_v__path, __pyx_v_fileinfo->_stat); + __pyx_v_channel = libssh2_scp_recv(__pyx_v_self->_session, __pyx_v__path, __pyx_v_fileinfo->_stat); } - /* "ssh2/session.pyx":414 - * cdef char *_path = to_bytes(path) + /* "ssh2/session.pyx":406 + * cdef FileInfo fileinfo = FileInfo() * cdef c_ssh2.LIBSSH2_CHANNEL *channel * with nogil: # <<<<<<<<<<<<<< - * channel = c_ssh2.libssh2_scp_recv2( + * channel = c_ssh2.libssh2_scp_recv( * self._session, _path, fileinfo._stat) */ /*finally:*/ { @@ -6171,8 +6171,8 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_50scp_recv2(struct __pyx_obj_4 } } - /* "ssh2/session.pyx":417 - * channel = c_ssh2.libssh2_scp_recv2( + /* "ssh2/session.pyx":409 + * channel = c_ssh2.libssh2_scp_recv( * self._session, _path, fileinfo._stat) * if channel is not NULL: # <<<<<<<<<<<<<< * return PyChannel(channel, self), fileinfo @@ -6181,17 +6181,17 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_50scp_recv2(struct __pyx_obj_4 __pyx_t_2 = ((__pyx_v_channel != NULL) != 0); if (__pyx_t_2) { - /* "ssh2/session.pyx":418 + /* "ssh2/session.pyx":410 * self._session, _path, fileinfo._stat) * if channel is not NULL: * return PyChannel(channel, self), fileinfo # <<<<<<<<<<<<<< * - * def scp_send(self, path not None, int mode, size_t size): + * # def scp_recv2(self, path not None): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_4ssh2_7channel_PyChannel(__pyx_v_channel, __pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 418, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_7channel_PyChannel(__pyx_v_channel, __pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 410, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 418, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 410, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); @@ -6203,8 +6203,8 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_50scp_recv2(struct __pyx_obj_4 __pyx_t_3 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":417 - * channel = c_ssh2.libssh2_scp_recv2( + /* "ssh2/session.pyx":409 + * channel = c_ssh2.libssh2_scp_recv( * self._session, _path, fileinfo._stat) * if channel is not NULL: # <<<<<<<<<<<<<< * return PyChannel(channel, self), fileinfo @@ -6212,12 +6212,12 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_50scp_recv2(struct __pyx_obj_4 */ } - /* "ssh2/session.pyx":403 + /* "ssh2/session.pyx":402 * return msg * - * def scp_recv2(self, path not None): # <<<<<<<<<<<<<< - * """Receive file via SCP. - * + * def scp_recv(self, path not None): # <<<<<<<<<<<<<< + * cdef char *_path = to_bytes(path) + * cdef FileInfo fileinfo = FileInfo() */ /* function exit code */ @@ -6226,7 +6226,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_50scp_recv2(struct __pyx_obj_4 __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("ssh2.session.Session.scp_recv2", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("ssh2.session.Session.scp_recv", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_fileinfo); @@ -6235,8 +6235,8 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_50scp_recv2(struct __pyx_obj_4 return __pyx_r; } -/* "ssh2/session.pyx":420 - * return PyChannel(channel, self), fileinfo +/* "ssh2/session.pyx":427 + * # return PyChannel(channel, self), fileinfo * * def scp_send(self, path not None, int mode, size_t size): # <<<<<<<<<<<<<< * """Send file via SCP. @@ -6278,17 +6278,17 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_53scp_send(PyObject *__pyx_v_s case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mode)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("scp_send", 1, 3, 3, 1); __PYX_ERR(0, 420, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("scp_send", 1, 3, 3, 1); __PYX_ERR(0, 427, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("scp_send", 1, 3, 3, 2); __PYX_ERR(0, 420, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("scp_send", 1, 3, 3, 2); __PYX_ERR(0, 427, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "scp_send") < 0)) __PYX_ERR(0, 420, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "scp_send") < 0)) __PYX_ERR(0, 427, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -6298,19 +6298,19 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_53scp_send(PyObject *__pyx_v_s values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_path = values[0]; - __pyx_v_mode = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_mode == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 420, __pyx_L3_error) - __pyx_v_size = __Pyx_PyInt_As_size_t(values[2]); if (unlikely((__pyx_v_size == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 420, __pyx_L3_error) + __pyx_v_mode = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_mode == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 427, __pyx_L3_error) + __pyx_v_size = __Pyx_PyInt_As_size_t(values[2]); if (unlikely((__pyx_v_size == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 427, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("scp_send", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 420, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("scp_send", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 427, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.session.Session.scp_send", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(((PyObject *)__pyx_v_path) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "path"); __PYX_ERR(0, 420, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "path"); __PYX_ERR(0, 427, __pyx_L1_error) } __pyx_r = __pyx_pf_4ssh2_7session_7Session_52scp_send(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), __pyx_v_path, __pyx_v_mode, __pyx_v_size); @@ -6332,7 +6332,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_52scp_send(struct __pyx_obj_4s PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("scp_send", 0); - /* "ssh2/session.pyx":431 + /* "ssh2/session.pyx":438 * * :rtype: :py:class:`ssh2.channel.Channel`""" * cdef char *_path = to_bytes(path) # <<<<<<<<<<<<<< @@ -6341,7 +6341,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_52scp_send(struct __pyx_obj_4s */ __pyx_v__path = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_path); - /* "ssh2/session.pyx":433 + /* "ssh2/session.pyx":440 * cdef char *_path = to_bytes(path) * cdef c_ssh2.LIBSSH2_CHANNEL *channel * with nogil: # <<<<<<<<<<<<<< @@ -6356,7 +6356,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_52scp_send(struct __pyx_obj_4s #endif /*try:*/ { - /* "ssh2/session.pyx":434 + /* "ssh2/session.pyx":441 * cdef c_ssh2.LIBSSH2_CHANNEL *channel * with nogil: * channel = c_ssh2.libssh2_scp_send( # <<<<<<<<<<<<<< @@ -6366,7 +6366,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_52scp_send(struct __pyx_obj_4s __pyx_v_channel = libssh2_scp_send(__pyx_v_self->_session, __pyx_v__path, __pyx_v_mode, __pyx_v_size); } - /* "ssh2/session.pyx":433 + /* "ssh2/session.pyx":440 * cdef char *_path = to_bytes(path) * cdef c_ssh2.LIBSSH2_CHANNEL *channel * with nogil: # <<<<<<<<<<<<<< @@ -6385,7 +6385,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_52scp_send(struct __pyx_obj_4s } } - /* "ssh2/session.pyx":436 + /* "ssh2/session.pyx":443 * channel = c_ssh2.libssh2_scp_send( * self._session, _path, mode, size) * if channel is not NULL: # <<<<<<<<<<<<<< @@ -6395,7 +6395,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_52scp_send(struct __pyx_obj_4s __pyx_t_1 = ((__pyx_v_channel != NULL) != 0); if (__pyx_t_1) { - /* "ssh2/session.pyx":437 + /* "ssh2/session.pyx":444 * self._session, _path, mode, size) * if channel is not NULL: * return PyChannel(channel, self) # <<<<<<<<<<<<<< @@ -6403,13 +6403,13 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_52scp_send(struct __pyx_obj_4s * def scp_send64(self, path not None, int mode, uint64_t size, */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __pyx_f_4ssh2_7channel_PyChannel(__pyx_v_channel, __pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 437, __pyx_L1_error) + __pyx_t_2 = __pyx_f_4ssh2_7channel_PyChannel(__pyx_v_channel, __pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 444, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":436 + /* "ssh2/session.pyx":443 * channel = c_ssh2.libssh2_scp_send( * self._session, _path, mode, size) * if channel is not NULL: # <<<<<<<<<<<<<< @@ -6418,8 +6418,8 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_52scp_send(struct __pyx_obj_4s */ } - /* "ssh2/session.pyx":420 - * return PyChannel(channel, self), fileinfo + /* "ssh2/session.pyx":427 + * # return PyChannel(channel, self), fileinfo * * def scp_send(self, path not None, int mode, size_t size): # <<<<<<<<<<<<<< * """Send file via SCP. @@ -6439,7 +6439,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_52scp_send(struct __pyx_obj_4s return __pyx_r; } -/* "ssh2/session.pyx":439 +/* "ssh2/session.pyx":446 * return PyChannel(channel, self) * * def scp_send64(self, path not None, int mode, uint64_t size, # <<<<<<<<<<<<<< @@ -6488,29 +6488,29 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_55scp_send64(PyObject *__pyx_v case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mode)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("scp_send64", 1, 5, 5, 1); __PYX_ERR(0, 439, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("scp_send64", 1, 5, 5, 1); __PYX_ERR(0, 446, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("scp_send64", 1, 5, 5, 2); __PYX_ERR(0, 439, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("scp_send64", 1, 5, 5, 2); __PYX_ERR(0, 446, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mtime)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("scp_send64", 1, 5, 5, 3); __PYX_ERR(0, 439, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("scp_send64", 1, 5, 5, 3); __PYX_ERR(0, 446, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_atime)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("scp_send64", 1, 5, 5, 4); __PYX_ERR(0, 439, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("scp_send64", 1, 5, 5, 4); __PYX_ERR(0, 446, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "scp_send64") < 0)) __PYX_ERR(0, 439, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "scp_send64") < 0)) __PYX_ERR(0, 446, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 5) { goto __pyx_L5_argtuple_error; @@ -6522,21 +6522,21 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_55scp_send64(PyObject *__pyx_v values[4] = PyTuple_GET_ITEM(__pyx_args, 4); } __pyx_v_path = values[0]; - __pyx_v_mode = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_mode == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 439, __pyx_L3_error) - __pyx_v_size = __Pyx_PyInt_As_uint64_t(values[2]); if (unlikely((__pyx_v_size == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 439, __pyx_L3_error) - __pyx_v_mtime = __Pyx_PyInt_As_time_t(values[3]); if (unlikely((__pyx_v_mtime == ((time_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 440, __pyx_L3_error) - __pyx_v_atime = __Pyx_PyInt_As_time_t(values[4]); if (unlikely((__pyx_v_atime == ((time_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 440, __pyx_L3_error) + __pyx_v_mode = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_mode == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 446, __pyx_L3_error) + __pyx_v_size = __Pyx_PyInt_As_uint64_t(values[2]); if (unlikely((__pyx_v_size == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 446, __pyx_L3_error) + __pyx_v_mtime = __Pyx_PyInt_As_time_t(values[3]); if (unlikely((__pyx_v_mtime == ((time_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 447, __pyx_L3_error) + __pyx_v_atime = __Pyx_PyInt_As_time_t(values[4]); if (unlikely((__pyx_v_atime == ((time_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 447, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("scp_send64", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 439, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("scp_send64", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 446, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.session.Session.scp_send64", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(((PyObject *)__pyx_v_path) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "path"); __PYX_ERR(0, 439, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "path"); __PYX_ERR(0, 446, __pyx_L1_error) } __pyx_r = __pyx_pf_4ssh2_7session_7Session_54scp_send64(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), __pyx_v_path, __pyx_v_mode, __pyx_v_size, __pyx_v_mtime, __pyx_v_atime); @@ -6558,7 +6558,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_54scp_send64(struct __pyx_obj_ PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("scp_send64", 0); - /* "ssh2/session.pyx":441 + /* "ssh2/session.pyx":448 * def scp_send64(self, path not None, int mode, uint64_t size, * time_t mtime, time_t atime): * cdef char *_path = to_bytes(path) # <<<<<<<<<<<<<< @@ -6567,7 +6567,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_54scp_send64(struct __pyx_obj_ */ __pyx_v__path = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_path); - /* "ssh2/session.pyx":443 + /* "ssh2/session.pyx":450 * cdef char *_path = to_bytes(path) * cdef c_ssh2.LIBSSH2_CHANNEL *channel * with nogil: # <<<<<<<<<<<<<< @@ -6582,7 +6582,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_54scp_send64(struct __pyx_obj_ #endif /*try:*/ { - /* "ssh2/session.pyx":444 + /* "ssh2/session.pyx":451 * cdef c_ssh2.LIBSSH2_CHANNEL *channel * with nogil: * channel = c_ssh2.libssh2_scp_send64( # <<<<<<<<<<<<<< @@ -6592,7 +6592,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_54scp_send64(struct __pyx_obj_ __pyx_v_channel = libssh2_scp_send64(__pyx_v_self->_session, __pyx_v__path, __pyx_v_mode, __pyx_v_size, __pyx_v_mtime, __pyx_v_atime); } - /* "ssh2/session.pyx":443 + /* "ssh2/session.pyx":450 * cdef char *_path = to_bytes(path) * cdef c_ssh2.LIBSSH2_CHANNEL *channel * with nogil: # <<<<<<<<<<<<<< @@ -6611,7 +6611,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_54scp_send64(struct __pyx_obj_ } } - /* "ssh2/session.pyx":446 + /* "ssh2/session.pyx":453 * channel = c_ssh2.libssh2_scp_send64( * self._session, _path, mode, size, mtime, atime) * if channel is not NULL: # <<<<<<<<<<<<<< @@ -6620,19 +6620,19 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_54scp_send64(struct __pyx_obj_ __pyx_t_1 = ((__pyx_v_channel != NULL) != 0); if (__pyx_t_1) { - /* "ssh2/session.pyx":447 + /* "ssh2/session.pyx":454 * self._session, _path, mode, size, mtime, atime) * if channel is not NULL: * return PyChannel(channel, self) # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __pyx_f_4ssh2_7channel_PyChannel(__pyx_v_channel, __pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 447, __pyx_L1_error) + __pyx_t_2 = __pyx_f_4ssh2_7channel_PyChannel(__pyx_v_channel, __pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 454, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":446 + /* "ssh2/session.pyx":453 * channel = c_ssh2.libssh2_scp_send64( * self._session, _path, mode, size, mtime, atime) * if channel is not NULL: # <<<<<<<<<<<<<< @@ -6640,7 +6640,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_54scp_send64(struct __pyx_obj_ */ } - /* "ssh2/session.pyx":439 + /* "ssh2/session.pyx":446 * return PyChannel(channel, self) * * def scp_send64(self, path not None, int mode, uint64_t size, # <<<<<<<<<<<<<< @@ -6830,7 +6830,7 @@ static PyMethodDef __pyx_methods_4ssh2_7session_Session[] = { {"forward_listen_ex", (PyCFunction)__pyx_pw_4ssh2_7session_7Session_45forward_listen_ex, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_44forward_listen_ex}, {"sftp_init", (PyCFunction)__pyx_pw_4ssh2_7session_7Session_47sftp_init, METH_NOARGS, __pyx_doc_4ssh2_7session_7Session_46sftp_init}, {"last_error", (PyCFunction)__pyx_pw_4ssh2_7session_7Session_49last_error, METH_NOARGS, __pyx_doc_4ssh2_7session_7Session_48last_error}, - {"scp_recv2", (PyCFunction)__pyx_pw_4ssh2_7session_7Session_51scp_recv2, METH_O, __pyx_doc_4ssh2_7session_7Session_50scp_recv2}, + {"scp_recv", (PyCFunction)__pyx_pw_4ssh2_7session_7Session_51scp_recv, METH_O, __pyx_doc_4ssh2_7session_7Session_50scp_recv}, {"scp_send", (PyCFunction)__pyx_pw_4ssh2_7session_7Session_53scp_send, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_52scp_send}, {"scp_send64", (PyCFunction)__pyx_pw_4ssh2_7session_7Session_55scp_send64, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_54scp_send64}, {"__reduce_cython__", (PyCFunction)__pyx_pw_4ssh2_7session_7Session_57__reduce_cython__, METH_NOARGS, __pyx_doc_4ssh2_7session_7Session_56__reduce_cython__}, @@ -6956,7 +6956,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {0, 0, 0, 0, 0, 0, 0} }; static int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(0, 43, __pyx_L1_error) + __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(0, 42, __pyx_L1_error) __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error) return 0; __pyx_L1_error:; @@ -6967,36 +6967,36 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - /* "ssh2/session.pyx":140 + /* "ssh2/session.pyx":139 * return * auth = to_str(_auth) * return auth.split(',') # <<<<<<<<<<<<<< * * def userauth_publickey_fromfile(self, username not None, */ - __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 140, __pyx_L1_error) + __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); - /* "ssh2/session.pyx":256 + /* "ssh2/session.pyx":255 * c_ssh2.libssh2_agent_free(agent) * with gil: * raise AgentConnectionError("Unable to connect to agent") # <<<<<<<<<<<<<< * return agent * */ - __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_connect_to_agent); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 256, __pyx_L1_error) + __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_connect_to_agent); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); - /* "ssh2/session.pyx":296 + /* "ssh2/session.pyx":295 * clear_agent(agent) * with gil: * raise AgentListIdentitiesError( # <<<<<<<<<<<<<< * "Failure requesting identities from agent") * while 1: */ - __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_Failure_requesting_identities_fr); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 296, __pyx_L1_error) + __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_Failure_requesting_identities_fr); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 295, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); @@ -7125,11 +7125,11 @@ PyMODINIT_FUNC PyInit_session(void) __pyx_vtabptr_4ssh2_7session_Session = &__pyx_vtable_4ssh2_7session_Session; __pyx_vtable_4ssh2_7session_Session.init_connect_agent = (LIBSSH2_AGENT *(*)(struct __pyx_obj_4ssh2_7session_Session *))__pyx_f_4ssh2_7session_7Session_init_connect_agent; __pyx_vtable_4ssh2_7session_Session._agent_init = (LIBSSH2_AGENT *(*)(struct __pyx_obj_4ssh2_7session_Session *))__pyx_f_4ssh2_7session_7Session__agent_init; - if (PyType_Ready(&__pyx_type_4ssh2_7session_Session) < 0) __PYX_ERR(0, 34, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_4ssh2_7session_Session) < 0) __PYX_ERR(0, 33, __pyx_L1_error) __pyx_type_4ssh2_7session_Session.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_4ssh2_7session_Session.tp_dict, __pyx_vtabptr_4ssh2_7session_Session) < 0) __PYX_ERR(0, 34, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "Session", (PyObject *)&__pyx_type_4ssh2_7session_Session) < 0) __PYX_ERR(0, 34, __pyx_L1_error) - if (__Pyx_setup_reduce((PyObject*)&__pyx_type_4ssh2_7session_Session) < 0) __PYX_ERR(0, 34, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type_4ssh2_7session_Session.tp_dict, __pyx_vtabptr_4ssh2_7session_Session) < 0) __PYX_ERR(0, 33, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "Session", (PyObject *)&__pyx_type_4ssh2_7session_Session) < 0) __PYX_ERR(0, 33, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_4ssh2_7session_Session) < 0) __PYX_ERR(0, 33, __pyx_L1_error) __pyx_ptype_4ssh2_7session_Session = &__pyx_type_4ssh2_7session_Session; /*--- Type import code ---*/ __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", diff --git a/ssh2/session.pyx b/ssh2/session.pyx index 488cfed0..c93adab2 100644 --- a/ssh2/session.pyx +++ b/ssh2/session.pyx @@ -399,23 +399,31 @@ cdef class Session: msg = b'' return msg - def scp_recv2(self, path not None): - """Receive file via SCP. - - :param path: File path to receive. - :type path: str - - :rtype: tuple(:py:class:`ssh2.channel.Channel`, - :py:class:`ssh2.fileinfo.FileInfo)""" - cdef FileInfo fileinfo = FileInfo() + def scp_recv(self, path not None): cdef char *_path = to_bytes(path) + cdef FileInfo fileinfo = FileInfo() cdef c_ssh2.LIBSSH2_CHANNEL *channel with nogil: - channel = c_ssh2.libssh2_scp_recv2( + channel = c_ssh2.libssh2_scp_recv( self._session, _path, fileinfo._stat) if channel is not NULL: return PyChannel(channel, self), fileinfo + # def scp_recv2(self, path not None): + # """Receive file via SCP. + # :param path: File path to receive. + # :type path: str + # :rtype: tuple(:py:class:`ssh2.channel.Channel`, + # :py:class:`ssh2.fileinfo.FileInfo)""" + # cdef FileInfo fileinfo = FileInfo() + # cdef char *_path = to_bytes(path) + # cdef c_ssh2.LIBSSH2_CHANNEL *channel + # with nogil: + # channel = c_ssh2.libssh2_scp_recv2( + # self._session, _path, fileinfo._stat) + # if channel is not NULL: + # return PyChannel(channel, self), fileinfo + def scp_send(self, path not None, int mode, size_t size): """Send file via SCP. diff --git a/tests/test_ssh2.py b/tests/test_ssh2.py index 80f5e610..4f8c9d82 100644 --- a/tests/test_ssh2.py +++ b/tests/test_ssh2.py @@ -331,6 +331,31 @@ def test_scp_recv2(self): finally: os.unlink(remote_filename) + def test_scp_recv(self): + self.assertEqual(self._auth(), 0) + test_data = b"data" + remote_filename = os.sep.join([os.path.dirname(__file__), + "remote_test_file"]) + with open(remote_filename, 'wb') as fh: + fh.write(test_data) + try: + (file_chan, fileinfo) = self.session.scp_recv(remote_filename) + except TypeError: + os.unlink(remote_filename) + raise + try: + total = 0 + size, data = file_chan.read(size=fileinfo.st_size) + total += size + while total < fileinfo.st_size: + total += size + size, data = file_chan.read() + self.assertEqual(total, fileinfo.st_size) + except Exception: + raise + finally: + os.unlink(remote_filename) + def test_scp_send(self): self.assertEqual(self._auth(), 0) test_data = b"data" From b2cafd8f38d3ce9f50cb7c388b105a2cb70fb23b Mon Sep 17 00:00:00 2001 From: Pan Date: Sun, 6 Aug 2017 19:17:39 +0100 Subject: [PATCH 3/6] Implemented extension class for stat structure. Updated scp_recv signarure and types. --- ssh2/agent.c | 4 + ssh2/c_ssh2.pxd | 3 +- ssh2/channel.c | 4 + ssh2/error_codes.c | 4 + ssh2/fileinfo.c | 4 + ssh2/listener.c | 4 + ssh2/pkey.c | 4 + ssh2/session.c | 939 +++++------ ssh2/session.pyx | 7 +- ssh2/sftp.c | 4 + ssh2/statinfo.c | 3919 ++++++++++++++++++++++++++++++++++++++++++++ ssh2/statinfo.pxd | 6 + ssh2/statinfo.pyx | 82 + ssh2/utils.c | 4 + tests/test_ssh2.py | 1 + 15 files changed, 4527 insertions(+), 462 deletions(-) create mode 100644 ssh2/statinfo.c create mode 100644 ssh2/statinfo.pxd create mode 100644 ssh2/statinfo.pyx diff --git a/ssh2/agent.c b/ssh2/agent.c index 89d80969..34437858 100644 --- a/ssh2/agent.c +++ b/ssh2/agent.c @@ -492,6 +492,8 @@ static CYTHON_INLINE float __PYX_NAN() { #include #include #include +#include +#include #include "libssh2.h" #ifdef _OPENMP #include @@ -1140,6 +1142,8 @@ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* Module declarations from 'posix.types' */ +/* Module declarations from 'posix.stat' */ + /* Module declarations from 'ssh2.c_ssh2' */ /* Module declarations from 'ssh2.session' */ diff --git a/ssh2/c_ssh2.pxd b/ssh2/c_ssh2.pxd index 67123d6e..3d5d86d4 100644 --- a/ssh2/c_ssh2.pxd +++ b/ssh2/c_ssh2.pxd @@ -18,6 +18,7 @@ from libc.stdint cimport uint64_t from libc.time cimport time_t from posix.types cimport (blkcnt_t, blksize_t, dev_t, gid_t, ino_t, nlink_t, off_t, time_t, uid_t) +from posix.stat cimport struct_stat cdef extern from "libssh2.h" nogil: @@ -311,7 +312,7 @@ cdef extern from "libssh2.h" nogil: # libssh2_scp_recv is DEPRECATED, do not use! LIBSSH2_CHANNEL *libssh2_scp_recv(LIBSSH2_SESSION *session, const char *path, - libssh2_struct_stat *sb) + struct_stat *sb) # Use libssh2_scp_recv2 for large (> 2GB) file support on windows LIBSSH2_CHANNEL *libssh2_scp_recv2(LIBSSH2_SESSION *session, const char *path, diff --git a/ssh2/channel.c b/ssh2/channel.c index d7018363..564ce743 100644 --- a/ssh2/channel.c +++ b/ssh2/channel.c @@ -492,6 +492,8 @@ static CYTHON_INLINE float __PYX_NAN() { #include #include #include +#include +#include #include "libssh2.h" #include #include @@ -1167,6 +1169,8 @@ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* Module declarations from 'posix.types' */ +/* Module declarations from 'posix.stat' */ + /* Module declarations from 'ssh2.c_ssh2' */ /* Module declarations from 'ssh2.session' */ diff --git a/ssh2/error_codes.c b/ssh2/error_codes.c index 3027d958..9dd66071 100644 --- a/ssh2/error_codes.c +++ b/ssh2/error_codes.c @@ -493,6 +493,8 @@ static CYTHON_INLINE float __PYX_NAN() { #include #include #include +#include +#include #ifdef _OPENMP #include #endif /* _OPENMP */ @@ -827,6 +829,8 @@ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* Module declarations from 'posix.types' */ +/* Module declarations from 'posix.stat' */ + /* Module declarations from 'ssh2.c_ssh2' */ /* Module declarations from 'ssh2.error_codes' */ diff --git a/ssh2/fileinfo.c b/ssh2/fileinfo.c index b9834c95..6ca7076b 100644 --- a/ssh2/fileinfo.c +++ b/ssh2/fileinfo.c @@ -492,6 +492,8 @@ static CYTHON_INLINE float __PYX_NAN() { #include #include #include +#include +#include #include "libssh2.h" #include #include @@ -930,6 +932,8 @@ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* Module declarations from 'posix.types' */ +/* Module declarations from 'posix.stat' */ + /* Module declarations from 'ssh2.c_ssh2' */ /* Module declarations from 'libc.string' */ diff --git a/ssh2/listener.c b/ssh2/listener.c index c93ad23c..2f359e83 100644 --- a/ssh2/listener.c +++ b/ssh2/listener.c @@ -492,6 +492,8 @@ static CYTHON_INLINE float __PYX_NAN() { #include #include #include +#include +#include #include "libssh2.h" #ifdef _OPENMP #include @@ -981,6 +983,8 @@ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* Module declarations from 'posix.types' */ +/* Module declarations from 'posix.stat' */ + /* Module declarations from 'ssh2.c_ssh2' */ /* Module declarations from 'ssh2.session' */ diff --git a/ssh2/pkey.c b/ssh2/pkey.c index 2b3991fb..86c70517 100644 --- a/ssh2/pkey.c +++ b/ssh2/pkey.c @@ -492,6 +492,8 @@ static CYTHON_INLINE float __PYX_NAN() { #include #include #include +#include +#include #include "libssh2.h" #ifdef _OPENMP #include @@ -891,6 +893,8 @@ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* Module declarations from 'posix.types' */ +/* Module declarations from 'posix.stat' */ + /* Module declarations from 'ssh2.c_ssh2' */ /* Module declarations from 'ssh2.pkey' */ diff --git a/ssh2/session.c b/ssh2/session.c index fbba8126..c09d3293 100644 --- a/ssh2/session.c +++ b/ssh2/session.c @@ -492,6 +492,8 @@ static CYTHON_INLINE float __PYX_NAN() { #include #include #include +#include +#include #include "libssh2.h" #include #include @@ -708,6 +710,7 @@ static const char *__pyx_f[] = { "ssh2/listener.pxd", "ssh2/sftp.pxd", "ssh2/fileinfo.pxd", + "ssh2/statinfo.pxd", }; /*--- Type declarations ---*/ @@ -727,6 +730,7 @@ struct __pyx_obj_4ssh2_10exceptions_SFTPBufferTooSmall; struct __pyx_obj_4ssh2_8listener_Listener; struct __pyx_obj_4ssh2_4sftp_SFTP; struct __pyx_obj_4ssh2_8fileinfo_FileInfo; +struct __pyx_obj_4ssh2_8statinfo_StatInfo; struct __pyx_obj_4ssh2_7session_Session; /* "agent.pxd":24 @@ -929,6 +933,19 @@ struct __pyx_obj_4ssh2_8fileinfo_FileInfo { }; +/* "statinfo.pxd":4 + * + * + * cdef class StatInfo: # <<<<<<<<<<<<<< + * """Representation of stat structure - older version""" + * cdef struct_stat* _stat + */ +struct __pyx_obj_4ssh2_8statinfo_StatInfo { + PyObject_HEAD + struct stat *_stat; +}; + + /* "ssh2/session.pxd":20 * * @@ -944,7 +961,7 @@ struct __pyx_obj_4ssh2_7session_Session { -/* "ssh2/session.pyx":33 +/* "ssh2/session.pyx":34 * * * cdef class Session: # <<<<<<<<<<<<<< @@ -1201,6 +1218,8 @@ static LIBSSH2_AGENT *__pyx_f_4ssh2_7session_7Session_init_connect_agent(struct /* Module declarations from 'posix.types' */ +/* Module declarations from 'posix.stat' */ + /* Module declarations from 'ssh2.c_ssh2' */ /* Module declarations from 'cpython.version' */ @@ -1326,6 +1345,9 @@ static PyObject *(*__pyx_f_4ssh2_5utils_to_str)(char *); /*proto*/ /* Module declarations from 'ssh2.fileinfo' */ static PyTypeObject *__pyx_ptype_4ssh2_8fileinfo_FileInfo = 0; +/* Module declarations from 'ssh2.statinfo' */ +static PyTypeObject *__pyx_ptype_4ssh2_8statinfo_StatInfo = 0; + /* Module declarations from 'ssh2.session' */ static PyTypeObject *__pyx_ptype_4ssh2_7session_Session = 0; #define __Pyx_MODULE_NAME "ssh2.session" @@ -1439,7 +1461,7 @@ static PyObject *__pyx_tuple__4; static PyObject *__pyx_tuple__6; static PyObject *__pyx_tuple__7; -/* "ssh2/session.pyx":37 +/* "ssh2/session.pyx":38 * """LibSSH2 Session class providing session functions""" * * def __cinit__(self): # <<<<<<<<<<<<<< @@ -1469,7 +1491,7 @@ static int __pyx_pf_4ssh2_7session_7Session___cinit__(struct __pyx_obj_4ssh2_7se int __pyx_t_1; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "ssh2/session.pyx":38 + /* "ssh2/session.pyx":39 * * def __cinit__(self): * with nogil: # <<<<<<<<<<<<<< @@ -1484,7 +1506,7 @@ static int __pyx_pf_4ssh2_7session_7Session___cinit__(struct __pyx_obj_4ssh2_7se #endif /*try:*/ { - /* "ssh2/session.pyx":39 + /* "ssh2/session.pyx":40 * def __cinit__(self): * with nogil: * self._session = c_ssh2.libssh2_session_init() # <<<<<<<<<<<<<< @@ -1493,7 +1515,7 @@ static int __pyx_pf_4ssh2_7session_7Session___cinit__(struct __pyx_obj_4ssh2_7se */ __pyx_v_self->_session = libssh2_session_init(); - /* "ssh2/session.pyx":40 + /* "ssh2/session.pyx":41 * with nogil: * self._session = c_ssh2.libssh2_session_init() * if self._session is NULL: # <<<<<<<<<<<<<< @@ -1503,7 +1525,7 @@ static int __pyx_pf_4ssh2_7session_7Session___cinit__(struct __pyx_obj_4ssh2_7se __pyx_t_1 = ((__pyx_v_self->_session == NULL) != 0); if (__pyx_t_1) { - /* "ssh2/session.pyx":41 + /* "ssh2/session.pyx":42 * self._session = c_ssh2.libssh2_session_init() * if self._session is NULL: * with gil: # <<<<<<<<<<<<<< @@ -1516,17 +1538,17 @@ static int __pyx_pf_4ssh2_7session_7Session___cinit__(struct __pyx_obj_4ssh2_7se #endif /*try:*/ { - /* "ssh2/session.pyx":42 + /* "ssh2/session.pyx":43 * if self._session is NULL: * with gil: * raise MemoryError # <<<<<<<<<<<<<< * * def __dealloc__(self): */ - PyErr_NoMemory(); __PYX_ERR(0, 42, __pyx_L8_error) + PyErr_NoMemory(); __PYX_ERR(0, 43, __pyx_L8_error) } - /* "ssh2/session.pyx":41 + /* "ssh2/session.pyx":42 * self._session = c_ssh2.libssh2_session_init() * if self._session is NULL: * with gil: # <<<<<<<<<<<<<< @@ -1543,7 +1565,7 @@ static int __pyx_pf_4ssh2_7session_7Session___cinit__(struct __pyx_obj_4ssh2_7se } } - /* "ssh2/session.pyx":40 + /* "ssh2/session.pyx":41 * with nogil: * self._session = c_ssh2.libssh2_session_init() * if self._session is NULL: # <<<<<<<<<<<<<< @@ -1553,7 +1575,7 @@ static int __pyx_pf_4ssh2_7session_7Session___cinit__(struct __pyx_obj_4ssh2_7se } } - /* "ssh2/session.pyx":38 + /* "ssh2/session.pyx":39 * * def __cinit__(self): * with nogil: # <<<<<<<<<<<<<< @@ -1579,7 +1601,7 @@ static int __pyx_pf_4ssh2_7session_7Session___cinit__(struct __pyx_obj_4ssh2_7se } } - /* "ssh2/session.pyx":37 + /* "ssh2/session.pyx":38 * """LibSSH2 Session class providing session functions""" * * def __cinit__(self): # <<<<<<<<<<<<<< @@ -1598,7 +1620,7 @@ static int __pyx_pf_4ssh2_7session_7Session___cinit__(struct __pyx_obj_4ssh2_7se return __pyx_r; } -/* "ssh2/session.pyx":44 +/* "ssh2/session.pyx":45 * raise MemoryError * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -1621,7 +1643,7 @@ static void __pyx_pf_4ssh2_7session_7Session_2__dealloc__(struct __pyx_obj_4ssh2 __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "ssh2/session.pyx":45 + /* "ssh2/session.pyx":46 * * def __dealloc__(self): * with nogil: # <<<<<<<<<<<<<< @@ -1636,7 +1658,7 @@ static void __pyx_pf_4ssh2_7session_7Session_2__dealloc__(struct __pyx_obj_4ssh2 #endif /*try:*/ { - /* "ssh2/session.pyx":46 + /* "ssh2/session.pyx":47 * def __dealloc__(self): * with nogil: * c_ssh2.libssh2_session_disconnect( # <<<<<<<<<<<<<< @@ -1645,7 +1667,7 @@ static void __pyx_pf_4ssh2_7session_7Session_2__dealloc__(struct __pyx_obj_4ssh2 */ libssh2_session_disconnect(__pyx_v_self->_session, ((char const *)"end")); - /* "ssh2/session.pyx":48 + /* "ssh2/session.pyx":49 * c_ssh2.libssh2_session_disconnect( * self._session, "end") * c_ssh2.libssh2_session_free(self._session) # <<<<<<<<<<<<<< @@ -1655,7 +1677,7 @@ static void __pyx_pf_4ssh2_7session_7Session_2__dealloc__(struct __pyx_obj_4ssh2 libssh2_session_free(__pyx_v_self->_session); } - /* "ssh2/session.pyx":45 + /* "ssh2/session.pyx":46 * * def __dealloc__(self): * with nogil: # <<<<<<<<<<<<<< @@ -1674,7 +1696,7 @@ static void __pyx_pf_4ssh2_7session_7Session_2__dealloc__(struct __pyx_obj_4ssh2 } } - /* "ssh2/session.pyx":44 + /* "ssh2/session.pyx":45 * raise MemoryError * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -1686,7 +1708,7 @@ static void __pyx_pf_4ssh2_7session_7Session_2__dealloc__(struct __pyx_obj_4ssh2 __Pyx_RefNannyFinishContext(); } -/* "ssh2/session.pyx":50 +/* "ssh2/session.pyx":51 * c_ssh2.libssh2_session_free(self._session) * * def disconnect(self): # <<<<<<<<<<<<<< @@ -1713,7 +1735,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_4disconnect(struct __pyx_obj_4 __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("disconnect", 0); - /* "ssh2/session.pyx":51 + /* "ssh2/session.pyx":52 * * def disconnect(self): * with nogil: # <<<<<<<<<<<<<< @@ -1728,7 +1750,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_4disconnect(struct __pyx_obj_4 #endif /*try:*/ { - /* "ssh2/session.pyx":52 + /* "ssh2/session.pyx":53 * def disconnect(self): * with nogil: * c_ssh2.libssh2_session_disconnect(self._session, "end") # <<<<<<<<<<<<<< @@ -1738,7 +1760,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_4disconnect(struct __pyx_obj_4 libssh2_session_disconnect(__pyx_v_self->_session, ((char const *)"end")); } - /* "ssh2/session.pyx":51 + /* "ssh2/session.pyx":52 * * def disconnect(self): * with nogil: # <<<<<<<<<<<<<< @@ -1757,7 +1779,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_4disconnect(struct __pyx_obj_4 } } - /* "ssh2/session.pyx":50 + /* "ssh2/session.pyx":51 * c_ssh2.libssh2_session_free(self._session) * * def disconnect(self): # <<<<<<<<<<<<<< @@ -1772,7 +1794,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_4disconnect(struct __pyx_obj_4 return __pyx_r; } -/* "ssh2/session.pyx":54 +/* "ssh2/session.pyx":55 * c_ssh2.libssh2_session_disconnect(self._session, "end") * * def handshake(self, sock not None): # <<<<<<<<<<<<<< @@ -1788,7 +1810,7 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_7handshake(PyObject *__pyx_v_s __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("handshake (wrapper)", 0); if (unlikely(((PyObject *)__pyx_v_sock) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "sock"); __PYX_ERR(0, 54, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "sock"); __PYX_ERR(0, 55, __pyx_L1_error) } __pyx_r = __pyx_pf_4ssh2_7session_7Session_6handshake(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), ((PyObject *)__pyx_v_sock)); @@ -1813,17 +1835,17 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_6handshake(struct __pyx_obj_4s PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("handshake", 0); - /* "ssh2/session.pyx":55 + /* "ssh2/session.pyx":56 * * def handshake(self, sock not None): * cdef int _sock = PyObject_AsFileDescriptor(sock) # <<<<<<<<<<<<<< * cdef int rc * with nogil: */ - __pyx_t_1 = PyObject_AsFileDescriptor(__pyx_v_sock); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 55, __pyx_L1_error) + __pyx_t_1 = PyObject_AsFileDescriptor(__pyx_v_sock); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 56, __pyx_L1_error) __pyx_v__sock = __pyx_t_1; - /* "ssh2/session.pyx":57 + /* "ssh2/session.pyx":58 * cdef int _sock = PyObject_AsFileDescriptor(sock) * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -1838,7 +1860,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_6handshake(struct __pyx_obj_4s #endif /*try:*/ { - /* "ssh2/session.pyx":58 + /* "ssh2/session.pyx":59 * cdef int rc * with nogil: * rc = c_ssh2.libssh2_session_handshake(self._session, _sock) # <<<<<<<<<<<<<< @@ -1847,7 +1869,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_6handshake(struct __pyx_obj_4s */ __pyx_v_rc = libssh2_session_handshake(__pyx_v_self->_session, __pyx_v__sock); - /* "ssh2/session.pyx":59 + /* "ssh2/session.pyx":60 * with nogil: * rc = c_ssh2.libssh2_session_handshake(self._session, _sock) * if rc != 0 and rc != c_ssh2._LIBSSH2_ERROR_EAGAIN: # <<<<<<<<<<<<<< @@ -1865,7 +1887,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_6handshake(struct __pyx_obj_4s __pyx_L7_bool_binop_done:; if (__pyx_t_2) { - /* "ssh2/session.pyx":60 + /* "ssh2/session.pyx":61 * rc = c_ssh2.libssh2_session_handshake(self._session, _sock) * if rc != 0 and rc != c_ssh2._LIBSSH2_ERROR_EAGAIN: * with gil: # <<<<<<<<<<<<<< @@ -1878,24 +1900,24 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_6handshake(struct __pyx_obj_4s #endif /*try:*/ { - /* "ssh2/session.pyx":63 + /* "ssh2/session.pyx":64 * raise SessionHandshakeError( * "SSH session handshake failed with error code %s", * rc) # <<<<<<<<<<<<<< * return rc * */ - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 63, __pyx_L10_error) + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 64, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_4); - /* "ssh2/session.pyx":61 + /* "ssh2/session.pyx":62 * if rc != 0 and rc != c_ssh2._LIBSSH2_ERROR_EAGAIN: * with gil: * raise SessionHandshakeError( # <<<<<<<<<<<<<< * "SSH session handshake failed with error code %s", * rc) */ - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 61, __pyx_L10_error) + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 62, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_kp_s_SSH_session_handshake_failed_wit); __Pyx_GIVEREF(__pyx_kp_s_SSH_session_handshake_failed_wit); @@ -1903,15 +1925,15 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_6handshake(struct __pyx_obj_4s __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4ssh2_10exceptions_SessionHandshakeError), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 61, __pyx_L10_error) + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4ssh2_10exceptions_SessionHandshakeError), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 62, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(0, 61, __pyx_L10_error) + __PYX_ERR(0, 62, __pyx_L10_error) } - /* "ssh2/session.pyx":60 + /* "ssh2/session.pyx":61 * rc = c_ssh2.libssh2_session_handshake(self._session, _sock) * if rc != 0 and rc != c_ssh2._LIBSSH2_ERROR_EAGAIN: * with gil: # <<<<<<<<<<<<<< @@ -1928,7 +1950,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_6handshake(struct __pyx_obj_4s } } - /* "ssh2/session.pyx":59 + /* "ssh2/session.pyx":60 * with nogil: * rc = c_ssh2.libssh2_session_handshake(self._session, _sock) * if rc != 0 and rc != c_ssh2._LIBSSH2_ERROR_EAGAIN: # <<<<<<<<<<<<<< @@ -1938,7 +1960,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_6handshake(struct __pyx_obj_4s } } - /* "ssh2/session.pyx":57 + /* "ssh2/session.pyx":58 * cdef int _sock = PyObject_AsFileDescriptor(sock) * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -1964,7 +1986,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_6handshake(struct __pyx_obj_4s } } - /* "ssh2/session.pyx":64 + /* "ssh2/session.pyx":65 * "SSH session handshake failed with error code %s", * rc) * return rc # <<<<<<<<<<<<<< @@ -1972,13 +1994,13 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_6handshake(struct __pyx_obj_4s * def startup(self, sock): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 64, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":54 + /* "ssh2/session.pyx":55 * c_ssh2.libssh2_session_disconnect(self._session, "end") * * def handshake(self, sock not None): # <<<<<<<<<<<<<< @@ -1998,7 +2020,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_6handshake(struct __pyx_obj_4s return __pyx_r; } -/* "ssh2/session.pyx":66 +/* "ssh2/session.pyx":67 * return rc * * def startup(self, sock): # <<<<<<<<<<<<<< @@ -2032,17 +2054,17 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_8startup(struct __pyx_obj_4ssh PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("startup", 0); - /* "ssh2/session.pyx":68 + /* "ssh2/session.pyx":69 * def startup(self, sock): * """Deprecated - use self.handshake""" * cdef int _sock = PyObject_AsFileDescriptor(sock) # <<<<<<<<<<<<<< * cdef int rc * with nogil: */ - __pyx_t_1 = PyObject_AsFileDescriptor(__pyx_v_sock); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 68, __pyx_L1_error) + __pyx_t_1 = PyObject_AsFileDescriptor(__pyx_v_sock); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 69, __pyx_L1_error) __pyx_v__sock = __pyx_t_1; - /* "ssh2/session.pyx":70 + /* "ssh2/session.pyx":71 * cdef int _sock = PyObject_AsFileDescriptor(sock) * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -2057,7 +2079,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_8startup(struct __pyx_obj_4ssh #endif /*try:*/ { - /* "ssh2/session.pyx":71 + /* "ssh2/session.pyx":72 * cdef int rc * with nogil: * rc = c_ssh2.libssh2_session_startup(self._session, _sock) # <<<<<<<<<<<<<< @@ -2066,7 +2088,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_8startup(struct __pyx_obj_4ssh */ __pyx_v_rc = libssh2_session_startup(__pyx_v_self->_session, __pyx_v__sock); - /* "ssh2/session.pyx":72 + /* "ssh2/session.pyx":73 * with nogil: * rc = c_ssh2.libssh2_session_startup(self._session, _sock) * if rc != 0 and rc != c_ssh2._LIBSSH2_ERROR_EAGAIN: # <<<<<<<<<<<<<< @@ -2084,7 +2106,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_8startup(struct __pyx_obj_4ssh __pyx_L7_bool_binop_done:; if (__pyx_t_2) { - /* "ssh2/session.pyx":73 + /* "ssh2/session.pyx":74 * rc = c_ssh2.libssh2_session_startup(self._session, _sock) * if rc != 0 and rc != c_ssh2._LIBSSH2_ERROR_EAGAIN: * with gil: # <<<<<<<<<<<<<< @@ -2097,24 +2119,24 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_8startup(struct __pyx_obj_4ssh #endif /*try:*/ { - /* "ssh2/session.pyx":76 + /* "ssh2/session.pyx":77 * raise SessionStartupError( * "SSH session startup failed with error code %s", * rc) # <<<<<<<<<<<<<< * return rc * */ - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 76, __pyx_L10_error) + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 77, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_4); - /* "ssh2/session.pyx":74 + /* "ssh2/session.pyx":75 * if rc != 0 and rc != c_ssh2._LIBSSH2_ERROR_EAGAIN: * with gil: * raise SessionStartupError( # <<<<<<<<<<<<<< * "SSH session startup failed with error code %s", * rc) */ - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 74, __pyx_L10_error) + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 75, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_kp_s_SSH_session_startup_failed_with); __Pyx_GIVEREF(__pyx_kp_s_SSH_session_startup_failed_with); @@ -2122,15 +2144,15 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_8startup(struct __pyx_obj_4ssh __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4ssh2_10exceptions_SessionStartupError), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 74, __pyx_L10_error) + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4ssh2_10exceptions_SessionStartupError), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 75, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(0, 74, __pyx_L10_error) + __PYX_ERR(0, 75, __pyx_L10_error) } - /* "ssh2/session.pyx":73 + /* "ssh2/session.pyx":74 * rc = c_ssh2.libssh2_session_startup(self._session, _sock) * if rc != 0 and rc != c_ssh2._LIBSSH2_ERROR_EAGAIN: * with gil: # <<<<<<<<<<<<<< @@ -2147,7 +2169,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_8startup(struct __pyx_obj_4ssh } } - /* "ssh2/session.pyx":72 + /* "ssh2/session.pyx":73 * with nogil: * rc = c_ssh2.libssh2_session_startup(self._session, _sock) * if rc != 0 and rc != c_ssh2._LIBSSH2_ERROR_EAGAIN: # <<<<<<<<<<<<<< @@ -2157,7 +2179,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_8startup(struct __pyx_obj_4ssh } } - /* "ssh2/session.pyx":70 + /* "ssh2/session.pyx":71 * cdef int _sock = PyObject_AsFileDescriptor(sock) * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -2183,7 +2205,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_8startup(struct __pyx_obj_4ssh } } - /* "ssh2/session.pyx":77 + /* "ssh2/session.pyx":78 * "SSH session startup failed with error code %s", * rc) * return rc # <<<<<<<<<<<<<< @@ -2191,13 +2213,13 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_8startup(struct __pyx_obj_4ssh * def set_blocking(self, bint blocking): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 77, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":66 + /* "ssh2/session.pyx":67 * return rc * * def startup(self, sock): # <<<<<<<<<<<<<< @@ -2217,7 +2239,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_8startup(struct __pyx_obj_4ssh return __pyx_r; } -/* "ssh2/session.pyx":79 +/* "ssh2/session.pyx":80 * return rc * * def set_blocking(self, bint blocking): # <<<<<<<<<<<<<< @@ -2234,7 +2256,7 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_11set_blocking(PyObject *__pyx __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_blocking (wrapper)", 0); assert(__pyx_arg_blocking); { - __pyx_v_blocking = __Pyx_PyObject_IsTrue(__pyx_arg_blocking); if (unlikely((__pyx_v_blocking == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 79, __pyx_L3_error) + __pyx_v_blocking = __Pyx_PyObject_IsTrue(__pyx_arg_blocking); if (unlikely((__pyx_v_blocking == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 80, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -2254,7 +2276,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_10set_blocking(struct __pyx_ob __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_blocking", 0); - /* "ssh2/session.pyx":85 + /* "ssh2/session.pyx":86 * Session default is blocking unless set otherwise. * :type blocking: bool""" * with nogil: # <<<<<<<<<<<<<< @@ -2269,7 +2291,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_10set_blocking(struct __pyx_ob #endif /*try:*/ { - /* "ssh2/session.pyx":86 + /* "ssh2/session.pyx":87 * :type blocking: bool""" * with nogil: * c_ssh2.libssh2_session_set_blocking( # <<<<<<<<<<<<<< @@ -2279,7 +2301,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_10set_blocking(struct __pyx_ob libssh2_session_set_blocking(__pyx_v_self->_session, __pyx_v_blocking); } - /* "ssh2/session.pyx":85 + /* "ssh2/session.pyx":86 * Session default is blocking unless set otherwise. * :type blocking: bool""" * with nogil: # <<<<<<<<<<<<<< @@ -2298,7 +2320,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_10set_blocking(struct __pyx_ob } } - /* "ssh2/session.pyx":79 + /* "ssh2/session.pyx":80 * return rc * * def set_blocking(self, bint blocking): # <<<<<<<<<<<<<< @@ -2313,7 +2335,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_10set_blocking(struct __pyx_ob return __pyx_r; } -/* "ssh2/session.pyx":89 +/* "ssh2/session.pyx":90 * self._session, blocking) * * def get_blocking(self): # <<<<<<<<<<<<<< @@ -2343,7 +2365,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_12get_blocking(struct __pyx_ob int __pyx_t_2; __Pyx_RefNannySetupContext("get_blocking", 0); - /* "ssh2/session.pyx":94 + /* "ssh2/session.pyx":95 * :rtype: bool""" * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -2358,7 +2380,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_12get_blocking(struct __pyx_ob #endif /*try:*/ { - /* "ssh2/session.pyx":95 + /* "ssh2/session.pyx":96 * cdef int rc * with nogil: * rc = c_ssh2.libssh2_session_get_blocking(self._session) # <<<<<<<<<<<<<< @@ -2368,7 +2390,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_12get_blocking(struct __pyx_ob __pyx_v_rc = libssh2_session_get_blocking(__pyx_v_self->_session); } - /* "ssh2/session.pyx":94 + /* "ssh2/session.pyx":95 * :rtype: bool""" * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -2387,7 +2409,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_12get_blocking(struct __pyx_ob } } - /* "ssh2/session.pyx":96 + /* "ssh2/session.pyx":97 * with nogil: * rc = c_ssh2.libssh2_session_get_blocking(self._session) * return bool(rc) # <<<<<<<<<<<<<< @@ -2395,17 +2417,17 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_12get_blocking(struct __pyx_ob * def set_timeout(self, long timeout): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 96, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 96, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 97, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 96, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":89 + /* "ssh2/session.pyx":90 * self._session, blocking) * * def get_blocking(self): # <<<<<<<<<<<<<< @@ -2424,7 +2446,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_12get_blocking(struct __pyx_ob return __pyx_r; } -/* "ssh2/session.pyx":98 +/* "ssh2/session.pyx":99 * return bool(rc) * * def set_timeout(self, long timeout): # <<<<<<<<<<<<<< @@ -2441,7 +2463,7 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_15set_timeout(PyObject *__pyx_ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_timeout (wrapper)", 0); assert(__pyx_arg_timeout); { - __pyx_v_timeout = __Pyx_PyInt_As_long(__pyx_arg_timeout); if (unlikely((__pyx_v_timeout == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 98, __pyx_L3_error) + __pyx_v_timeout = __Pyx_PyInt_As_long(__pyx_arg_timeout); if (unlikely((__pyx_v_timeout == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 99, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -2461,7 +2483,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_14set_timeout(struct __pyx_obj __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_timeout", 0); - /* "ssh2/session.pyx":106 + /* "ssh2/session.pyx":107 * for blocking functions. * :param timeout: Milliseconds to wait before timeout.""" * with nogil: # <<<<<<<<<<<<<< @@ -2476,7 +2498,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_14set_timeout(struct __pyx_obj #endif /*try:*/ { - /* "ssh2/session.pyx":107 + /* "ssh2/session.pyx":108 * :param timeout: Milliseconds to wait before timeout.""" * with nogil: * c_ssh2.libssh2_session_set_timeout(self._session, timeout) # <<<<<<<<<<<<<< @@ -2486,7 +2508,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_14set_timeout(struct __pyx_obj libssh2_session_set_timeout(__pyx_v_self->_session, __pyx_v_timeout); } - /* "ssh2/session.pyx":106 + /* "ssh2/session.pyx":107 * for blocking functions. * :param timeout: Milliseconds to wait before timeout.""" * with nogil: # <<<<<<<<<<<<<< @@ -2505,7 +2527,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_14set_timeout(struct __pyx_obj } } - /* "ssh2/session.pyx":98 + /* "ssh2/session.pyx":99 * return bool(rc) * * def set_timeout(self, long timeout): # <<<<<<<<<<<<<< @@ -2520,7 +2542,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_14set_timeout(struct __pyx_obj return __pyx_r; } -/* "ssh2/session.pyx":109 +/* "ssh2/session.pyx":110 * c_ssh2.libssh2_session_set_timeout(self._session, timeout) * * def get_timeout(self): # <<<<<<<<<<<<<< @@ -2549,7 +2571,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_16get_timeout(struct __pyx_obj PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("get_timeout", 0); - /* "ssh2/session.pyx":112 + /* "ssh2/session.pyx":113 * """Get current session timeout setting""" * cdef long timeout * with nogil: # <<<<<<<<<<<<<< @@ -2564,7 +2586,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_16get_timeout(struct __pyx_obj #endif /*try:*/ { - /* "ssh2/session.pyx":113 + /* "ssh2/session.pyx":114 * cdef long timeout * with nogil: * timeout = c_ssh2.libssh2_session_get_timeout(self._session) # <<<<<<<<<<<<<< @@ -2574,7 +2596,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_16get_timeout(struct __pyx_obj __pyx_v_timeout = libssh2_session_get_timeout(__pyx_v_self->_session); } - /* "ssh2/session.pyx":112 + /* "ssh2/session.pyx":113 * """Get current session timeout setting""" * cdef long timeout * with nogil: # <<<<<<<<<<<<<< @@ -2593,7 +2615,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_16get_timeout(struct __pyx_obj } } - /* "ssh2/session.pyx":114 + /* "ssh2/session.pyx":115 * with nogil: * timeout = c_ssh2.libssh2_session_get_timeout(self._session) * return timeout # <<<<<<<<<<<<<< @@ -2601,13 +2623,13 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_16get_timeout(struct __pyx_obj * def userauth_authenticated(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_timeout); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 114, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_timeout); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 115, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":109 + /* "ssh2/session.pyx":110 * c_ssh2.libssh2_session_set_timeout(self._session, timeout) * * def get_timeout(self): # <<<<<<<<<<<<<< @@ -2626,7 +2648,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_16get_timeout(struct __pyx_obj return __pyx_r; } -/* "ssh2/session.pyx":116 +/* "ssh2/session.pyx":117 * return timeout * * def userauth_authenticated(self): # <<<<<<<<<<<<<< @@ -2656,7 +2678,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_18userauth_authenticated(struc PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("userauth_authenticated", 0); - /* "ssh2/session.pyx":121 + /* "ssh2/session.pyx":122 * :rtype: bool""" * cdef bint rc * with nogil: # <<<<<<<<<<<<<< @@ -2671,7 +2693,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_18userauth_authenticated(struc #endif /*try:*/ { - /* "ssh2/session.pyx":122 + /* "ssh2/session.pyx":123 * cdef bint rc * with nogil: * rc = c_ssh2.libssh2_userauth_authenticated(self._session) # <<<<<<<<<<<<<< @@ -2681,7 +2703,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_18userauth_authenticated(struc __pyx_v_rc = libssh2_userauth_authenticated(__pyx_v_self->_session); } - /* "ssh2/session.pyx":121 + /* "ssh2/session.pyx":122 * :rtype: bool""" * cdef bint rc * with nogil: # <<<<<<<<<<<<<< @@ -2700,7 +2722,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_18userauth_authenticated(struc } } - /* "ssh2/session.pyx":123 + /* "ssh2/session.pyx":124 * with nogil: * rc = c_ssh2.libssh2_userauth_authenticated(self._session) * return bool(rc) # <<<<<<<<<<<<<< @@ -2709,13 +2731,13 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_18userauth_authenticated(struc */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_v_rc; - __pyx_t_2 = __Pyx_PyBool_FromLong((!(!__pyx_t_1))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 123, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBool_FromLong((!(!__pyx_t_1))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":116 + /* "ssh2/session.pyx":117 * return timeout * * def userauth_authenticated(self): # <<<<<<<<<<<<<< @@ -2734,7 +2756,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_18userauth_authenticated(struc return __pyx_r; } -/* "ssh2/session.pyx":125 +/* "ssh2/session.pyx":126 * return bool(rc) * * def userauth_list(self, username not None): # <<<<<<<<<<<<<< @@ -2750,7 +2772,7 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_21userauth_list(PyObject *__py __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("userauth_list (wrapper)", 0); if (unlikely(((PyObject *)__pyx_v_username) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "username"); __PYX_ERR(0, 125, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "username"); __PYX_ERR(0, 126, __pyx_L1_error) } __pyx_r = __pyx_pf_4ssh2_7session_7Session_20userauth_list(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), ((PyObject *)__pyx_v_username)); @@ -2776,7 +2798,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_20userauth_list(struct __pyx_o PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("userauth_list", 0); - /* "ssh2/session.pyx":129 + /* "ssh2/session.pyx":130 * * :rtype: list""" * cdef char *_username = to_bytes(username) # <<<<<<<<<<<<<< @@ -2785,7 +2807,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_20userauth_list(struct __pyx_o */ __pyx_v__username = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_username); - /* "ssh2/session.pyx":130 + /* "ssh2/session.pyx":131 * :rtype: list""" * cdef char *_username = to_bytes(username) * cdef size_t username_len = len(_username) # <<<<<<<<<<<<<< @@ -2795,7 +2817,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_20userauth_list(struct __pyx_o __pyx_t_1 = strlen(__pyx_v__username); __pyx_v_username_len = __pyx_t_1; - /* "ssh2/session.pyx":133 + /* "ssh2/session.pyx":134 * cdef char *_auth * cdef str auth * with nogil: # <<<<<<<<<<<<<< @@ -2810,7 +2832,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_20userauth_list(struct __pyx_o #endif /*try:*/ { - /* "ssh2/session.pyx":134 + /* "ssh2/session.pyx":135 * cdef str auth * with nogil: * _auth = c_ssh2.libssh2_userauth_list( # <<<<<<<<<<<<<< @@ -2820,7 +2842,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_20userauth_list(struct __pyx_o __pyx_v__auth = libssh2_userauth_list(__pyx_v_self->_session, __pyx_v__username, __pyx_v_username_len); } - /* "ssh2/session.pyx":133 + /* "ssh2/session.pyx":134 * cdef char *_auth * cdef str auth * with nogil: # <<<<<<<<<<<<<< @@ -2839,7 +2861,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_20userauth_list(struct __pyx_o } } - /* "ssh2/session.pyx":136 + /* "ssh2/session.pyx":137 * _auth = c_ssh2.libssh2_userauth_list( * self._session, _username, username_len) * if _auth is NULL: # <<<<<<<<<<<<<< @@ -2849,7 +2871,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_20userauth_list(struct __pyx_o __pyx_t_2 = ((__pyx_v__auth == NULL) != 0); if (__pyx_t_2) { - /* "ssh2/session.pyx":137 + /* "ssh2/session.pyx":138 * self._session, _username, username_len) * if _auth is NULL: * return # <<<<<<<<<<<<<< @@ -2860,7 +2882,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_20userauth_list(struct __pyx_o __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "ssh2/session.pyx":136 + /* "ssh2/session.pyx":137 * _auth = c_ssh2.libssh2_userauth_list( * self._session, _username, username_len) * if _auth is NULL: # <<<<<<<<<<<<<< @@ -2869,20 +2891,20 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_20userauth_list(struct __pyx_o */ } - /* "ssh2/session.pyx":138 + /* "ssh2/session.pyx":139 * if _auth is NULL: * return * auth = to_str(_auth) # <<<<<<<<<<<<<< * return auth.split(',') * */ - __pyx_t_3 = __pyx_f_4ssh2_5utils_to_str(__pyx_v__auth); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 138, __pyx_L1_error) + __pyx_t_3 = __pyx_f_4ssh2_5utils_to_str(__pyx_v__auth); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (!(likely(PyString_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(0, 138, __pyx_L1_error) + if (!(likely(PyString_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(0, 139, __pyx_L1_error) __pyx_v_auth = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; - /* "ssh2/session.pyx":139 + /* "ssh2/session.pyx":140 * return * auth = to_str(_auth) * return auth.split(',') # <<<<<<<<<<<<<< @@ -2890,16 +2912,16 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_20userauth_list(struct __pyx_o * def userauth_publickey_fromfile(self, username not None, */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_auth, __pyx_n_s_split); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 139, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_auth, __pyx_n_s_split); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 139, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":125 + /* "ssh2/session.pyx":126 * return bool(rc) * * def userauth_list(self, username not None): # <<<<<<<<<<<<<< @@ -2920,7 +2942,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_20userauth_list(struct __pyx_o return __pyx_r; } -/* "ssh2/session.pyx":141 +/* "ssh2/session.pyx":142 * return auth.split(',') * * def userauth_publickey_fromfile(self, username not None, # <<<<<<<<<<<<<< @@ -2966,23 +2988,23 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_23userauth_publickey_fromfile( case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_publickey)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("userauth_publickey_fromfile", 1, 4, 4, 1); __PYX_ERR(0, 141, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("userauth_publickey_fromfile", 1, 4, 4, 1); __PYX_ERR(0, 142, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_privatekey)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("userauth_publickey_fromfile", 1, 4, 4, 2); __PYX_ERR(0, 141, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("userauth_publickey_fromfile", 1, 4, 4, 2); __PYX_ERR(0, 142, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_passphrase)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("userauth_publickey_fromfile", 1, 4, 4, 3); __PYX_ERR(0, 141, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("userauth_publickey_fromfile", 1, 4, 4, 3); __PYX_ERR(0, 142, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "userauth_publickey_fromfile") < 0)) __PYX_ERR(0, 141, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "userauth_publickey_fromfile") < 0)) __PYX_ERR(0, 142, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; @@ -2999,23 +3021,23 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_23userauth_publickey_fromfile( } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("userauth_publickey_fromfile", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 141, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("userauth_publickey_fromfile", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 142, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.session.Session.userauth_publickey_fromfile", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(((PyObject *)__pyx_v_username) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "username"); __PYX_ERR(0, 141, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "username"); __PYX_ERR(0, 142, __pyx_L1_error) } if (unlikely(((PyObject *)__pyx_v_publickey) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "publickey"); __PYX_ERR(0, 142, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "publickey"); __PYX_ERR(0, 143, __pyx_L1_error) } if (unlikely(((PyObject *)__pyx_v_privatekey) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "privatekey"); __PYX_ERR(0, 143, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "privatekey"); __PYX_ERR(0, 144, __pyx_L1_error) } if (unlikely(((PyObject *)__pyx_v_passphrase) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "passphrase"); __PYX_ERR(0, 144, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "passphrase"); __PYX_ERR(0, 145, __pyx_L1_error) } __pyx_r = __pyx_pf_4ssh2_7session_7Session_22userauth_publickey_fromfile(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), __pyx_v_username, __pyx_v_publickey, __pyx_v_privatekey, __pyx_v_passphrase); @@ -3039,7 +3061,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_22userauth_publickey_fromfile( PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("userauth_publickey_fromfile", 0); - /* "ssh2/session.pyx":149 + /* "ssh2/session.pyx":150 * :rtype: int""" * cdef int rc * cdef char *_username = to_bytes(username) # <<<<<<<<<<<<<< @@ -3048,7 +3070,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_22userauth_publickey_fromfile( */ __pyx_v__username = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_username); - /* "ssh2/session.pyx":150 + /* "ssh2/session.pyx":151 * cdef int rc * cdef char *_username = to_bytes(username) * cdef char *_publickey = to_bytes(publickey) # <<<<<<<<<<<<<< @@ -3057,7 +3079,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_22userauth_publickey_fromfile( */ __pyx_v__publickey = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_publickey); - /* "ssh2/session.pyx":151 + /* "ssh2/session.pyx":152 * cdef char *_username = to_bytes(username) * cdef char *_publickey = to_bytes(publickey) * cdef char *_privatekey = to_bytes(privatekey) # <<<<<<<<<<<<<< @@ -3066,7 +3088,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_22userauth_publickey_fromfile( */ __pyx_v__privatekey = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_privatekey); - /* "ssh2/session.pyx":152 + /* "ssh2/session.pyx":153 * cdef char *_publickey = to_bytes(publickey) * cdef char *_privatekey = to_bytes(privatekey) * cdef char *_passphrase = to_bytes(passphrase) # <<<<<<<<<<<<<< @@ -3075,7 +3097,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_22userauth_publickey_fromfile( */ __pyx_v__passphrase = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_passphrase); - /* "ssh2/session.pyx":153 + /* "ssh2/session.pyx":154 * cdef char *_privatekey = to_bytes(privatekey) * cdef char *_passphrase = to_bytes(passphrase) * with nogil: # <<<<<<<<<<<<<< @@ -3090,7 +3112,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_22userauth_publickey_fromfile( #endif /*try:*/ { - /* "ssh2/session.pyx":154 + /* "ssh2/session.pyx":155 * cdef char *_passphrase = to_bytes(passphrase) * with nogil: * rc = c_ssh2.libssh2_userauth_publickey_fromfile( # <<<<<<<<<<<<<< @@ -3100,7 +3122,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_22userauth_publickey_fromfile( __pyx_v_rc = libssh2_userauth_publickey_fromfile(__pyx_v_self->_session, __pyx_v__username, __pyx_v__publickey, __pyx_v__privatekey, __pyx_v__passphrase); } - /* "ssh2/session.pyx":153 + /* "ssh2/session.pyx":154 * cdef char *_privatekey = to_bytes(privatekey) * cdef char *_passphrase = to_bytes(passphrase) * with nogil: # <<<<<<<<<<<<<< @@ -3119,7 +3141,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_22userauth_publickey_fromfile( } } - /* "ssh2/session.pyx":156 + /* "ssh2/session.pyx":157 * rc = c_ssh2.libssh2_userauth_publickey_fromfile( * self._session, _username, _publickey, _privatekey, _passphrase) * return rc # <<<<<<<<<<<<<< @@ -3127,13 +3149,13 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_22userauth_publickey_fromfile( * def userauth_publickey(self, username not None, */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 156, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":141 + /* "ssh2/session.pyx":142 * return auth.split(',') * * def userauth_publickey_fromfile(self, username not None, # <<<<<<<<<<<<<< @@ -3152,7 +3174,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_22userauth_publickey_fromfile( return __pyx_r; } -/* "ssh2/session.pyx":158 +/* "ssh2/session.pyx":159 * return rc * * def userauth_publickey(self, username not None, # <<<<<<<<<<<<<< @@ -3192,11 +3214,11 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_25userauth_publickey(PyObject case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pubkeydata)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("userauth_publickey", 1, 2, 2, 1); __PYX_ERR(0, 158, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("userauth_publickey", 1, 2, 2, 1); __PYX_ERR(0, 159, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "userauth_publickey") < 0)) __PYX_ERR(0, 158, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "userauth_publickey") < 0)) __PYX_ERR(0, 159, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -3209,16 +3231,16 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_25userauth_publickey(PyObject } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("userauth_publickey", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 158, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("userauth_publickey", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 159, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.session.Session.userauth_publickey", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(((PyObject *)__pyx_v_username) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "username"); __PYX_ERR(0, 158, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "username"); __PYX_ERR(0, 159, __pyx_L1_error) } - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pubkeydata), (&PyBytes_Type), 0, "pubkeydata", 1))) __PYX_ERR(0, 159, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pubkeydata), (&PyBytes_Type), 0, "pubkeydata", 1))) __PYX_ERR(0, 160, __pyx_L1_error) __pyx_r = __pyx_pf_4ssh2_7session_7Session_24userauth_publickey(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), __pyx_v_username, __pyx_v_pubkeydata); /* function exit code */ @@ -3242,7 +3264,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_24userauth_publickey(struct __ PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("userauth_publickey", 0); - /* "ssh2/session.pyx":170 + /* "ssh2/session.pyx":171 * """ * cdef int rc * cdef char *_username = to_bytes(username) # <<<<<<<<<<<<<< @@ -3251,27 +3273,27 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_24userauth_publickey(struct __ */ __pyx_v__username = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_username); - /* "ssh2/session.pyx":171 + /* "ssh2/session.pyx":172 * cdef int rc * cdef char *_username = to_bytes(username) * cdef unsigned char *_pubkeydata = pubkeydata # <<<<<<<<<<<<<< * cdef size_t pubkeydata_len = len(pubkeydata) * with nogil: */ - __pyx_t_1 = __Pyx_PyObject_AsWritableUString(__pyx_v_pubkeydata); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(0, 171, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_AsWritableUString(__pyx_v_pubkeydata); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(0, 172, __pyx_L1_error) __pyx_v__pubkeydata = __pyx_t_1; - /* "ssh2/session.pyx":172 + /* "ssh2/session.pyx":173 * cdef char *_username = to_bytes(username) * cdef unsigned char *_pubkeydata = pubkeydata * cdef size_t pubkeydata_len = len(pubkeydata) # <<<<<<<<<<<<<< * with nogil: * rc = c_ssh2.libssh2_userauth_publickey( */ - __pyx_t_2 = PyBytes_GET_SIZE(__pyx_v_pubkeydata); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 172, __pyx_L1_error) + __pyx_t_2 = PyBytes_GET_SIZE(__pyx_v_pubkeydata); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 173, __pyx_L1_error) __pyx_v_pubkeydata_len = __pyx_t_2; - /* "ssh2/session.pyx":173 + /* "ssh2/session.pyx":174 * cdef unsigned char *_pubkeydata = pubkeydata * cdef size_t pubkeydata_len = len(pubkeydata) * with nogil: # <<<<<<<<<<<<<< @@ -3286,7 +3308,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_24userauth_publickey(struct __ #endif /*try:*/ { - /* "ssh2/session.pyx":174 + /* "ssh2/session.pyx":175 * cdef size_t pubkeydata_len = len(pubkeydata) * with nogil: * rc = c_ssh2.libssh2_userauth_publickey( # <<<<<<<<<<<<<< @@ -3296,7 +3318,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_24userauth_publickey(struct __ __pyx_v_rc = libssh2_userauth_publickey(__pyx_v_self->_session, __pyx_v__username, __pyx_v__pubkeydata, __pyx_v_pubkeydata_len, NULL, NULL); } - /* "ssh2/session.pyx":173 + /* "ssh2/session.pyx":174 * cdef unsigned char *_pubkeydata = pubkeydata * cdef size_t pubkeydata_len = len(pubkeydata) * with nogil: # <<<<<<<<<<<<<< @@ -3315,7 +3337,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_24userauth_publickey(struct __ } } - /* "ssh2/session.pyx":177 + /* "ssh2/session.pyx":178 * self._session, _username, _pubkeydata, * pubkeydata_len, NULL, NULL) * return rc # <<<<<<<<<<<<<< @@ -3323,13 +3345,13 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_24userauth_publickey(struct __ * def userauth_hostbased_fromfile(self, */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 177, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 178, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":158 + /* "ssh2/session.pyx":159 * return rc * * def userauth_publickey(self, username not None, # <<<<<<<<<<<<<< @@ -3348,7 +3370,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_24userauth_publickey(struct __ return __pyx_r; } -/* "ssh2/session.pyx":179 +/* "ssh2/session.pyx":180 * return rc * * def userauth_hostbased_fromfile(self, # <<<<<<<<<<<<<< @@ -3397,29 +3419,29 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_27userauth_hostbased_fromfile( case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_publickey)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("userauth_hostbased_fromfile", 1, 5, 5, 1); __PYX_ERR(0, 179, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("userauth_hostbased_fromfile", 1, 5, 5, 1); __PYX_ERR(0, 180, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_privatekey)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("userauth_hostbased_fromfile", 1, 5, 5, 2); __PYX_ERR(0, 179, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("userauth_hostbased_fromfile", 1, 5, 5, 2); __PYX_ERR(0, 180, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_passphrase)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("userauth_hostbased_fromfile", 1, 5, 5, 3); __PYX_ERR(0, 179, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("userauth_hostbased_fromfile", 1, 5, 5, 3); __PYX_ERR(0, 180, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_hostname)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("userauth_hostbased_fromfile", 1, 5, 5, 4); __PYX_ERR(0, 179, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("userauth_hostbased_fromfile", 1, 5, 5, 4); __PYX_ERR(0, 180, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "userauth_hostbased_fromfile") < 0)) __PYX_ERR(0, 179, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "userauth_hostbased_fromfile") < 0)) __PYX_ERR(0, 180, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 5) { goto __pyx_L5_argtuple_error; @@ -3438,26 +3460,26 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_27userauth_hostbased_fromfile( } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("userauth_hostbased_fromfile", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 179, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("userauth_hostbased_fromfile", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 180, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.session.Session.userauth_hostbased_fromfile", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(((PyObject *)__pyx_v_username) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "username"); __PYX_ERR(0, 180, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "username"); __PYX_ERR(0, 181, __pyx_L1_error) } if (unlikely(((PyObject *)__pyx_v_publickey) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "publickey"); __PYX_ERR(0, 181, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "publickey"); __PYX_ERR(0, 182, __pyx_L1_error) } if (unlikely(((PyObject *)__pyx_v_privatekey) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "privatekey"); __PYX_ERR(0, 182, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "privatekey"); __PYX_ERR(0, 183, __pyx_L1_error) } if (unlikely(((PyObject *)__pyx_v_passphrase) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "passphrase"); __PYX_ERR(0, 183, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "passphrase"); __PYX_ERR(0, 184, __pyx_L1_error) } if (unlikely(((PyObject *)__pyx_v_hostname) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "hostname"); __PYX_ERR(0, 184, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "hostname"); __PYX_ERR(0, 185, __pyx_L1_error) } __pyx_r = __pyx_pf_4ssh2_7session_7Session_26userauth_hostbased_fromfile(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), __pyx_v_username, __pyx_v_publickey, __pyx_v_privatekey, __pyx_v_passphrase, __pyx_v_hostname); @@ -3482,7 +3504,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_26userauth_hostbased_fromfile( PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("userauth_hostbased_fromfile", 0); - /* "ssh2/session.pyx":186 + /* "ssh2/session.pyx":187 * hostname not None): * cdef int rc * cdef char *_username = to_bytes(username) # <<<<<<<<<<<<<< @@ -3491,7 +3513,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_26userauth_hostbased_fromfile( */ __pyx_v__username = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_username); - /* "ssh2/session.pyx":187 + /* "ssh2/session.pyx":188 * cdef int rc * cdef char *_username = to_bytes(username) * cdef char *_publickey = to_bytes(publickey) # <<<<<<<<<<<<<< @@ -3500,7 +3522,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_26userauth_hostbased_fromfile( */ __pyx_v__publickey = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_publickey); - /* "ssh2/session.pyx":188 + /* "ssh2/session.pyx":189 * cdef char *_username = to_bytes(username) * cdef char *_publickey = to_bytes(publickey) * cdef char *_privatekey = to_bytes(privatekey) # <<<<<<<<<<<<<< @@ -3509,7 +3531,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_26userauth_hostbased_fromfile( */ __pyx_v__privatekey = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_privatekey); - /* "ssh2/session.pyx":189 + /* "ssh2/session.pyx":190 * cdef char *_publickey = to_bytes(publickey) * cdef char *_privatekey = to_bytes(privatekey) * cdef char *_passphrase = to_bytes(passphrase) # <<<<<<<<<<<<<< @@ -3518,7 +3540,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_26userauth_hostbased_fromfile( */ __pyx_v__passphrase = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_passphrase); - /* "ssh2/session.pyx":190 + /* "ssh2/session.pyx":191 * cdef char *_privatekey = to_bytes(privatekey) * cdef char *_passphrase = to_bytes(passphrase) * cdef char *_hostname = to_bytes(hostname) # <<<<<<<<<<<<<< @@ -3527,7 +3549,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_26userauth_hostbased_fromfile( */ __pyx_v__hostname = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_hostname); - /* "ssh2/session.pyx":191 + /* "ssh2/session.pyx":192 * cdef char *_passphrase = to_bytes(passphrase) * cdef char *_hostname = to_bytes(hostname) * with nogil: # <<<<<<<<<<<<<< @@ -3542,7 +3564,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_26userauth_hostbased_fromfile( #endif /*try:*/ { - /* "ssh2/session.pyx":192 + /* "ssh2/session.pyx":193 * cdef char *_hostname = to_bytes(hostname) * with nogil: * rc = c_ssh2.libssh2_userauth_hostbased_fromfile( # <<<<<<<<<<<<<< @@ -3552,7 +3574,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_26userauth_hostbased_fromfile( __pyx_v_rc = libssh2_userauth_hostbased_fromfile(__pyx_v_self->_session, __pyx_v__username, __pyx_v__publickey, __pyx_v__privatekey, __pyx_v__passphrase, __pyx_v__hostname); } - /* "ssh2/session.pyx":191 + /* "ssh2/session.pyx":192 * cdef char *_passphrase = to_bytes(passphrase) * cdef char *_hostname = to_bytes(hostname) * with nogil: # <<<<<<<<<<<<<< @@ -3571,7 +3593,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_26userauth_hostbased_fromfile( } } - /* "ssh2/session.pyx":195 + /* "ssh2/session.pyx":196 * self._session, _username, _publickey, * _privatekey, _passphrase, _hostname) * return rc # <<<<<<<<<<<<<< @@ -3579,13 +3601,13 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_26userauth_hostbased_fromfile( * # def userauth_publickey_frommemory(self, */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 195, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":179 + /* "ssh2/session.pyx":180 * return rc * * def userauth_hostbased_fromfile(self, # <<<<<<<<<<<<<< @@ -3604,7 +3626,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_26userauth_hostbased_fromfile( return __pyx_r; } -/* "ssh2/session.pyx":213 +/* "ssh2/session.pyx":214 * # return rc * * def userauth_password(self, username not None, password not None): # <<<<<<<<<<<<<< @@ -3644,11 +3666,11 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_29userauth_password(PyObject * case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_password)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("userauth_password", 1, 2, 2, 1); __PYX_ERR(0, 213, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("userauth_password", 1, 2, 2, 1); __PYX_ERR(0, 214, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "userauth_password") < 0)) __PYX_ERR(0, 213, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "userauth_password") < 0)) __PYX_ERR(0, 214, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -3661,17 +3683,17 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_29userauth_password(PyObject * } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("userauth_password", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 213, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("userauth_password", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 214, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.session.Session.userauth_password", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(((PyObject *)__pyx_v_username) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "username"); __PYX_ERR(0, 213, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "username"); __PYX_ERR(0, 214, __pyx_L1_error) } if (unlikely(((PyObject *)__pyx_v_password) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "password"); __PYX_ERR(0, 213, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "password"); __PYX_ERR(0, 214, __pyx_L1_error) } __pyx_r = __pyx_pf_4ssh2_7session_7Session_28userauth_password(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), __pyx_v_username, __pyx_v_password); @@ -3693,7 +3715,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_28userauth_password(struct __p PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("userauth_password", 0); - /* "ssh2/session.pyx":221 + /* "ssh2/session.pyx":222 * :type password: str""" * cdef int rc * cdef const char *_username = to_bytes(username) # <<<<<<<<<<<<<< @@ -3702,7 +3724,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_28userauth_password(struct __p */ __pyx_v__username = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_username); - /* "ssh2/session.pyx":222 + /* "ssh2/session.pyx":223 * cdef int rc * cdef const char *_username = to_bytes(username) * cdef const char *_password = to_bytes(password) # <<<<<<<<<<<<<< @@ -3711,7 +3733,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_28userauth_password(struct __p */ __pyx_v__password = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_password); - /* "ssh2/session.pyx":223 + /* "ssh2/session.pyx":224 * cdef const char *_username = to_bytes(username) * cdef const char *_password = to_bytes(password) * with nogil: # <<<<<<<<<<<<<< @@ -3726,7 +3748,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_28userauth_password(struct __p #endif /*try:*/ { - /* "ssh2/session.pyx":224 + /* "ssh2/session.pyx":225 * cdef const char *_password = to_bytes(password) * with nogil: * rc = c_ssh2.libssh2_userauth_password( # <<<<<<<<<<<<<< @@ -3736,7 +3758,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_28userauth_password(struct __p __pyx_v_rc = libssh2_userauth_password(__pyx_v_self->_session, __pyx_v__username, __pyx_v__password); } - /* "ssh2/session.pyx":223 + /* "ssh2/session.pyx":224 * cdef const char *_username = to_bytes(username) * cdef const char *_password = to_bytes(password) * with nogil: # <<<<<<<<<<<<<< @@ -3755,7 +3777,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_28userauth_password(struct __p } } - /* "ssh2/session.pyx":226 + /* "ssh2/session.pyx":227 * rc = c_ssh2.libssh2_userauth_password( * self._session, _username, _password) * return rc # <<<<<<<<<<<<<< @@ -3763,13 +3785,13 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_28userauth_password(struct __p * def agent_init(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 226, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":213 + /* "ssh2/session.pyx":214 * # return rc * * def userauth_password(self, username not None, password not None): # <<<<<<<<<<<<<< @@ -3788,7 +3810,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_28userauth_password(struct __p return __pyx_r; } -/* "ssh2/session.pyx":228 +/* "ssh2/session.pyx":229 * return rc * * def agent_init(self): # <<<<<<<<<<<<<< @@ -3818,7 +3840,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_30agent_init(struct __pyx_obj_ PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("agent_init", 0); - /* "ssh2/session.pyx":233 + /* "ssh2/session.pyx":234 * :rtype: :py:class:`ssh2.agent.Agent` * """ * cdef c_ssh2.LIBSSH2_AGENT *agent = self._agent_init() # <<<<<<<<<<<<<< @@ -3827,7 +3849,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_30agent_init(struct __pyx_obj_ */ __pyx_v_agent = ((struct __pyx_vtabstruct_4ssh2_7session_Session *)__pyx_v_self->__pyx_vtab)->_agent_init(__pyx_v_self); - /* "ssh2/session.pyx":234 + /* "ssh2/session.pyx":235 * """ * cdef c_ssh2.LIBSSH2_AGENT *agent = self._agent_init() * if agent is NULL: # <<<<<<<<<<<<<< @@ -3837,7 +3859,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_30agent_init(struct __pyx_obj_ __pyx_t_1 = ((__pyx_v_agent == NULL) != 0); if (__pyx_t_1) { - /* "ssh2/session.pyx":235 + /* "ssh2/session.pyx":236 * cdef c_ssh2.LIBSSH2_AGENT *agent = self._agent_init() * if agent is NULL: * return # <<<<<<<<<<<<<< @@ -3848,7 +3870,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_30agent_init(struct __pyx_obj_ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "ssh2/session.pyx":234 + /* "ssh2/session.pyx":235 * """ * cdef c_ssh2.LIBSSH2_AGENT *agent = self._agent_init() * if agent is NULL: # <<<<<<<<<<<<<< @@ -3857,7 +3879,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_30agent_init(struct __pyx_obj_ */ } - /* "ssh2/session.pyx":236 + /* "ssh2/session.pyx":237 * if agent is NULL: * return * return PyAgent(agent, self) # <<<<<<<<<<<<<< @@ -3865,13 +3887,13 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_30agent_init(struct __pyx_obj_ * cdef c_ssh2.LIBSSH2_AGENT * _agent_init(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __pyx_f_4ssh2_5agent_PyAgent(__pyx_v_agent, __pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 236, __pyx_L1_error) + __pyx_t_2 = __pyx_f_4ssh2_5agent_PyAgent(__pyx_v_agent, __pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":228 + /* "ssh2/session.pyx":229 * return rc * * def agent_init(self): # <<<<<<<<<<<<<< @@ -3890,7 +3912,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_30agent_init(struct __pyx_obj_ return __pyx_r; } -/* "ssh2/session.pyx":238 +/* "ssh2/session.pyx":239 * return PyAgent(agent, self) * * cdef c_ssh2.LIBSSH2_AGENT * _agent_init(self): # <<<<<<<<<<<<<< @@ -3905,7 +3927,7 @@ static LIBSSH2_AGENT *__pyx_f_4ssh2_7session_7Session__agent_init(struct __pyx_o int __pyx_t_1; __Pyx_RefNannySetupContext("_agent_init", 0); - /* "ssh2/session.pyx":240 + /* "ssh2/session.pyx":241 * cdef c_ssh2.LIBSSH2_AGENT * _agent_init(self): * cdef c_ssh2.LIBSSH2_AGENT *agent * with nogil: # <<<<<<<<<<<<<< @@ -3920,7 +3942,7 @@ static LIBSSH2_AGENT *__pyx_f_4ssh2_7session_7Session__agent_init(struct __pyx_o #endif /*try:*/ { - /* "ssh2/session.pyx":241 + /* "ssh2/session.pyx":242 * cdef c_ssh2.LIBSSH2_AGENT *agent * with nogil: * agent = c_ssh2.libssh2_agent_init(self._session) # <<<<<<<<<<<<<< @@ -3929,7 +3951,7 @@ static LIBSSH2_AGENT *__pyx_f_4ssh2_7session_7Session__agent_init(struct __pyx_o */ __pyx_v_agent = libssh2_agent_init(__pyx_v_self->_session); - /* "ssh2/session.pyx":242 + /* "ssh2/session.pyx":243 * with nogil: * agent = c_ssh2.libssh2_agent_init(self._session) * if agent is NULL: # <<<<<<<<<<<<<< @@ -3939,7 +3961,7 @@ static LIBSSH2_AGENT *__pyx_f_4ssh2_7session_7Session__agent_init(struct __pyx_o __pyx_t_1 = ((__pyx_v_agent == NULL) != 0); if (__pyx_t_1) { - /* "ssh2/session.pyx":243 + /* "ssh2/session.pyx":244 * agent = c_ssh2.libssh2_agent_init(self._session) * if agent is NULL: * with gil: # <<<<<<<<<<<<<< @@ -3952,17 +3974,17 @@ static LIBSSH2_AGENT *__pyx_f_4ssh2_7session_7Session__agent_init(struct __pyx_o #endif /*try:*/ { - /* "ssh2/session.pyx":244 + /* "ssh2/session.pyx":245 * if agent is NULL: * with gil: * raise MemoryError # <<<<<<<<<<<<<< * return agent * */ - PyErr_NoMemory(); __PYX_ERR(0, 244, __pyx_L8_error) + PyErr_NoMemory(); __PYX_ERR(0, 245, __pyx_L8_error) } - /* "ssh2/session.pyx":243 + /* "ssh2/session.pyx":244 * agent = c_ssh2.libssh2_agent_init(self._session) * if agent is NULL: * with gil: # <<<<<<<<<<<<<< @@ -3979,7 +4001,7 @@ static LIBSSH2_AGENT *__pyx_f_4ssh2_7session_7Session__agent_init(struct __pyx_o } } - /* "ssh2/session.pyx":242 + /* "ssh2/session.pyx":243 * with nogil: * agent = c_ssh2.libssh2_agent_init(self._session) * if agent is NULL: # <<<<<<<<<<<<<< @@ -3988,7 +4010,7 @@ static LIBSSH2_AGENT *__pyx_f_4ssh2_7session_7Session__agent_init(struct __pyx_o */ } - /* "ssh2/session.pyx":245 + /* "ssh2/session.pyx":246 * with gil: * raise MemoryError * return agent # <<<<<<<<<<<<<< @@ -3999,7 +4021,7 @@ static LIBSSH2_AGENT *__pyx_f_4ssh2_7session_7Session__agent_init(struct __pyx_o goto __pyx_L3_return; } - /* "ssh2/session.pyx":240 + /* "ssh2/session.pyx":241 * cdef c_ssh2.LIBSSH2_AGENT * _agent_init(self): * cdef c_ssh2.LIBSSH2_AGENT *agent * with nogil: # <<<<<<<<<<<<<< @@ -4024,7 +4046,7 @@ static LIBSSH2_AGENT *__pyx_f_4ssh2_7session_7Session__agent_init(struct __pyx_o } } - /* "ssh2/session.pyx":238 + /* "ssh2/session.pyx":239 * return PyAgent(agent, self) * * cdef c_ssh2.LIBSSH2_AGENT * _agent_init(self): # <<<<<<<<<<<<<< @@ -4041,7 +4063,7 @@ static LIBSSH2_AGENT *__pyx_f_4ssh2_7session_7Session__agent_init(struct __pyx_o return __pyx_r; } -/* "ssh2/session.pyx":247 +/* "ssh2/session.pyx":248 * return agent * * cdef c_ssh2.LIBSSH2_AGENT * init_connect_agent(self) nogil except NULL: # <<<<<<<<<<<<<< @@ -4063,7 +4085,7 @@ static LIBSSH2_AGENT *__pyx_f_4ssh2_7session_7Session_init_connect_agent(struct __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif - /* "ssh2/session.pyx":248 + /* "ssh2/session.pyx":249 * * cdef c_ssh2.LIBSSH2_AGENT * init_connect_agent(self) nogil except NULL: * agent = c_ssh2.libssh2_agent_init(self._session) # <<<<<<<<<<<<<< @@ -4073,7 +4095,7 @@ static LIBSSH2_AGENT *__pyx_f_4ssh2_7session_7Session_init_connect_agent(struct /*try:*/ { __pyx_v_agent = libssh2_agent_init(__pyx_v_self->_session); - /* "ssh2/session.pyx":249 + /* "ssh2/session.pyx":250 * cdef c_ssh2.LIBSSH2_AGENT * init_connect_agent(self) nogil except NULL: * agent = c_ssh2.libssh2_agent_init(self._session) * if agent is NULL: # <<<<<<<<<<<<<< @@ -4083,7 +4105,7 @@ static LIBSSH2_AGENT *__pyx_f_4ssh2_7session_7Session_init_connect_agent(struct __pyx_t_1 = ((__pyx_v_agent == NULL) != 0); if (__pyx_t_1) { - /* "ssh2/session.pyx":250 + /* "ssh2/session.pyx":251 * agent = c_ssh2.libssh2_agent_init(self._session) * if agent is NULL: * with gil: # <<<<<<<<<<<<<< @@ -4096,17 +4118,17 @@ static LIBSSH2_AGENT *__pyx_f_4ssh2_7session_7Session_init_connect_agent(struct #endif /*try:*/ { - /* "ssh2/session.pyx":251 + /* "ssh2/session.pyx":252 * if agent is NULL: * with gil: * raise MemoryError # <<<<<<<<<<<<<< * if c_ssh2.libssh2_agent_connect(agent) != 0: * c_ssh2.libssh2_agent_free(agent) */ - PyErr_NoMemory(); __PYX_ERR(0, 251, __pyx_L8_error) + PyErr_NoMemory(); __PYX_ERR(0, 252, __pyx_L8_error) } - /* "ssh2/session.pyx":250 + /* "ssh2/session.pyx":251 * agent = c_ssh2.libssh2_agent_init(self._session) * if agent is NULL: * with gil: # <<<<<<<<<<<<<< @@ -4123,7 +4145,7 @@ static LIBSSH2_AGENT *__pyx_f_4ssh2_7session_7Session_init_connect_agent(struct } } - /* "ssh2/session.pyx":249 + /* "ssh2/session.pyx":250 * cdef c_ssh2.LIBSSH2_AGENT * init_connect_agent(self) nogil except NULL: * agent = c_ssh2.libssh2_agent_init(self._session) * if agent is NULL: # <<<<<<<<<<<<<< @@ -4132,7 +4154,7 @@ static LIBSSH2_AGENT *__pyx_f_4ssh2_7session_7Session_init_connect_agent(struct */ } - /* "ssh2/session.pyx":252 + /* "ssh2/session.pyx":253 * with gil: * raise MemoryError * if c_ssh2.libssh2_agent_connect(agent) != 0: # <<<<<<<<<<<<<< @@ -4142,7 +4164,7 @@ static LIBSSH2_AGENT *__pyx_f_4ssh2_7session_7Session_init_connect_agent(struct __pyx_t_1 = ((libssh2_agent_connect(__pyx_v_agent) != 0) != 0); if (__pyx_t_1) { - /* "ssh2/session.pyx":253 + /* "ssh2/session.pyx":254 * raise MemoryError * if c_ssh2.libssh2_agent_connect(agent) != 0: * c_ssh2.libssh2_agent_free(agent) # <<<<<<<<<<<<<< @@ -4151,7 +4173,7 @@ static LIBSSH2_AGENT *__pyx_f_4ssh2_7session_7Session_init_connect_agent(struct */ libssh2_agent_free(__pyx_v_agent); - /* "ssh2/session.pyx":254 + /* "ssh2/session.pyx":255 * if c_ssh2.libssh2_agent_connect(agent) != 0: * c_ssh2.libssh2_agent_free(agent) * with gil: # <<<<<<<<<<<<<< @@ -4164,21 +4186,21 @@ static LIBSSH2_AGENT *__pyx_f_4ssh2_7session_7Session_init_connect_agent(struct #endif /*try:*/ { - /* "ssh2/session.pyx":255 + /* "ssh2/session.pyx":256 * c_ssh2.libssh2_agent_free(agent) * with gil: * raise AgentConnectionError("Unable to connect to agent") # <<<<<<<<<<<<<< * return agent * */ - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4ssh2_10exceptions_AgentConnectionError), __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 255, __pyx_L12_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4ssh2_10exceptions_AgentConnectionError), __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 256, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 255, __pyx_L12_error) + __PYX_ERR(0, 256, __pyx_L12_error) } - /* "ssh2/session.pyx":254 + /* "ssh2/session.pyx":255 * if c_ssh2.libssh2_agent_connect(agent) != 0: * c_ssh2.libssh2_agent_free(agent) * with gil: # <<<<<<<<<<<<<< @@ -4195,7 +4217,7 @@ static LIBSSH2_AGENT *__pyx_f_4ssh2_7session_7Session_init_connect_agent(struct } } - /* "ssh2/session.pyx":252 + /* "ssh2/session.pyx":253 * with gil: * raise MemoryError * if c_ssh2.libssh2_agent_connect(agent) != 0: # <<<<<<<<<<<<<< @@ -4204,7 +4226,7 @@ static LIBSSH2_AGENT *__pyx_f_4ssh2_7session_7Session_init_connect_agent(struct */ } - /* "ssh2/session.pyx":256 + /* "ssh2/session.pyx":257 * with gil: * raise AgentConnectionError("Unable to connect to agent") * return agent # <<<<<<<<<<<<<< @@ -4215,7 +4237,7 @@ static LIBSSH2_AGENT *__pyx_f_4ssh2_7session_7Session_init_connect_agent(struct goto __pyx_L3_return; } - /* "ssh2/session.pyx":248 + /* "ssh2/session.pyx":249 * * cdef c_ssh2.LIBSSH2_AGENT * init_connect_agent(self) nogil except NULL: * agent = c_ssh2.libssh2_agent_init(self._session) # <<<<<<<<<<<<<< @@ -4237,7 +4259,7 @@ static LIBSSH2_AGENT *__pyx_f_4ssh2_7session_7Session_init_connect_agent(struct } } - /* "ssh2/session.pyx":247 + /* "ssh2/session.pyx":248 * return agent * * cdef c_ssh2.LIBSSH2_AGENT * init_connect_agent(self) nogil except NULL: # <<<<<<<<<<<<<< @@ -4259,7 +4281,7 @@ static LIBSSH2_AGENT *__pyx_f_4ssh2_7session_7Session_init_connect_agent(struct return __pyx_r; } -/* "ssh2/session.pyx":258 +/* "ssh2/session.pyx":259 * return agent * * def agent_auth(self, username not None): # <<<<<<<<<<<<<< @@ -4275,7 +4297,7 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_33agent_auth(PyObject *__pyx_v __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("agent_auth (wrapper)", 0); if (unlikely(((PyObject *)__pyx_v_username) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "username"); __PYX_ERR(0, 258, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "username"); __PYX_ERR(0, 259, __pyx_L1_error) } __pyx_r = __pyx_pf_4ssh2_7session_7Session_32agent_auth(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), ((PyObject *)__pyx_v_username)); @@ -4301,7 +4323,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_32agent_auth(struct __pyx_obj_ int __pyx_t_4; __Pyx_RefNannySetupContext("agent_auth", 0); - /* "ssh2/session.pyx":286 + /* "ssh2/session.pyx":287 * :rtype: None * """ * cdef char *_username = to_bytes(username) # <<<<<<<<<<<<<< @@ -4310,7 +4332,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_32agent_auth(struct __pyx_obj_ */ __pyx_v__username = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_username); - /* "ssh2/session.pyx":287 + /* "ssh2/session.pyx":288 * """ * cdef char *_username = to_bytes(username) * cdef c_ssh2.LIBSSH2_AGENT *agent = NULL # <<<<<<<<<<<<<< @@ -4319,7 +4341,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_32agent_auth(struct __pyx_obj_ */ __pyx_v_agent = NULL; - /* "ssh2/session.pyx":288 + /* "ssh2/session.pyx":289 * cdef char *_username = to_bytes(username) * cdef c_ssh2.LIBSSH2_AGENT *agent = NULL * cdef c_ssh2.libssh2_agent_publickey *identity = NULL # <<<<<<<<<<<<<< @@ -4328,7 +4350,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_32agent_auth(struct __pyx_obj_ */ __pyx_v_identity = NULL; - /* "ssh2/session.pyx":289 + /* "ssh2/session.pyx":290 * cdef c_ssh2.LIBSSH2_AGENT *agent = NULL * cdef c_ssh2.libssh2_agent_publickey *identity = NULL * cdef c_ssh2.libssh2_agent_publickey *prev = NULL # <<<<<<<<<<<<<< @@ -4337,7 +4359,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_32agent_auth(struct __pyx_obj_ */ __pyx_v_prev = NULL; - /* "ssh2/session.pyx":290 + /* "ssh2/session.pyx":291 * cdef c_ssh2.libssh2_agent_publickey *identity = NULL * cdef c_ssh2.libssh2_agent_publickey *prev = NULL * with nogil: # <<<<<<<<<<<<<< @@ -4352,17 +4374,17 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_32agent_auth(struct __pyx_obj_ #endif /*try:*/ { - /* "ssh2/session.pyx":291 + /* "ssh2/session.pyx":292 * cdef c_ssh2.libssh2_agent_publickey *prev = NULL * with nogil: * agent = self.init_connect_agent() # <<<<<<<<<<<<<< * if c_ssh2.libssh2_agent_list_identities(agent) != 0: * clear_agent(agent) */ - __pyx_t_1 = ((struct __pyx_vtabstruct_4ssh2_7session_Session *)__pyx_v_self->__pyx_vtab)->init_connect_agent(__pyx_v_self); if (unlikely(__pyx_t_1 == NULL)) __PYX_ERR(0, 291, __pyx_L4_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_4ssh2_7session_Session *)__pyx_v_self->__pyx_vtab)->init_connect_agent(__pyx_v_self); if (unlikely(__pyx_t_1 == NULL)) __PYX_ERR(0, 292, __pyx_L4_error) __pyx_v_agent = __pyx_t_1; - /* "ssh2/session.pyx":292 + /* "ssh2/session.pyx":293 * with nogil: * agent = self.init_connect_agent() * if c_ssh2.libssh2_agent_list_identities(agent) != 0: # <<<<<<<<<<<<<< @@ -4372,7 +4394,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_32agent_auth(struct __pyx_obj_ __pyx_t_2 = ((libssh2_agent_list_identities(__pyx_v_agent) != 0) != 0); if (__pyx_t_2) { - /* "ssh2/session.pyx":293 + /* "ssh2/session.pyx":294 * agent = self.init_connect_agent() * if c_ssh2.libssh2_agent_list_identities(agent) != 0: * clear_agent(agent) # <<<<<<<<<<<<<< @@ -4381,7 +4403,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_32agent_auth(struct __pyx_obj_ */ __pyx_f_4ssh2_5agent_clear_agent(__pyx_v_agent); - /* "ssh2/session.pyx":294 + /* "ssh2/session.pyx":295 * if c_ssh2.libssh2_agent_list_identities(agent) != 0: * clear_agent(agent) * with gil: # <<<<<<<<<<<<<< @@ -4394,21 +4416,21 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_32agent_auth(struct __pyx_obj_ #endif /*try:*/ { - /* "ssh2/session.pyx":295 + /* "ssh2/session.pyx":296 * clear_agent(agent) * with gil: * raise AgentListIdentitiesError( # <<<<<<<<<<<<<< * "Failure requesting identities from agent") * while 1: */ - __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4ssh2_10exceptions_AgentListIdentitiesError), __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 295, __pyx_L8_error) + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4ssh2_10exceptions_AgentListIdentitiesError), __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 296, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 295, __pyx_L8_error) + __PYX_ERR(0, 296, __pyx_L8_error) } - /* "ssh2/session.pyx":294 + /* "ssh2/session.pyx":295 * if c_ssh2.libssh2_agent_list_identities(agent) != 0: * clear_agent(agent) * with gil: # <<<<<<<<<<<<<< @@ -4425,7 +4447,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_32agent_auth(struct __pyx_obj_ } } - /* "ssh2/session.pyx":292 + /* "ssh2/session.pyx":293 * with nogil: * agent = self.init_connect_agent() * if c_ssh2.libssh2_agent_list_identities(agent) != 0: # <<<<<<<<<<<<<< @@ -4434,7 +4456,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_32agent_auth(struct __pyx_obj_ */ } - /* "ssh2/session.pyx":297 + /* "ssh2/session.pyx":298 * raise AgentListIdentitiesError( * "Failure requesting identities from agent") * while 1: # <<<<<<<<<<<<<< @@ -4443,16 +4465,16 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_32agent_auth(struct __pyx_obj_ */ while (1) { - /* "ssh2/session.pyx":298 + /* "ssh2/session.pyx":299 * "Failure requesting identities from agent") * while 1: * auth_identity(_username, agent, &identity, prev) # <<<<<<<<<<<<<< * if c_ssh2.libssh2_agent_userauth( * agent, _username, identity) == 0: */ - __pyx_t_4 = __pyx_f_4ssh2_5agent_auth_identity(__pyx_v__username, __pyx_v_agent, (&__pyx_v_identity), __pyx_v_prev); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 298, __pyx_L4_error) + __pyx_t_4 = __pyx_f_4ssh2_5agent_auth_identity(__pyx_v__username, __pyx_v_agent, (&__pyx_v_identity), __pyx_v_prev); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 299, __pyx_L4_error) - /* "ssh2/session.pyx":300 + /* "ssh2/session.pyx":301 * auth_identity(_username, agent, &identity, prev) * if c_ssh2.libssh2_agent_userauth( * agent, _username, identity) == 0: # <<<<<<<<<<<<<< @@ -4461,7 +4483,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_32agent_auth(struct __pyx_obj_ */ __pyx_t_2 = ((libssh2_agent_userauth(__pyx_v_agent, __pyx_v__username, __pyx_v_identity) == 0) != 0); - /* "ssh2/session.pyx":299 + /* "ssh2/session.pyx":300 * while 1: * auth_identity(_username, agent, &identity, prev) * if c_ssh2.libssh2_agent_userauth( # <<<<<<<<<<<<<< @@ -4470,7 +4492,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_32agent_auth(struct __pyx_obj_ */ if (__pyx_t_2) { - /* "ssh2/session.pyx":301 + /* "ssh2/session.pyx":302 * if c_ssh2.libssh2_agent_userauth( * agent, _username, identity) == 0: * break # <<<<<<<<<<<<<< @@ -4479,7 +4501,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_32agent_auth(struct __pyx_obj_ */ goto __pyx_L11_break; - /* "ssh2/session.pyx":299 + /* "ssh2/session.pyx":300 * while 1: * auth_identity(_username, agent, &identity, prev) * if c_ssh2.libssh2_agent_userauth( # <<<<<<<<<<<<<< @@ -4488,7 +4510,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_32agent_auth(struct __pyx_obj_ */ } - /* "ssh2/session.pyx":302 + /* "ssh2/session.pyx":303 * agent, _username, identity) == 0: * break * prev = identity # <<<<<<<<<<<<<< @@ -4499,7 +4521,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_32agent_auth(struct __pyx_obj_ } __pyx_L11_break:; - /* "ssh2/session.pyx":303 + /* "ssh2/session.pyx":304 * break * prev = identity * clear_agent(agent) # <<<<<<<<<<<<<< @@ -4509,7 +4531,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_32agent_auth(struct __pyx_obj_ __pyx_f_4ssh2_5agent_clear_agent(__pyx_v_agent); } - /* "ssh2/session.pyx":290 + /* "ssh2/session.pyx":291 * cdef c_ssh2.libssh2_agent_publickey *identity = NULL * cdef c_ssh2.libssh2_agent_publickey *prev = NULL * with nogil: # <<<<<<<<<<<<<< @@ -4535,7 +4557,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_32agent_auth(struct __pyx_obj_ } } - /* "ssh2/session.pyx":258 + /* "ssh2/session.pyx":259 * return agent * * def agent_auth(self, username not None): # <<<<<<<<<<<<<< @@ -4556,7 +4578,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_32agent_auth(struct __pyx_obj_ return __pyx_r; } -/* "ssh2/session.pyx":305 +/* "ssh2/session.pyx":306 * clear_agent(agent) * * def open_session(self): # <<<<<<<<<<<<<< @@ -4586,7 +4608,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_34open_session(struct __pyx_ob PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("open_session", 0); - /* "ssh2/session.pyx":311 + /* "ssh2/session.pyx":312 * """ * cdef c_ssh2.LIBSSH2_CHANNEL *channel * with nogil: # <<<<<<<<<<<<<< @@ -4601,7 +4623,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_34open_session(struct __pyx_ob #endif /*try:*/ { - /* "ssh2/session.pyx":312 + /* "ssh2/session.pyx":313 * cdef c_ssh2.LIBSSH2_CHANNEL *channel * with nogil: * channel = c_ssh2.libssh2_channel_open_session( # <<<<<<<<<<<<<< @@ -4610,7 +4632,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_34open_session(struct __pyx_ob */ __pyx_v_channel = libssh2_channel_open_session(__pyx_v_self->_session); - /* "ssh2/session.pyx":314 + /* "ssh2/session.pyx":315 * channel = c_ssh2.libssh2_channel_open_session( * self._session) * if channel is NULL: # <<<<<<<<<<<<<< @@ -4620,7 +4642,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_34open_session(struct __pyx_ob __pyx_t_1 = ((__pyx_v_channel == NULL) != 0); if (__pyx_t_1) { - /* "ssh2/session.pyx":315 + /* "ssh2/session.pyx":316 * self._session) * if channel is NULL: * with gil: # <<<<<<<<<<<<<< @@ -4633,7 +4655,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_34open_session(struct __pyx_ob #endif /*try:*/ { - /* "ssh2/session.pyx":316 + /* "ssh2/session.pyx":317 * if channel is NULL: * with gil: * return None # <<<<<<<<<<<<<< @@ -4646,7 +4668,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_34open_session(struct __pyx_ob goto __pyx_L7_return; } - /* "ssh2/session.pyx":315 + /* "ssh2/session.pyx":316 * self._session) * if channel is NULL: * with gil: # <<<<<<<<<<<<<< @@ -4663,7 +4685,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_34open_session(struct __pyx_ob } } - /* "ssh2/session.pyx":314 + /* "ssh2/session.pyx":315 * channel = c_ssh2.libssh2_channel_open_session( * self._session) * if channel is NULL: # <<<<<<<<<<<<<< @@ -4673,7 +4695,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_34open_session(struct __pyx_ob } } - /* "ssh2/session.pyx":311 + /* "ssh2/session.pyx":312 * """ * cdef c_ssh2.LIBSSH2_CHANNEL *channel * with nogil: # <<<<<<<<<<<<<< @@ -4699,7 +4721,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_34open_session(struct __pyx_ob } } - /* "ssh2/session.pyx":317 + /* "ssh2/session.pyx":318 * with gil: * return None * return PyChannel(channel, self) # <<<<<<<<<<<<<< @@ -4707,13 +4729,13 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_34open_session(struct __pyx_ob * def direct_tcpip_ex(self, host not None, int port, */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __pyx_f_4ssh2_7channel_PyChannel(__pyx_v_channel, __pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 317, __pyx_L1_error) + __pyx_t_2 = __pyx_f_4ssh2_7channel_PyChannel(__pyx_v_channel, __pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":305 + /* "ssh2/session.pyx":306 * clear_agent(agent) * * def open_session(self): # <<<<<<<<<<<<<< @@ -4732,7 +4754,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_34open_session(struct __pyx_ob return __pyx_r; } -/* "ssh2/session.pyx":319 +/* "ssh2/session.pyx":320 * return PyChannel(channel, self) * * def direct_tcpip_ex(self, host not None, int port, # <<<<<<<<<<<<<< @@ -4778,23 +4800,23 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_37direct_tcpip_ex(PyObject *__ case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_port)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("direct_tcpip_ex", 1, 4, 4, 1); __PYX_ERR(0, 319, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("direct_tcpip_ex", 1, 4, 4, 1); __PYX_ERR(0, 320, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_shost)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("direct_tcpip_ex", 1, 4, 4, 2); __PYX_ERR(0, 319, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("direct_tcpip_ex", 1, 4, 4, 2); __PYX_ERR(0, 320, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_sport)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("direct_tcpip_ex", 1, 4, 4, 3); __PYX_ERR(0, 319, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("direct_tcpip_ex", 1, 4, 4, 3); __PYX_ERR(0, 320, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "direct_tcpip_ex") < 0)) __PYX_ERR(0, 319, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "direct_tcpip_ex") < 0)) __PYX_ERR(0, 320, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; @@ -4805,23 +4827,23 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_37direct_tcpip_ex(PyObject *__ values[3] = PyTuple_GET_ITEM(__pyx_args, 3); } __pyx_v_host = values[0]; - __pyx_v_port = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_port == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 319, __pyx_L3_error) + __pyx_v_port = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_port == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 320, __pyx_L3_error) __pyx_v_shost = values[2]; - __pyx_v_sport = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_sport == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 320, __pyx_L3_error) + __pyx_v_sport = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_sport == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 321, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("direct_tcpip_ex", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 319, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("direct_tcpip_ex", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 320, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.session.Session.direct_tcpip_ex", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(((PyObject *)__pyx_v_host) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "host"); __PYX_ERR(0, 319, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "host"); __PYX_ERR(0, 320, __pyx_L1_error) } if (unlikely(((PyObject *)__pyx_v_shost) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "shost"); __PYX_ERR(0, 320, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "shost"); __PYX_ERR(0, 321, __pyx_L1_error) } __pyx_r = __pyx_pf_4ssh2_7session_7Session_36direct_tcpip_ex(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), __pyx_v_host, __pyx_v_port, __pyx_v_shost, __pyx_v_sport); @@ -4844,7 +4866,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_36direct_tcpip_ex(struct __pyx PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("direct_tcpip_ex", 0); - /* "ssh2/session.pyx":322 + /* "ssh2/session.pyx":323 * shost not None, int sport): * cdef c_ssh2.LIBSSH2_CHANNEL *channel * cdef char *_host = to_bytes(host) # <<<<<<<<<<<<<< @@ -4853,7 +4875,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_36direct_tcpip_ex(struct __pyx */ __pyx_v__host = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_host); - /* "ssh2/session.pyx":323 + /* "ssh2/session.pyx":324 * cdef c_ssh2.LIBSSH2_CHANNEL *channel * cdef char *_host = to_bytes(host) * cdef char *_shost = to_bytes(shost) # <<<<<<<<<<<<<< @@ -4862,7 +4884,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_36direct_tcpip_ex(struct __pyx */ __pyx_v__shost = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_shost); - /* "ssh2/session.pyx":324 + /* "ssh2/session.pyx":325 * cdef char *_host = to_bytes(host) * cdef char *_shost = to_bytes(shost) * with nogil: # <<<<<<<<<<<<<< @@ -4877,7 +4899,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_36direct_tcpip_ex(struct __pyx #endif /*try:*/ { - /* "ssh2/session.pyx":325 + /* "ssh2/session.pyx":326 * cdef char *_shost = to_bytes(shost) * with nogil: * channel = c_ssh2.libssh2_channel_direct_tcpip_ex( # <<<<<<<<<<<<<< @@ -4886,7 +4908,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_36direct_tcpip_ex(struct __pyx */ __pyx_v_channel = libssh2_channel_direct_tcpip_ex(__pyx_v_self->_session, __pyx_v__host, __pyx_v_port, __pyx_v__shost, __pyx_v_sport); - /* "ssh2/session.pyx":327 + /* "ssh2/session.pyx":328 * channel = c_ssh2.libssh2_channel_direct_tcpip_ex( * self._session, _host, port, _shost, sport) * if channel is NULL: # <<<<<<<<<<<<<< @@ -4896,7 +4918,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_36direct_tcpip_ex(struct __pyx __pyx_t_1 = ((__pyx_v_channel == NULL) != 0); if (__pyx_t_1) { - /* "ssh2/session.pyx":328 + /* "ssh2/session.pyx":329 * self._session, _host, port, _shost, sport) * if channel is NULL: * with gil: # <<<<<<<<<<<<<< @@ -4909,7 +4931,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_36direct_tcpip_ex(struct __pyx #endif /*try:*/ { - /* "ssh2/session.pyx":329 + /* "ssh2/session.pyx":330 * if channel is NULL: * with gil: * return # <<<<<<<<<<<<<< @@ -4921,7 +4943,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_36direct_tcpip_ex(struct __pyx goto __pyx_L7_return; } - /* "ssh2/session.pyx":328 + /* "ssh2/session.pyx":329 * self._session, _host, port, _shost, sport) * if channel is NULL: * with gil: # <<<<<<<<<<<<<< @@ -4938,7 +4960,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_36direct_tcpip_ex(struct __pyx } } - /* "ssh2/session.pyx":327 + /* "ssh2/session.pyx":328 * channel = c_ssh2.libssh2_channel_direct_tcpip_ex( * self._session, _host, port, _shost, sport) * if channel is NULL: # <<<<<<<<<<<<<< @@ -4948,7 +4970,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_36direct_tcpip_ex(struct __pyx } } - /* "ssh2/session.pyx":324 + /* "ssh2/session.pyx":325 * cdef char *_host = to_bytes(host) * cdef char *_shost = to_bytes(shost) * with nogil: # <<<<<<<<<<<<<< @@ -4974,7 +4996,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_36direct_tcpip_ex(struct __pyx } } - /* "ssh2/session.pyx":330 + /* "ssh2/session.pyx":331 * with gil: * return * return PyChannel(channel, self) # <<<<<<<<<<<<<< @@ -4982,13 +5004,13 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_36direct_tcpip_ex(struct __pyx * def direct_tcpip(self, host not None, int port): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __pyx_f_4ssh2_7channel_PyChannel(__pyx_v_channel, __pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 330, __pyx_L1_error) + __pyx_t_2 = __pyx_f_4ssh2_7channel_PyChannel(__pyx_v_channel, __pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":319 + /* "ssh2/session.pyx":320 * return PyChannel(channel, self) * * def direct_tcpip_ex(self, host not None, int port, # <<<<<<<<<<<<<< @@ -5007,7 +5029,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_36direct_tcpip_ex(struct __pyx return __pyx_r; } -/* "ssh2/session.pyx":332 +/* "ssh2/session.pyx":333 * return PyChannel(channel, self) * * def direct_tcpip(self, host not None, int port): # <<<<<<<<<<<<<< @@ -5047,11 +5069,11 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_39direct_tcpip(PyObject *__pyx case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_port)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("direct_tcpip", 1, 2, 2, 1); __PYX_ERR(0, 332, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("direct_tcpip", 1, 2, 2, 1); __PYX_ERR(0, 333, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "direct_tcpip") < 0)) __PYX_ERR(0, 332, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "direct_tcpip") < 0)) __PYX_ERR(0, 333, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -5060,18 +5082,18 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_39direct_tcpip(PyObject *__pyx values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_host = values[0]; - __pyx_v_port = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_port == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 332, __pyx_L3_error) + __pyx_v_port = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_port == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 333, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("direct_tcpip", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 332, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("direct_tcpip", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 333, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.session.Session.direct_tcpip", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(((PyObject *)__pyx_v_host) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "host"); __PYX_ERR(0, 332, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "host"); __PYX_ERR(0, 333, __pyx_L1_error) } __pyx_r = __pyx_pf_4ssh2_7session_7Session_38direct_tcpip(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), __pyx_v_host, __pyx_v_port); @@ -5093,7 +5115,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_38direct_tcpip(struct __pyx_ob PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("direct_tcpip", 0); - /* "ssh2/session.pyx":334 + /* "ssh2/session.pyx":335 * def direct_tcpip(self, host not None, int port): * cdef c_ssh2.LIBSSH2_CHANNEL *channel * cdef char *_host = to_bytes(host) # <<<<<<<<<<<<<< @@ -5102,7 +5124,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_38direct_tcpip(struct __pyx_ob */ __pyx_v__host = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_host); - /* "ssh2/session.pyx":335 + /* "ssh2/session.pyx":336 * cdef c_ssh2.LIBSSH2_CHANNEL *channel * cdef char *_host = to_bytes(host) * with nogil: # <<<<<<<<<<<<<< @@ -5117,7 +5139,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_38direct_tcpip(struct __pyx_ob #endif /*try:*/ { - /* "ssh2/session.pyx":336 + /* "ssh2/session.pyx":337 * cdef char *_host = to_bytes(host) * with nogil: * channel = c_ssh2.libssh2_channel_direct_tcpip( # <<<<<<<<<<<<<< @@ -5126,7 +5148,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_38direct_tcpip(struct __pyx_ob */ __pyx_v_channel = libssh2_channel_direct_tcpip(__pyx_v_self->_session, __pyx_v__host, __pyx_v_port); - /* "ssh2/session.pyx":338 + /* "ssh2/session.pyx":339 * channel = c_ssh2.libssh2_channel_direct_tcpip( * self._session, _host, port) * if channel is NULL: # <<<<<<<<<<<<<< @@ -5136,7 +5158,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_38direct_tcpip(struct __pyx_ob __pyx_t_1 = ((__pyx_v_channel == NULL) != 0); if (__pyx_t_1) { - /* "ssh2/session.pyx":339 + /* "ssh2/session.pyx":340 * self._session, _host, port) * if channel is NULL: * with gil: # <<<<<<<<<<<<<< @@ -5149,7 +5171,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_38direct_tcpip(struct __pyx_ob #endif /*try:*/ { - /* "ssh2/session.pyx":340 + /* "ssh2/session.pyx":341 * if channel is NULL: * with gil: * return # <<<<<<<<<<<<<< @@ -5161,7 +5183,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_38direct_tcpip(struct __pyx_ob goto __pyx_L7_return; } - /* "ssh2/session.pyx":339 + /* "ssh2/session.pyx":340 * self._session, _host, port) * if channel is NULL: * with gil: # <<<<<<<<<<<<<< @@ -5178,7 +5200,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_38direct_tcpip(struct __pyx_ob } } - /* "ssh2/session.pyx":338 + /* "ssh2/session.pyx":339 * channel = c_ssh2.libssh2_channel_direct_tcpip( * self._session, _host, port) * if channel is NULL: # <<<<<<<<<<<<<< @@ -5188,7 +5210,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_38direct_tcpip(struct __pyx_ob } } - /* "ssh2/session.pyx":335 + /* "ssh2/session.pyx":336 * cdef c_ssh2.LIBSSH2_CHANNEL *channel * cdef char *_host = to_bytes(host) * with nogil: # <<<<<<<<<<<<<< @@ -5214,7 +5236,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_38direct_tcpip(struct __pyx_ob } } - /* "ssh2/session.pyx":341 + /* "ssh2/session.pyx":342 * with gil: * return * return PyChannel(channel, self) # <<<<<<<<<<<<<< @@ -5222,13 +5244,13 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_38direct_tcpip(struct __pyx_ob * def blockdirections(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __pyx_f_4ssh2_7channel_PyChannel(__pyx_v_channel, __pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 341, __pyx_L1_error) + __pyx_t_2 = __pyx_f_4ssh2_7channel_PyChannel(__pyx_v_channel, __pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 342, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":332 + /* "ssh2/session.pyx":333 * return PyChannel(channel, self) * * def direct_tcpip(self, host not None, int port): # <<<<<<<<<<<<<< @@ -5247,7 +5269,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_38direct_tcpip(struct __pyx_ob return __pyx_r; } -/* "ssh2/session.pyx":343 +/* "ssh2/session.pyx":344 * return PyChannel(channel, self) * * def blockdirections(self): # <<<<<<<<<<<<<< @@ -5276,7 +5298,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_40blockdirections(struct __pyx PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("blockdirections", 0); - /* "ssh2/session.pyx":345 + /* "ssh2/session.pyx":346 * def blockdirections(self): * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -5291,7 +5313,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_40blockdirections(struct __pyx #endif /*try:*/ { - /* "ssh2/session.pyx":346 + /* "ssh2/session.pyx":347 * cdef int rc * with nogil: * rc = c_ssh2.libssh2_session_block_directions( # <<<<<<<<<<<<<< @@ -5301,7 +5323,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_40blockdirections(struct __pyx __pyx_v_rc = libssh2_session_block_directions(__pyx_v_self->_session); } - /* "ssh2/session.pyx":345 + /* "ssh2/session.pyx":346 * def blockdirections(self): * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -5320,7 +5342,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_40blockdirections(struct __pyx } } - /* "ssh2/session.pyx":348 + /* "ssh2/session.pyx":349 * rc = c_ssh2.libssh2_session_block_directions( * self._session) * return rc # <<<<<<<<<<<<<< @@ -5328,13 +5350,13 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_40blockdirections(struct __pyx * def forward_listen(self, int port): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 348, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 349, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":343 + /* "ssh2/session.pyx":344 * return PyChannel(channel, self) * * def blockdirections(self): # <<<<<<<<<<<<<< @@ -5353,7 +5375,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_40blockdirections(struct __pyx return __pyx_r; } -/* "ssh2/session.pyx":350 +/* "ssh2/session.pyx":351 * return rc * * def forward_listen(self, int port): # <<<<<<<<<<<<<< @@ -5370,7 +5392,7 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_43forward_listen(PyObject *__p __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("forward_listen (wrapper)", 0); assert(__pyx_arg_port); { - __pyx_v_port = __Pyx_PyInt_As_int(__pyx_arg_port); if (unlikely((__pyx_v_port == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 350, __pyx_L3_error) + __pyx_v_port = __Pyx_PyInt_As_int(__pyx_arg_port); if (unlikely((__pyx_v_port == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 351, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -5393,7 +5415,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_42forward_listen(struct __pyx_ PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("forward_listen", 0); - /* "ssh2/session.pyx":352 + /* "ssh2/session.pyx":353 * def forward_listen(self, int port): * cdef c_ssh2.LIBSSH2_LISTENER *listener * with nogil: # <<<<<<<<<<<<<< @@ -5408,7 +5430,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_42forward_listen(struct __pyx_ #endif /*try:*/ { - /* "ssh2/session.pyx":353 + /* "ssh2/session.pyx":354 * cdef c_ssh2.LIBSSH2_LISTENER *listener * with nogil: * listener = c_ssh2.libssh2_channel_forward_listen( # <<<<<<<<<<<<<< @@ -5418,7 +5440,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_42forward_listen(struct __pyx_ __pyx_v_listener = libssh2_channel_forward_listen(__pyx_v_self->_session, __pyx_v_port); } - /* "ssh2/session.pyx":352 + /* "ssh2/session.pyx":353 * def forward_listen(self, int port): * cdef c_ssh2.LIBSSH2_LISTENER *listener * with nogil: # <<<<<<<<<<<<<< @@ -5437,7 +5459,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_42forward_listen(struct __pyx_ } } - /* "ssh2/session.pyx":355 + /* "ssh2/session.pyx":356 * listener = c_ssh2.libssh2_channel_forward_listen( * self._session, port) * if listener is NULL: # <<<<<<<<<<<<<< @@ -5447,7 +5469,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_42forward_listen(struct __pyx_ __pyx_t_1 = ((__pyx_v_listener == NULL) != 0); if (__pyx_t_1) { - /* "ssh2/session.pyx":356 + /* "ssh2/session.pyx":357 * self._session, port) * if listener is NULL: * return # <<<<<<<<<<<<<< @@ -5458,7 +5480,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_42forward_listen(struct __pyx_ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "ssh2/session.pyx":355 + /* "ssh2/session.pyx":356 * listener = c_ssh2.libssh2_channel_forward_listen( * self._session, port) * if listener is NULL: # <<<<<<<<<<<<<< @@ -5467,7 +5489,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_42forward_listen(struct __pyx_ */ } - /* "ssh2/session.pyx":357 + /* "ssh2/session.pyx":358 * if listener is NULL: * return * return PyListener(listener, self) # <<<<<<<<<<<<<< @@ -5475,13 +5497,13 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_42forward_listen(struct __pyx_ * def forward_listen_ex(self, host not None, int port, */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __pyx_f_4ssh2_8listener_PyListener(__pyx_v_listener, __pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 357, __pyx_L1_error) + __pyx_t_2 = __pyx_f_4ssh2_8listener_PyListener(__pyx_v_listener, __pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 358, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":350 + /* "ssh2/session.pyx":351 * return rc * * def forward_listen(self, int port): # <<<<<<<<<<<<<< @@ -5500,7 +5522,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_42forward_listen(struct __pyx_ return __pyx_r; } -/* "ssh2/session.pyx":359 +/* "ssh2/session.pyx":360 * return PyListener(listener, self) * * def forward_listen_ex(self, host not None, int port, # <<<<<<<<<<<<<< @@ -5546,23 +5568,23 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_45forward_listen_ex(PyObject * case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_port)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("forward_listen_ex", 1, 4, 4, 1); __PYX_ERR(0, 359, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("forward_listen_ex", 1, 4, 4, 1); __PYX_ERR(0, 360, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bound_port)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("forward_listen_ex", 1, 4, 4, 2); __PYX_ERR(0, 359, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("forward_listen_ex", 1, 4, 4, 2); __PYX_ERR(0, 360, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_queue_maxsize)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("forward_listen_ex", 1, 4, 4, 3); __PYX_ERR(0, 359, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("forward_listen_ex", 1, 4, 4, 3); __PYX_ERR(0, 360, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "forward_listen_ex") < 0)) __PYX_ERR(0, 359, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "forward_listen_ex") < 0)) __PYX_ERR(0, 360, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; @@ -5573,20 +5595,20 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_45forward_listen_ex(PyObject * values[3] = PyTuple_GET_ITEM(__pyx_args, 3); } __pyx_v_host = values[0]; - __pyx_v_port = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_port == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 359, __pyx_L3_error) - __pyx_v_bound_port = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_bound_port == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 360, __pyx_L3_error) - __pyx_v_queue_maxsize = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_queue_maxsize == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 360, __pyx_L3_error) + __pyx_v_port = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_port == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 360, __pyx_L3_error) + __pyx_v_bound_port = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_bound_port == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 361, __pyx_L3_error) + __pyx_v_queue_maxsize = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_queue_maxsize == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 361, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("forward_listen_ex", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 359, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("forward_listen_ex", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 360, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.session.Session.forward_listen_ex", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(((PyObject *)__pyx_v_host) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "host"); __PYX_ERR(0, 359, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "host"); __PYX_ERR(0, 360, __pyx_L1_error) } __pyx_r = __pyx_pf_4ssh2_7session_7Session_44forward_listen_ex(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), __pyx_v_host, __pyx_v_port, __pyx_v_bound_port, __pyx_v_queue_maxsize); @@ -5608,7 +5630,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_44forward_listen_ex(struct __p PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("forward_listen_ex", 0); - /* "ssh2/session.pyx":362 + /* "ssh2/session.pyx":363 * int bound_port, int queue_maxsize): * cdef c_ssh2.LIBSSH2_LISTENER *listener * cdef char *_host = to_bytes(host) # <<<<<<<<<<<<<< @@ -5617,7 +5639,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_44forward_listen_ex(struct __p */ __pyx_v__host = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_host); - /* "ssh2/session.pyx":363 + /* "ssh2/session.pyx":364 * cdef c_ssh2.LIBSSH2_LISTENER *listener * cdef char *_host = to_bytes(host) * with nogil: # <<<<<<<<<<<<<< @@ -5632,7 +5654,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_44forward_listen_ex(struct __p #endif /*try:*/ { - /* "ssh2/session.pyx":364 + /* "ssh2/session.pyx":365 * cdef char *_host = to_bytes(host) * with nogil: * listener = c_ssh2.libssh2_channel_forward_listen_ex( # <<<<<<<<<<<<<< @@ -5642,7 +5664,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_44forward_listen_ex(struct __p __pyx_v_listener = libssh2_channel_forward_listen_ex(__pyx_v_self->_session, __pyx_v__host, __pyx_v_port, (&__pyx_v_bound_port), __pyx_v_queue_maxsize); } - /* "ssh2/session.pyx":363 + /* "ssh2/session.pyx":364 * cdef c_ssh2.LIBSSH2_LISTENER *listener * cdef char *_host = to_bytes(host) * with nogil: # <<<<<<<<<<<<<< @@ -5661,7 +5683,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_44forward_listen_ex(struct __p } } - /* "ssh2/session.pyx":366 + /* "ssh2/session.pyx":367 * listener = c_ssh2.libssh2_channel_forward_listen_ex( * self._session, _host, port, &bound_port, queue_maxsize) * if listener is NULL: # <<<<<<<<<<<<<< @@ -5671,7 +5693,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_44forward_listen_ex(struct __p __pyx_t_1 = ((__pyx_v_listener == NULL) != 0); if (__pyx_t_1) { - /* "ssh2/session.pyx":367 + /* "ssh2/session.pyx":368 * self._session, _host, port, &bound_port, queue_maxsize) * if listener is NULL: * return # <<<<<<<<<<<<<< @@ -5682,7 +5704,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_44forward_listen_ex(struct __p __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "ssh2/session.pyx":366 + /* "ssh2/session.pyx":367 * listener = c_ssh2.libssh2_channel_forward_listen_ex( * self._session, _host, port, &bound_port, queue_maxsize) * if listener is NULL: # <<<<<<<<<<<<<< @@ -5691,7 +5713,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_44forward_listen_ex(struct __p */ } - /* "ssh2/session.pyx":368 + /* "ssh2/session.pyx":369 * if listener is NULL: * return * return PyListener(listener, self) # <<<<<<<<<<<<<< @@ -5699,13 +5721,13 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_44forward_listen_ex(struct __p * def sftp_init(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __pyx_f_4ssh2_8listener_PyListener(__pyx_v_listener, __pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 368, __pyx_L1_error) + __pyx_t_2 = __pyx_f_4ssh2_8listener_PyListener(__pyx_v_listener, __pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 369, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":359 + /* "ssh2/session.pyx":360 * return PyListener(listener, self) * * def forward_listen_ex(self, host not None, int port, # <<<<<<<<<<<<<< @@ -5724,7 +5746,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_44forward_listen_ex(struct __p return __pyx_r; } -/* "ssh2/session.pyx":370 +/* "ssh2/session.pyx":371 * return PyListener(listener, self) * * def sftp_init(self): # <<<<<<<<<<<<<< @@ -5754,7 +5776,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_46sftp_init(struct __pyx_obj_4 PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("sftp_init", 0); - /* "ssh2/session.pyx":376 + /* "ssh2/session.pyx":377 * """ * cdef c_sftp.LIBSSH2_SFTP *_sftp * with nogil: # <<<<<<<<<<<<<< @@ -5769,7 +5791,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_46sftp_init(struct __pyx_obj_4 #endif /*try:*/ { - /* "ssh2/session.pyx":377 + /* "ssh2/session.pyx":378 * cdef c_sftp.LIBSSH2_SFTP *_sftp * with nogil: * _sftp = c_sftp.libssh2_sftp_init(self._session) # <<<<<<<<<<<<<< @@ -5779,7 +5801,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_46sftp_init(struct __pyx_obj_4 __pyx_v__sftp = libssh2_sftp_init(__pyx_v_self->_session); } - /* "ssh2/session.pyx":376 + /* "ssh2/session.pyx":377 * """ * cdef c_sftp.LIBSSH2_SFTP *_sftp * with nogil: # <<<<<<<<<<<<<< @@ -5798,7 +5820,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_46sftp_init(struct __pyx_obj_4 } } - /* "ssh2/session.pyx":378 + /* "ssh2/session.pyx":379 * with nogil: * _sftp = c_sftp.libssh2_sftp_init(self._session) * if _sftp is NULL: # <<<<<<<<<<<<<< @@ -5808,7 +5830,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_46sftp_init(struct __pyx_obj_4 __pyx_t_1 = ((__pyx_v__sftp == NULL) != 0); if (__pyx_t_1) { - /* "ssh2/session.pyx":379 + /* "ssh2/session.pyx":380 * _sftp = c_sftp.libssh2_sftp_init(self._session) * if _sftp is NULL: * return # <<<<<<<<<<<<<< @@ -5819,7 +5841,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_46sftp_init(struct __pyx_obj_4 __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "ssh2/session.pyx":378 + /* "ssh2/session.pyx":379 * with nogil: * _sftp = c_sftp.libssh2_sftp_init(self._session) * if _sftp is NULL: # <<<<<<<<<<<<<< @@ -5828,7 +5850,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_46sftp_init(struct __pyx_obj_4 */ } - /* "ssh2/session.pyx":380 + /* "ssh2/session.pyx":381 * if _sftp is NULL: * return * return PySFTP(_sftp, self) # <<<<<<<<<<<<<< @@ -5836,13 +5858,13 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_46sftp_init(struct __pyx_obj_4 * def last_error(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __pyx_f_4ssh2_4sftp_PySFTP(__pyx_v__sftp, __pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 380, __pyx_L1_error) + __pyx_t_2 = __pyx_f_4ssh2_4sftp_PySFTP(__pyx_v__sftp, __pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":370 + /* "ssh2/session.pyx":371 * return PyListener(listener, self) * * def sftp_init(self): # <<<<<<<<<<<<<< @@ -5861,7 +5883,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_46sftp_init(struct __pyx_obj_4 return __pyx_r; } -/* "ssh2/session.pyx":382 +/* "ssh2/session.pyx":383 * return PySFTP(_sftp, self) * * def last_error(self): # <<<<<<<<<<<<<< @@ -5900,7 +5922,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_48last_error(struct __pyx_obj_ PyObject *__pyx_t_7 = NULL; __Pyx_RefNannySetupContext("last_error", 0); - /* "ssh2/session.pyx":388 + /* "ssh2/session.pyx":389 * :rtype: str * """ * cdef char **_error_msg = NULL # <<<<<<<<<<<<<< @@ -5909,7 +5931,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_48last_error(struct __pyx_obj_ */ __pyx_v__error_msg = NULL; - /* "ssh2/session.pyx":390 + /* "ssh2/session.pyx":391 * cdef char **_error_msg = NULL * cdef bytes msg * cdef int errmsg_len = 0 # <<<<<<<<<<<<<< @@ -5918,7 +5940,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_48last_error(struct __pyx_obj_ */ __pyx_v_errmsg_len = 0; - /* "ssh2/session.pyx":392 + /* "ssh2/session.pyx":393 * cdef int errmsg_len = 0 * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -5933,7 +5955,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_48last_error(struct __pyx_obj_ #endif /*try:*/ { - /* "ssh2/session.pyx":393 + /* "ssh2/session.pyx":394 * cdef int rc * with nogil: * rc = c_ssh2.libssh2_session_last_error( # <<<<<<<<<<<<<< @@ -5943,7 +5965,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_48last_error(struct __pyx_obj_ __pyx_v_rc = libssh2_session_last_error(__pyx_v_self->_session, __pyx_v__error_msg, (&__pyx_v_errmsg_len), 0); } - /* "ssh2/session.pyx":392 + /* "ssh2/session.pyx":393 * cdef int errmsg_len = 0 * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -5962,7 +5984,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_48last_error(struct __pyx_obj_ } } - /* "ssh2/session.pyx":395 + /* "ssh2/session.pyx":396 * rc = c_ssh2.libssh2_session_last_error( * self._session, _error_msg, &errmsg_len, 0) * if errmsg_len > 0 and _error_msg is not NULL: # <<<<<<<<<<<<<< @@ -5980,7 +6002,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_48last_error(struct __pyx_obj_ __pyx_L7_bool_binop_done:; if (__pyx_t_1) { - /* "ssh2/session.pyx":396 + /* "ssh2/session.pyx":397 * self._session, _error_msg, &errmsg_len, 0) * if errmsg_len > 0 and _error_msg is not NULL: * for line in _error_msg[:errmsg_len]: # <<<<<<<<<<<<<< @@ -5992,24 +6014,24 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_48last_error(struct __pyx_obj_ __pyx_t_3 = __pyx_t_5; __pyx_v_line = (__pyx_t_3[0]); - /* "ssh2/session.pyx":397 + /* "ssh2/session.pyx":398 * if errmsg_len > 0 and _error_msg is not NULL: * for line in _error_msg[:errmsg_len]: * msg += line # <<<<<<<<<<<<<< * else: * msg = b'' */ - if (unlikely(!__pyx_v_msg)) { __Pyx_RaiseUnboundLocalError("msg"); __PYX_ERR(0, 397, __pyx_L1_error) } - __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_line); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 397, __pyx_L1_error) + if (unlikely(!__pyx_v_msg)) { __Pyx_RaiseUnboundLocalError("msg"); __PYX_ERR(0, 398, __pyx_L1_error) } + __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_line); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 398, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PyNumber_InPlaceAdd(__pyx_v_msg, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 397, __pyx_L1_error) + __pyx_t_7 = PyNumber_InPlaceAdd(__pyx_v_msg, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 398, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF_SET(__pyx_v_msg, ((PyObject*)__pyx_t_7)); __pyx_t_7 = 0; } - /* "ssh2/session.pyx":395 + /* "ssh2/session.pyx":396 * rc = c_ssh2.libssh2_session_last_error( * self._session, _error_msg, &errmsg_len, 0) * if errmsg_len > 0 and _error_msg is not NULL: # <<<<<<<<<<<<<< @@ -6019,7 +6041,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_48last_error(struct __pyx_obj_ goto __pyx_L6; } - /* "ssh2/session.pyx":399 + /* "ssh2/session.pyx":400 * msg += line * else: * msg = b'' # <<<<<<<<<<<<<< @@ -6032,7 +6054,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_48last_error(struct __pyx_obj_ } __pyx_L6:; - /* "ssh2/session.pyx":400 + /* "ssh2/session.pyx":401 * else: * msg = b'' * return msg # <<<<<<<<<<<<<< @@ -6040,12 +6062,12 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_48last_error(struct __pyx_obj_ * def scp_recv(self, path not None): */ __Pyx_XDECREF(__pyx_r); - if (unlikely(!__pyx_v_msg)) { __Pyx_RaiseUnboundLocalError("msg"); __PYX_ERR(0, 400, __pyx_L1_error) } + if (unlikely(!__pyx_v_msg)) { __Pyx_RaiseUnboundLocalError("msg"); __PYX_ERR(0, 401, __pyx_L1_error) } __Pyx_INCREF(__pyx_v_msg); __pyx_r = __pyx_v_msg; goto __pyx_L0; - /* "ssh2/session.pyx":382 + /* "ssh2/session.pyx":383 * return PySFTP(_sftp, self) * * def last_error(self): # <<<<<<<<<<<<<< @@ -6066,12 +6088,12 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_48last_error(struct __pyx_obj_ return __pyx_r; } -/* "ssh2/session.pyx":402 +/* "ssh2/session.pyx":403 * return msg * * def scp_recv(self, path not None): # <<<<<<<<<<<<<< * cdef char *_path = to_bytes(path) - * cdef FileInfo fileinfo = FileInfo() + * cdef StatInfo statinfo = StatInfo() */ /* Python wrapper */ @@ -6082,7 +6104,7 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_51scp_recv(PyObject *__pyx_v_s __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("scp_recv (wrapper)", 0); if (unlikely(((PyObject *)__pyx_v_path) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "path"); __PYX_ERR(0, 402, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "path"); __PYX_ERR(0, 403, __pyx_L1_error) } __pyx_r = __pyx_pf_4ssh2_7session_7Session_50scp_recv(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), ((PyObject *)__pyx_v_path)); @@ -6097,7 +6119,7 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_51scp_recv(PyObject *__pyx_v_s static PyObject *__pyx_pf_4ssh2_7session_7Session_50scp_recv(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, PyObject *__pyx_v_path) { char *__pyx_v__path; - struct __pyx_obj_4ssh2_8fileinfo_FileInfo *__pyx_v_fileinfo = 0; + struct __pyx_obj_4ssh2_8statinfo_StatInfo *__pyx_v_statinfo = 0; LIBSSH2_CHANNEL *__pyx_v_channel; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -6106,33 +6128,33 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_50scp_recv(struct __pyx_obj_4s PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("scp_recv", 0); - /* "ssh2/session.pyx":403 + /* "ssh2/session.pyx":404 * * def scp_recv(self, path not None): * cdef char *_path = to_bytes(path) # <<<<<<<<<<<<<< - * cdef FileInfo fileinfo = FileInfo() + * cdef StatInfo statinfo = StatInfo() * cdef c_ssh2.LIBSSH2_CHANNEL *channel */ __pyx_v__path = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_path); - /* "ssh2/session.pyx":404 + /* "ssh2/session.pyx":405 * def scp_recv(self, path not None): * cdef char *_path = to_bytes(path) - * cdef FileInfo fileinfo = FileInfo() # <<<<<<<<<<<<<< + * cdef StatInfo statinfo = StatInfo() # <<<<<<<<<<<<<< * cdef c_ssh2.LIBSSH2_CHANNEL *channel * with nogil: */ - __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4ssh2_8fileinfo_FileInfo), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 404, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4ssh2_8statinfo_StatInfo), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_v_fileinfo = ((struct __pyx_obj_4ssh2_8fileinfo_FileInfo *)__pyx_t_1); + __pyx_v_statinfo = ((struct __pyx_obj_4ssh2_8statinfo_StatInfo *)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/session.pyx":406 - * cdef FileInfo fileinfo = FileInfo() + /* "ssh2/session.pyx":407 + * cdef StatInfo statinfo = StatInfo() * cdef c_ssh2.LIBSSH2_CHANNEL *channel * with nogil: # <<<<<<<<<<<<<< * channel = c_ssh2.libssh2_scp_recv( - * self._session, _path, fileinfo._stat) + * self._session, _path, statinfo._stat) */ { #ifdef WITH_THREAD @@ -6142,22 +6164,22 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_50scp_recv(struct __pyx_obj_4s #endif /*try:*/ { - /* "ssh2/session.pyx":407 + /* "ssh2/session.pyx":408 * cdef c_ssh2.LIBSSH2_CHANNEL *channel * with nogil: * channel = c_ssh2.libssh2_scp_recv( # <<<<<<<<<<<<<< - * self._session, _path, fileinfo._stat) + * self._session, _path, statinfo._stat) * if channel is not NULL: */ - __pyx_v_channel = libssh2_scp_recv(__pyx_v_self->_session, __pyx_v__path, __pyx_v_fileinfo->_stat); + __pyx_v_channel = libssh2_scp_recv(__pyx_v_self->_session, __pyx_v__path, __pyx_v_statinfo->_stat); } - /* "ssh2/session.pyx":406 - * cdef FileInfo fileinfo = FileInfo() + /* "ssh2/session.pyx":407 + * cdef StatInfo statinfo = StatInfo() * cdef c_ssh2.LIBSSH2_CHANNEL *channel * with nogil: # <<<<<<<<<<<<<< * channel = c_ssh2.libssh2_scp_recv( - * self._session, _path, fileinfo._stat) + * self._session, _path, statinfo._stat) */ /*finally:*/ { /*normal exit:*/{ @@ -6171,53 +6193,53 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_50scp_recv(struct __pyx_obj_4s } } - /* "ssh2/session.pyx":409 + /* "ssh2/session.pyx":410 * channel = c_ssh2.libssh2_scp_recv( - * self._session, _path, fileinfo._stat) + * self._session, _path, statinfo._stat) * if channel is not NULL: # <<<<<<<<<<<<<< - * return PyChannel(channel, self), fileinfo + * return PyChannel(channel, self), statinfo * */ __pyx_t_2 = ((__pyx_v_channel != NULL) != 0); if (__pyx_t_2) { - /* "ssh2/session.pyx":410 - * self._session, _path, fileinfo._stat) + /* "ssh2/session.pyx":411 + * self._session, _path, statinfo._stat) * if channel is not NULL: - * return PyChannel(channel, self), fileinfo # <<<<<<<<<<<<<< + * return PyChannel(channel, self), statinfo # <<<<<<<<<<<<<< * * # def scp_recv2(self, path not None): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_4ssh2_7channel_PyChannel(__pyx_v_channel, __pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 410, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_7channel_PyChannel(__pyx_v_channel, __pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 411, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 410, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 411, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); - __Pyx_INCREF(((PyObject *)__pyx_v_fileinfo)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_fileinfo)); - PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_fileinfo)); + __Pyx_INCREF(((PyObject *)__pyx_v_statinfo)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_statinfo)); + PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_statinfo)); __pyx_t_1 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":409 + /* "ssh2/session.pyx":410 * channel = c_ssh2.libssh2_scp_recv( - * self._session, _path, fileinfo._stat) + * self._session, _path, statinfo._stat) * if channel is not NULL: # <<<<<<<<<<<<<< - * return PyChannel(channel, self), fileinfo + * return PyChannel(channel, self), statinfo * */ } - /* "ssh2/session.pyx":402 + /* "ssh2/session.pyx":403 * return msg * * def scp_recv(self, path not None): # <<<<<<<<<<<<<< * cdef char *_path = to_bytes(path) - * cdef FileInfo fileinfo = FileInfo() + * cdef StatInfo statinfo = StatInfo() */ /* function exit code */ @@ -6229,13 +6251,13 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_50scp_recv(struct __pyx_obj_4s __Pyx_AddTraceback("ssh2.session.Session.scp_recv", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_fileinfo); + __Pyx_XDECREF((PyObject *)__pyx_v_statinfo); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "ssh2/session.pyx":427 +/* "ssh2/session.pyx":428 * # return PyChannel(channel, self), fileinfo * * def scp_send(self, path not None, int mode, size_t size): # <<<<<<<<<<<<<< @@ -6278,17 +6300,17 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_53scp_send(PyObject *__pyx_v_s case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mode)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("scp_send", 1, 3, 3, 1); __PYX_ERR(0, 427, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("scp_send", 1, 3, 3, 1); __PYX_ERR(0, 428, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("scp_send", 1, 3, 3, 2); __PYX_ERR(0, 427, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("scp_send", 1, 3, 3, 2); __PYX_ERR(0, 428, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "scp_send") < 0)) __PYX_ERR(0, 427, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "scp_send") < 0)) __PYX_ERR(0, 428, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -6298,19 +6320,19 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_53scp_send(PyObject *__pyx_v_s values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_path = values[0]; - __pyx_v_mode = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_mode == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 427, __pyx_L3_error) - __pyx_v_size = __Pyx_PyInt_As_size_t(values[2]); if (unlikely((__pyx_v_size == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 427, __pyx_L3_error) + __pyx_v_mode = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_mode == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 428, __pyx_L3_error) + __pyx_v_size = __Pyx_PyInt_As_size_t(values[2]); if (unlikely((__pyx_v_size == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 428, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("scp_send", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 427, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("scp_send", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 428, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.session.Session.scp_send", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(((PyObject *)__pyx_v_path) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "path"); __PYX_ERR(0, 427, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "path"); __PYX_ERR(0, 428, __pyx_L1_error) } __pyx_r = __pyx_pf_4ssh2_7session_7Session_52scp_send(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), __pyx_v_path, __pyx_v_mode, __pyx_v_size); @@ -6332,7 +6354,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_52scp_send(struct __pyx_obj_4s PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("scp_send", 0); - /* "ssh2/session.pyx":438 + /* "ssh2/session.pyx":439 * * :rtype: :py:class:`ssh2.channel.Channel`""" * cdef char *_path = to_bytes(path) # <<<<<<<<<<<<<< @@ -6341,7 +6363,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_52scp_send(struct __pyx_obj_4s */ __pyx_v__path = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_path); - /* "ssh2/session.pyx":440 + /* "ssh2/session.pyx":441 * cdef char *_path = to_bytes(path) * cdef c_ssh2.LIBSSH2_CHANNEL *channel * with nogil: # <<<<<<<<<<<<<< @@ -6356,7 +6378,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_52scp_send(struct __pyx_obj_4s #endif /*try:*/ { - /* "ssh2/session.pyx":441 + /* "ssh2/session.pyx":442 * cdef c_ssh2.LIBSSH2_CHANNEL *channel * with nogil: * channel = c_ssh2.libssh2_scp_send( # <<<<<<<<<<<<<< @@ -6366,7 +6388,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_52scp_send(struct __pyx_obj_4s __pyx_v_channel = libssh2_scp_send(__pyx_v_self->_session, __pyx_v__path, __pyx_v_mode, __pyx_v_size); } - /* "ssh2/session.pyx":440 + /* "ssh2/session.pyx":441 * cdef char *_path = to_bytes(path) * cdef c_ssh2.LIBSSH2_CHANNEL *channel * with nogil: # <<<<<<<<<<<<<< @@ -6385,7 +6407,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_52scp_send(struct __pyx_obj_4s } } - /* "ssh2/session.pyx":443 + /* "ssh2/session.pyx":444 * channel = c_ssh2.libssh2_scp_send( * self._session, _path, mode, size) * if channel is not NULL: # <<<<<<<<<<<<<< @@ -6395,7 +6417,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_52scp_send(struct __pyx_obj_4s __pyx_t_1 = ((__pyx_v_channel != NULL) != 0); if (__pyx_t_1) { - /* "ssh2/session.pyx":444 + /* "ssh2/session.pyx":445 * self._session, _path, mode, size) * if channel is not NULL: * return PyChannel(channel, self) # <<<<<<<<<<<<<< @@ -6403,13 +6425,13 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_52scp_send(struct __pyx_obj_4s * def scp_send64(self, path not None, int mode, uint64_t size, */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __pyx_f_4ssh2_7channel_PyChannel(__pyx_v_channel, __pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 444, __pyx_L1_error) + __pyx_t_2 = __pyx_f_4ssh2_7channel_PyChannel(__pyx_v_channel, __pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 445, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":443 + /* "ssh2/session.pyx":444 * channel = c_ssh2.libssh2_scp_send( * self._session, _path, mode, size) * if channel is not NULL: # <<<<<<<<<<<<<< @@ -6418,7 +6440,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_52scp_send(struct __pyx_obj_4s */ } - /* "ssh2/session.pyx":427 + /* "ssh2/session.pyx":428 * # return PyChannel(channel, self), fileinfo * * def scp_send(self, path not None, int mode, size_t size): # <<<<<<<<<<<<<< @@ -6439,7 +6461,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_52scp_send(struct __pyx_obj_4s return __pyx_r; } -/* "ssh2/session.pyx":446 +/* "ssh2/session.pyx":447 * return PyChannel(channel, self) * * def scp_send64(self, path not None, int mode, uint64_t size, # <<<<<<<<<<<<<< @@ -6488,29 +6510,29 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_55scp_send64(PyObject *__pyx_v case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mode)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("scp_send64", 1, 5, 5, 1); __PYX_ERR(0, 446, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("scp_send64", 1, 5, 5, 1); __PYX_ERR(0, 447, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("scp_send64", 1, 5, 5, 2); __PYX_ERR(0, 446, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("scp_send64", 1, 5, 5, 2); __PYX_ERR(0, 447, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mtime)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("scp_send64", 1, 5, 5, 3); __PYX_ERR(0, 446, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("scp_send64", 1, 5, 5, 3); __PYX_ERR(0, 447, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_atime)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("scp_send64", 1, 5, 5, 4); __PYX_ERR(0, 446, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("scp_send64", 1, 5, 5, 4); __PYX_ERR(0, 447, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "scp_send64") < 0)) __PYX_ERR(0, 446, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "scp_send64") < 0)) __PYX_ERR(0, 447, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 5) { goto __pyx_L5_argtuple_error; @@ -6522,21 +6544,21 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_55scp_send64(PyObject *__pyx_v values[4] = PyTuple_GET_ITEM(__pyx_args, 4); } __pyx_v_path = values[0]; - __pyx_v_mode = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_mode == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 446, __pyx_L3_error) - __pyx_v_size = __Pyx_PyInt_As_uint64_t(values[2]); if (unlikely((__pyx_v_size == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 446, __pyx_L3_error) - __pyx_v_mtime = __Pyx_PyInt_As_time_t(values[3]); if (unlikely((__pyx_v_mtime == ((time_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 447, __pyx_L3_error) - __pyx_v_atime = __Pyx_PyInt_As_time_t(values[4]); if (unlikely((__pyx_v_atime == ((time_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 447, __pyx_L3_error) + __pyx_v_mode = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_mode == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 447, __pyx_L3_error) + __pyx_v_size = __Pyx_PyInt_As_uint64_t(values[2]); if (unlikely((__pyx_v_size == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 447, __pyx_L3_error) + __pyx_v_mtime = __Pyx_PyInt_As_time_t(values[3]); if (unlikely((__pyx_v_mtime == ((time_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 448, __pyx_L3_error) + __pyx_v_atime = __Pyx_PyInt_As_time_t(values[4]); if (unlikely((__pyx_v_atime == ((time_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 448, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("scp_send64", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 446, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("scp_send64", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 447, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.session.Session.scp_send64", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(((PyObject *)__pyx_v_path) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "path"); __PYX_ERR(0, 446, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "path"); __PYX_ERR(0, 447, __pyx_L1_error) } __pyx_r = __pyx_pf_4ssh2_7session_7Session_54scp_send64(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), __pyx_v_path, __pyx_v_mode, __pyx_v_size, __pyx_v_mtime, __pyx_v_atime); @@ -6558,7 +6580,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_54scp_send64(struct __pyx_obj_ PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("scp_send64", 0); - /* "ssh2/session.pyx":448 + /* "ssh2/session.pyx":449 * def scp_send64(self, path not None, int mode, uint64_t size, * time_t mtime, time_t atime): * cdef char *_path = to_bytes(path) # <<<<<<<<<<<<<< @@ -6567,7 +6589,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_54scp_send64(struct __pyx_obj_ */ __pyx_v__path = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_path); - /* "ssh2/session.pyx":450 + /* "ssh2/session.pyx":451 * cdef char *_path = to_bytes(path) * cdef c_ssh2.LIBSSH2_CHANNEL *channel * with nogil: # <<<<<<<<<<<<<< @@ -6582,7 +6604,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_54scp_send64(struct __pyx_obj_ #endif /*try:*/ { - /* "ssh2/session.pyx":451 + /* "ssh2/session.pyx":452 * cdef c_ssh2.LIBSSH2_CHANNEL *channel * with nogil: * channel = c_ssh2.libssh2_scp_send64( # <<<<<<<<<<<<<< @@ -6592,7 +6614,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_54scp_send64(struct __pyx_obj_ __pyx_v_channel = libssh2_scp_send64(__pyx_v_self->_session, __pyx_v__path, __pyx_v_mode, __pyx_v_size, __pyx_v_mtime, __pyx_v_atime); } - /* "ssh2/session.pyx":450 + /* "ssh2/session.pyx":451 * cdef char *_path = to_bytes(path) * cdef c_ssh2.LIBSSH2_CHANNEL *channel * with nogil: # <<<<<<<<<<<<<< @@ -6611,7 +6633,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_54scp_send64(struct __pyx_obj_ } } - /* "ssh2/session.pyx":453 + /* "ssh2/session.pyx":454 * channel = c_ssh2.libssh2_scp_send64( * self._session, _path, mode, size, mtime, atime) * if channel is not NULL: # <<<<<<<<<<<<<< @@ -6620,19 +6642,19 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_54scp_send64(struct __pyx_obj_ __pyx_t_1 = ((__pyx_v_channel != NULL) != 0); if (__pyx_t_1) { - /* "ssh2/session.pyx":454 + /* "ssh2/session.pyx":455 * self._session, _path, mode, size, mtime, atime) * if channel is not NULL: * return PyChannel(channel, self) # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __pyx_f_4ssh2_7channel_PyChannel(__pyx_v_channel, __pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 454, __pyx_L1_error) + __pyx_t_2 = __pyx_f_4ssh2_7channel_PyChannel(__pyx_v_channel, __pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 455, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":453 + /* "ssh2/session.pyx":454 * channel = c_ssh2.libssh2_scp_send64( * self._session, _path, mode, size, mtime, atime) * if channel is not NULL: # <<<<<<<<<<<<<< @@ -6640,7 +6662,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_54scp_send64(struct __pyx_obj_ */ } - /* "ssh2/session.pyx":446 + /* "ssh2/session.pyx":447 * return PyChannel(channel, self) * * def scp_send64(self, path not None, int mode, uint64_t size, # <<<<<<<<<<<<<< @@ -6956,7 +6978,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {0, 0, 0, 0, 0, 0, 0} }; static int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(0, 42, __pyx_L1_error) + __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(0, 43, __pyx_L1_error) __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error) return 0; __pyx_L1_error:; @@ -6967,36 +6989,36 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - /* "ssh2/session.pyx":139 + /* "ssh2/session.pyx":140 * return * auth = to_str(_auth) * return auth.split(',') # <<<<<<<<<<<<<< * * def userauth_publickey_fromfile(self, username not None, */ - __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 139, __pyx_L1_error) + __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); - /* "ssh2/session.pyx":255 + /* "ssh2/session.pyx":256 * c_ssh2.libssh2_agent_free(agent) * with gil: * raise AgentConnectionError("Unable to connect to agent") # <<<<<<<<<<<<<< * return agent * */ - __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_connect_to_agent); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 255, __pyx_L1_error) + __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_connect_to_agent); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); - /* "ssh2/session.pyx":295 + /* "ssh2/session.pyx":296 * clear_agent(agent) * with gil: * raise AgentListIdentitiesError( # <<<<<<<<<<<<<< * "Failure requesting identities from agent") * while 1: */ - __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_Failure_requesting_identities_fr); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 295, __pyx_L1_error) + __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_Failure_requesting_identities_fr); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 296, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); @@ -7125,11 +7147,11 @@ PyMODINIT_FUNC PyInit_session(void) __pyx_vtabptr_4ssh2_7session_Session = &__pyx_vtable_4ssh2_7session_Session; __pyx_vtable_4ssh2_7session_Session.init_connect_agent = (LIBSSH2_AGENT *(*)(struct __pyx_obj_4ssh2_7session_Session *))__pyx_f_4ssh2_7session_7Session_init_connect_agent; __pyx_vtable_4ssh2_7session_Session._agent_init = (LIBSSH2_AGENT *(*)(struct __pyx_obj_4ssh2_7session_Session *))__pyx_f_4ssh2_7session_7Session__agent_init; - if (PyType_Ready(&__pyx_type_4ssh2_7session_Session) < 0) __PYX_ERR(0, 33, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_4ssh2_7session_Session) < 0) __PYX_ERR(0, 34, __pyx_L1_error) __pyx_type_4ssh2_7session_Session.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_4ssh2_7session_Session.tp_dict, __pyx_vtabptr_4ssh2_7session_Session) < 0) __PYX_ERR(0, 33, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "Session", (PyObject *)&__pyx_type_4ssh2_7session_Session) < 0) __PYX_ERR(0, 33, __pyx_L1_error) - if (__Pyx_setup_reduce((PyObject*)&__pyx_type_4ssh2_7session_Session) < 0) __PYX_ERR(0, 33, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type_4ssh2_7session_Session.tp_dict, __pyx_vtabptr_4ssh2_7session_Session) < 0) __PYX_ERR(0, 34, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "Session", (PyObject *)&__pyx_type_4ssh2_7session_Session) < 0) __PYX_ERR(0, 34, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_4ssh2_7session_Session) < 0) __PYX_ERR(0, 34, __pyx_L1_error) __pyx_ptype_4ssh2_7session_Session = &__pyx_type_4ssh2_7session_Session; /*--- Type import code ---*/ __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", @@ -7157,6 +7179,7 @@ PyMODINIT_FUNC PyInit_session(void) __pyx_ptype_4ssh2_8listener_Listener = __Pyx_ImportType("ssh2.listener", "Listener", sizeof(struct __pyx_obj_4ssh2_8listener_Listener), 1); if (unlikely(!__pyx_ptype_4ssh2_8listener_Listener)) __PYX_ERR(8, 24, __pyx_L1_error) __pyx_ptype_4ssh2_4sftp_SFTP = __Pyx_ImportType("ssh2.sftp", "SFTP", sizeof(struct __pyx_obj_4ssh2_4sftp_SFTP), 1); if (unlikely(!__pyx_ptype_4ssh2_4sftp_SFTP)) __PYX_ERR(9, 26, __pyx_L1_error) __pyx_ptype_4ssh2_8fileinfo_FileInfo = __Pyx_ImportType("ssh2.fileinfo", "FileInfo", sizeof(struct __pyx_obj_4ssh2_8fileinfo_FileInfo), 1); if (unlikely(!__pyx_ptype_4ssh2_8fileinfo_FileInfo)) __PYX_ERR(10, 3, __pyx_L1_error) + __pyx_ptype_4ssh2_8statinfo_StatInfo = __Pyx_ImportType("ssh2.statinfo", "StatInfo", sizeof(struct __pyx_obj_4ssh2_8statinfo_StatInfo), 1); if (unlikely(!__pyx_ptype_4ssh2_8statinfo_StatInfo)) __PYX_ERR(11, 4, __pyx_L1_error) /*--- Variable import code ---*/ /*--- Function import code ---*/ __pyx_t_1 = __Pyx_ImportModule("ssh2.agent"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) diff --git a/ssh2/session.pyx b/ssh2/session.pyx index c93adab2..a080b02d 100644 --- a/ssh2/session.pyx +++ b/ssh2/session.pyx @@ -28,6 +28,7 @@ from listener cimport PyListener from sftp cimport PySFTP from utils cimport to_bytes, to_str from fileinfo cimport FileInfo +from statinfo cimport StatInfo cdef class Session: @@ -401,13 +402,13 @@ cdef class Session: def scp_recv(self, path not None): cdef char *_path = to_bytes(path) - cdef FileInfo fileinfo = FileInfo() + cdef StatInfo statinfo = StatInfo() cdef c_ssh2.LIBSSH2_CHANNEL *channel with nogil: channel = c_ssh2.libssh2_scp_recv( - self._session, _path, fileinfo._stat) + self._session, _path, statinfo._stat) if channel is not NULL: - return PyChannel(channel, self), fileinfo + return PyChannel(channel, self), statinfo # def scp_recv2(self, path not None): # """Receive file via SCP. diff --git a/ssh2/sftp.c b/ssh2/sftp.c index b74cd7de..c8eedf6e 100644 --- a/ssh2/sftp.c +++ b/ssh2/sftp.c @@ -492,6 +492,8 @@ static CYTHON_INLINE float __PYX_NAN() { #include #include #include +#include +#include #include "libssh2.h" #include "libssh2_sftp.h" #include @@ -1242,6 +1244,8 @@ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* Module declarations from 'posix.types' */ +/* Module declarations from 'posix.stat' */ + /* Module declarations from 'ssh2.c_ssh2' */ /* Module declarations from 'ssh2.c_sftp' */ diff --git a/ssh2/statinfo.c b/ssh2/statinfo.c new file mode 100644 index 00000000..72dbc2de --- /dev/null +++ b/ssh2/statinfo.c @@ -0,0 +1,3919 @@ +/* Generated by Cython 0.26 */ + +/* BEGIN: Cython Metadata +{ + "distutils": { + "depends": [], + "extra_compile_args": [ + "-ggdb" + ], + "libraries": [ + "ssh2" + ], + "name": "ssh2.statinfo", + "sources": [ + "ssh2/statinfo.pyx" + ] + }, + "module_name": "ssh2.statinfo" +} +END: Cython Metadata */ + +#define PY_SSIZE_T_CLEAN +#include "Python.h" +#ifndef Py_PYTHON_H + #error Python headers needed to compile C extensions, please install development version of Python. +#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) + #error Cython requires Python 2.6+ or Python 3.2+. +#else +#define CYTHON_ABI "0_26" +#include +#ifndef offsetof + #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif + #ifndef __fastcall + #define __fastcall + #endif +#endif +#ifndef DL_IMPORT + #define DL_IMPORT(t) t +#endif +#ifndef DL_EXPORT + #define DL_EXPORT(t) t +#endif +#define __PYX_COMMA , +#ifndef HAVE_LONG_LONG + #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000) + #define HAVE_LONG_LONG + #endif +#endif +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#ifdef PYPY_VERSION + #define CYTHON_COMPILING_IN_PYPY 1 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 0 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #undef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 +#elif defined(PYSTON_VERSION) + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 1 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 +#else + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 1 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #if PY_MAJOR_VERSION < 3 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #elif !defined(CYTHON_USE_PYLONG_INTERNALS) + #define CYTHON_USE_PYLONG_INTERNALS 1 + #endif + #ifndef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 1 + #endif + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #if PY_VERSION_HEX < 0x030300F0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #elif !defined(CYTHON_USE_UNICODE_WRITER) + #define CYTHON_USE_UNICODE_WRITER 1 + #endif + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #ifndef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 1 + #endif + #ifndef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 1 + #endif +#endif +#if !defined(CYTHON_FAST_PYCCALL) +#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) +#endif +#if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #undef SHIFT + #undef BASE + #undef MASK +#endif +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) + #define Py_OptimizeFlag 0 +#endif +#define __PYX_BUILD_PY_SSIZE_T "n" +#define CYTHON_FORMAT_SSIZE_T "z" +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyClass_Type +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyType_Type +#endif +#ifndef Py_TPFLAGS_CHECKTYPES + #define Py_TPFLAGS_CHECKTYPES 0 +#endif +#ifndef Py_TPFLAGS_HAVE_INDEX + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#ifndef Py_TPFLAGS_HAVE_NEWBUFFER + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#ifndef Py_TPFLAGS_HAVE_FINALIZE + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#if PY_VERSION_HEX < 0x030700A0 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject **args, + Py_ssize_t nargs, PyObject *kwnames); +#else + #define __Pyx_PyCFunctionFast _PyCFunctionFast + #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords +#endif +#if CYTHON_FAST_PYCCALL +#define __Pyx_PyFastCFunction_Check(func)\ + ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS))))) +#else +#define __Pyx_PyFastCFunction_Check(func) 0 +#endif +#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) + #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) +#else + #define CYTHON_PEP393_ENABLED 0 + #define PyUnicode_1BYTE_KIND 1 + #define PyUnicode_2BYTE_KIND 2 + #define PyUnicode_4BYTE_KIND 4 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111) + #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) +#endif +#if CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) +#else + #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ + PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) + #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check) + #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) + #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) + #define PyObject_Malloc(s) PyMem_Malloc(s) + #define PyObject_Free(p) PyMem_Free(p) + #define PyObject_Realloc(p) PyMem_Realloc(p) +#endif +#if CYTHON_COMPILING_IN_PYSTON + #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno) +#else + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) +#endif +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) + #define PyObject_ASCII(o) PyObject_Repr(o) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +#endif +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY + #ifndef PyUnicode_InternFromString + #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) + #endif +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t PyInt_AsLong +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) +#else + #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) +#endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif +#if CYTHON_USE_ASYNC_SLOTS + #if PY_VERSION_HEX >= 0x030500B1 + #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods + #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) + #else + typedef struct { + unaryfunc am_await; + unaryfunc am_aiter; + unaryfunc am_anext; + } __Pyx_PyAsyncMethodsStruct; + #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) + #endif +#else + #define __Pyx_PyType_AsAsync(obj) NULL +#endif +#ifndef CYTHON_RESTRICT + #if defined(__GNUC__) + #define CYTHON_RESTRICT __restrict__ + #elif defined(_MSC_VER) && _MSC_VER >= 1400 + #define CYTHON_RESTRICT __restrict + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_RESTRICT restrict + #else + #define CYTHON_RESTRICT + #endif +#endif +#ifndef CYTHON_UNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +#endif +#ifndef CYTHON_MAYBE_UNUSED_VAR +# if defined(__cplusplus) + template void CYTHON_MAYBE_UNUSED_VAR( const T& ) { } +# else +# define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x) +# endif +#endif +#ifndef CYTHON_NCP_UNUSED +# if CYTHON_COMPILING_IN_CPYTHON +# define CYTHON_NCP_UNUSED +# else +# define CYTHON_NCP_UNUSED CYTHON_UNUSED +# endif +#endif +#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) +#ifdef _MSC_VER + #ifndef _MSC_STDINT_H_ + #if _MSC_VER < 1300 + typedef unsigned char uint8_t; + typedef unsigned int uint32_t; + #else + typedef unsigned __int8 uint8_t; + typedef unsigned __int32 uint32_t; + #endif + #endif +#else + #include +#endif +#ifndef CYTHON_FALLTHROUGH + #ifdef __cplusplus + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #elif __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) || (defined(__GNUC__) && defined(__attribute__)) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif + +#ifndef CYTHON_INLINE + #if defined(__clang__) + #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) + #elif defined(__GNUC__) + #define CYTHON_INLINE __inline__ + #elif defined(_MSC_VER) + #define CYTHON_INLINE __inline + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_INLINE inline + #else + #define CYTHON_INLINE + #endif +#endif + +#if defined(WIN32) || defined(MS_WINDOWS) + #define _USE_MATH_DEFINES +#endif +#include +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif +#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) +#define __Pyx_truncl trunc +#else +#define __Pyx_truncl truncl +#endif + + +#define __PYX_ERR(f_index, lineno, Ln_error) \ +{ \ + __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \ +} + +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif + +#ifndef __PYX_EXTERN_C + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#define __PYX_HAVE__ssh2__statinfo +#define __PYX_HAVE_API__ssh2__statinfo +#include +#include +#include +#include +#include +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#ifdef PYREX_WITHOUT_ASSERTIONS +#define CYTHON_WITHOUT_ASSERTIONS +#endif + +typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 +#define __PYX_DEFAULT_STRING_ENCODING "" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#define __Pyx_uchar_cast(c) ((unsigned char)c) +#define __Pyx_long_cast(x) ((long)x) +#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ + (sizeof(type) < sizeof(Py_ssize_t)) ||\ + (sizeof(type) > sizeof(Py_ssize_t) &&\ + likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX) &&\ + (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ + v == (type)PY_SSIZE_T_MIN))) ||\ + (sizeof(type) == sizeof(Py_ssize_t) &&\ + (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX))) ) +#if defined (__cplusplus) && __cplusplus >= 201103L + #include + #define __Pyx_sst_abs(value) std::abs(value) +#elif SIZEOF_INT >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) abs(value) +#elif SIZEOF_LONG >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) labs(value) +#elif defined (_MSC_VER) && defined (_M_X64) + #define __Pyx_sst_abs(value) _abs64(value) +#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define __Pyx_sst_abs(value) llabs(value) +#elif defined (__GNUC__) + #define __Pyx_sst_abs(value) __builtin_llabs(value) +#else + #define __Pyx_sst_abs(value) ((value<0) ? -value : value) +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) +#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) +#define __Pyx_PyBytes_FromString PyBytes_FromString +#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) +#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) +#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) +#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) +#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) +#if PY_MAJOR_VERSION < 3 +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) +{ + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#else +#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen +#endif +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) +#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) +#define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False)) +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +#if CYTHON_ASSUME_SAFE_MACROS +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) +#else +#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) +#endif +#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x)) +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + const char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + if (strcmp(default_encoding_c, "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (!ascii_chars_u) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + Py_DECREF(ascii_chars_u); + Py_DECREF(ascii_chars_b); + } + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); + if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + return -1; +} +#endif +#endif + + +/* Test for GCC > 2.95 */ +#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) +#else /* !__GNUC__ or GCC < 2.95 */ + #define likely(x) (x) + #define unlikely(x) (x) +#endif /* __GNUC__ */ +static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } + +static PyObject *__pyx_m; +static PyObject *__pyx_d; +static PyObject *__pyx_b; +static PyObject *__pyx_cython_runtime; +static PyObject *__pyx_empty_tuple; +static PyObject *__pyx_empty_bytes; +static PyObject *__pyx_empty_unicode; +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm= __FILE__; +static const char *__pyx_filename; + + +static const char *__pyx_f[] = { + "ssh2/statinfo.pyx", + "stringsource", +}; + +/*--- Type declarations ---*/ +struct __pyx_obj_4ssh2_8statinfo_StatInfo; + +/* "ssh2/statinfo.pxd":4 + * + * + * cdef class StatInfo: # <<<<<<<<<<<<<< + * """Representation of stat structure - older version""" + * cdef struct_stat* _stat + */ +struct __pyx_obj_4ssh2_8statinfo_StatInfo { + PyObject_HEAD + struct stat *_stat; +}; + + +/* --- Runtime support code (head) --- */ +/* Refnanny.proto */ +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, int); + void (*DECREF)(void*, PyObject*, int); + void (*GOTREF)(void*, PyObject*, int); + void (*GIVEREF)(void*, PyObject*, int); + void* (*SetupContext)(const char*, int, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + if (acquire_gil) {\ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + PyGILState_Release(__pyx_gilstate_save);\ + } else {\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) +#endif + #define __Pyx_RefNannyFinishContext()\ + __Pyx_RefNanny->FinishContext(&__pyx_refnanny) + #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #define __Pyx_RefNannyFinishContext() + #define __Pyx_INCREF(r) Py_INCREF(r) + #define __Pyx_DECREF(r) Py_DECREF(r) + #define __Pyx_GOTREF(r) + #define __Pyx_GIVEREF(r) + #define __Pyx_XINCREF(r) Py_XINCREF(r) + #define __Pyx_XDECREF(r) Py_XDECREF(r) + #define __Pyx_XGOTREF(r) + #define __Pyx_XGIVEREF(r) +#endif +#define __Pyx_XDECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_XDECREF(tmp);\ + } while (0) +#define __Pyx_DECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_DECREF(tmp);\ + } while (0) +#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) +#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) + +/* PyObjectGetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +/* GetBuiltinName.proto */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name); + +/* RaiseArgTupleInvalid.proto */ +static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, + Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); + +/* KeywordStringCheck.proto */ +static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed); + +/* NoFastGil.proto */ +#define __Pyx_PyGILState_Ensure PyGILState_Ensure +#define __Pyx_PyGILState_Release PyGILState_Release +#define __Pyx_FastGIL_Remember() +#define __Pyx_FastGIL_Forget() +#define __Pyx_FastGilFuncInit() + +/* ForceInitThreads.proto */ +#ifndef __PYX_FORCE_INIT_THREADS + #define __PYX_FORCE_INIT_THREADS 0 +#endif + +/* PyObjectCall.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + +/* PyThreadStateGet.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; +#define __Pyx_PyThreadState_assign __pyx_tstate = PyThreadState_GET(); +#else +#define __Pyx_PyThreadState_declare +#define __Pyx_PyThreadState_assign +#endif + +/* PyErrFetchRestore.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#else +#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) +#endif + +/* RaiseException.proto */ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); + +/* SetupReduce.proto */ +static int __Pyx_setup_reduce(PyObject* type_obj); + +/* CLineInTraceback.proto */ +static int __Pyx_CLineForTraceback(int c_line); + +/* CodeObjectCache.proto */ +typedef struct { + PyCodeObject* code_object; + int code_line; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); + +/* AddTraceback.proto */ +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_ino_t(ino_t value); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_mode_t(mode_t value); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_nlink_t(nlink_t value); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uid_t(uid_t value); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_gid_t(gid_t value); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_dev_t(dev_t value); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_off_t(off_t value); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_blksize_t(blksize_t value); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_blkcnt_t(blkcnt_t value); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_time_t(time_t value); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +/* CIntFromPy.proto */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +/* CIntFromPy.proto */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +/* CheckBinaryVersion.proto */ +static int __Pyx_check_binary_version(void); + +/* InitStrings.proto */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); + + +/* Module declarations from 'posix.types' */ + +/* Module declarations from 'posix.stat' */ + +/* Module declarations from 'libc.string' */ + +/* Module declarations from 'libc.stdlib' */ + +/* Module declarations from 'ssh2.statinfo' */ +static PyTypeObject *__pyx_ptype_4ssh2_8statinfo_StatInfo = 0; +#define __Pyx_MODULE_NAME "ssh2.statinfo" +int __pyx_module_is_main_ssh2__statinfo = 0; + +/* Implementation of 'ssh2.statinfo' */ +static PyObject *__pyx_builtin_MemoryError; +static PyObject *__pyx_builtin_TypeError; +static const char __pyx_k_main[] = "__main__"; +static const char __pyx_k_test[] = "__test__"; +static const char __pyx_k_TypeError[] = "TypeError"; +static const char __pyx_k_MemoryError[] = "MemoryError"; +static const char __pyx_k_reduce_cython[] = "__reduce_cython__"; +static const char __pyx_k_setstate_cython[] = "__setstate_cython__"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; +static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__"; +static PyObject *__pyx_n_s_MemoryError; +static PyObject *__pyx_n_s_TypeError; +static PyObject *__pyx_n_s_cline_in_traceback; +static PyObject *__pyx_n_s_main; +static PyObject *__pyx_kp_s_no_default___reduce___due_to_non; +static PyObject *__pyx_n_s_reduce_cython; +static PyObject *__pyx_n_s_setstate_cython; +static PyObject *__pyx_n_s_test; +static int __pyx_pf_4ssh2_8statinfo_8StatInfo___cinit__(struct __pyx_obj_4ssh2_8statinfo_StatInfo *__pyx_v_self); /* proto */ +static void __pyx_pf_4ssh2_8statinfo_8StatInfo_2__dealloc__(struct __pyx_obj_4ssh2_8statinfo_StatInfo *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4ssh2_8statinfo_8StatInfo_6st_ino___get__(struct __pyx_obj_4ssh2_8statinfo_StatInfo *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4ssh2_8statinfo_8StatInfo_7st_mode___get__(struct __pyx_obj_4ssh2_8statinfo_StatInfo *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4ssh2_8statinfo_8StatInfo_8st_nlink___get__(struct __pyx_obj_4ssh2_8statinfo_StatInfo *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4ssh2_8statinfo_8StatInfo_6st_uid___get__(struct __pyx_obj_4ssh2_8statinfo_StatInfo *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4ssh2_8statinfo_8StatInfo_6st_gid___get__(struct __pyx_obj_4ssh2_8statinfo_StatInfo *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4ssh2_8statinfo_8StatInfo_7st_rdev___get__(struct __pyx_obj_4ssh2_8statinfo_StatInfo *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4ssh2_8statinfo_8StatInfo_7st_size___get__(struct __pyx_obj_4ssh2_8statinfo_StatInfo *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4ssh2_8statinfo_8StatInfo_10st_blksize___get__(struct __pyx_obj_4ssh2_8statinfo_StatInfo *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4ssh2_8statinfo_8StatInfo_9st_blocks___get__(struct __pyx_obj_4ssh2_8statinfo_StatInfo *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4ssh2_8statinfo_8StatInfo_8st_atime___get__(struct __pyx_obj_4ssh2_8statinfo_StatInfo *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4ssh2_8statinfo_8StatInfo_8st_mtime___get__(struct __pyx_obj_4ssh2_8statinfo_StatInfo *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4ssh2_8statinfo_8StatInfo_8st_ctime___get__(struct __pyx_obj_4ssh2_8statinfo_StatInfo *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4ssh2_8statinfo_8StatInfo_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_4ssh2_8statinfo_StatInfo *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4ssh2_8statinfo_8StatInfo_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_4ssh2_8statinfo_StatInfo *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ +static PyObject *__pyx_tp_new_4ssh2_8statinfo_StatInfo(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tuple_; +static PyObject *__pyx_tuple__2; + +/* "ssh2/statinfo.pyx":24 + * """Representation of stat structure - older version""" + * + * def __cinit__(self): # <<<<<<<<<<<<<< + * with nogil: + * self._stat = malloc( + */ + +/* Python wrapper */ +static int __pyx_pw_4ssh2_8statinfo_8StatInfo_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_4ssh2_8statinfo_8StatInfo_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} + if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; + __pyx_r = __pyx_pf_4ssh2_8statinfo_8StatInfo___cinit__(((struct __pyx_obj_4ssh2_8statinfo_StatInfo *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_4ssh2_8statinfo_8StatInfo___cinit__(struct __pyx_obj_4ssh2_8statinfo_StatInfo *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("__cinit__", 0); + + /* "ssh2/statinfo.pyx":25 + * + * def __cinit__(self): + * with nogil: # <<<<<<<<<<<<<< + * self._stat = malloc( + * sizeof(struct_stat)) + */ + { + #ifdef WITH_THREAD + PyThreadState *_save; + Py_UNBLOCK_THREADS + __Pyx_FastGIL_Remember(); + #endif + /*try:*/ { + + /* "ssh2/statinfo.pyx":26 + * def __cinit__(self): + * with nogil: + * self._stat = malloc( # <<<<<<<<<<<<<< + * sizeof(struct_stat)) + * if self._stat is NULL: + */ + __pyx_v_self->_stat = ((struct stat *)malloc((sizeof(struct stat)))); + + /* "ssh2/statinfo.pyx":28 + * self._stat = malloc( + * sizeof(struct_stat)) + * if self._stat is NULL: # <<<<<<<<<<<<<< + * with gil: + * raise MemoryError + */ + __pyx_t_1 = ((__pyx_v_self->_stat == NULL) != 0); + if (__pyx_t_1) { + + /* "ssh2/statinfo.pyx":29 + * sizeof(struct_stat)) + * if self._stat is NULL: + * with gil: # <<<<<<<<<<<<<< + * raise MemoryError + * + */ + { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + /*try:*/ { + + /* "ssh2/statinfo.pyx":30 + * if self._stat is NULL: + * with gil: + * raise MemoryError # <<<<<<<<<<<<<< + * + * def __dealloc__(self): + */ + PyErr_NoMemory(); __PYX_ERR(0, 30, __pyx_L8_error) + } + + /* "ssh2/statinfo.pyx":29 + * sizeof(struct_stat)) + * if self._stat is NULL: + * with gil: # <<<<<<<<<<<<<< + * raise MemoryError + * + */ + /*finally:*/ { + __pyx_L8_error: { + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + goto __pyx_L4_error; + } + } + } + + /* "ssh2/statinfo.pyx":28 + * self._stat = malloc( + * sizeof(struct_stat)) + * if self._stat is NULL: # <<<<<<<<<<<<<< + * with gil: + * raise MemoryError + */ + } + } + + /* "ssh2/statinfo.pyx":25 + * + * def __cinit__(self): + * with nogil: # <<<<<<<<<<<<<< + * self._stat = malloc( + * sizeof(struct_stat)) + */ + /*finally:*/ { + /*normal exit:*/{ + #ifdef WITH_THREAD + __Pyx_FastGIL_Forget(); + Py_BLOCK_THREADS + #endif + goto __pyx_L5; + } + __pyx_L4_error: { + #ifdef WITH_THREAD + __Pyx_FastGIL_Forget(); + Py_BLOCK_THREADS + #endif + goto __pyx_L1_error; + } + __pyx_L5:; + } + } + + /* "ssh2/statinfo.pyx":24 + * """Representation of stat structure - older version""" + * + * def __cinit__(self): # <<<<<<<<<<<<<< + * with nogil: + * self._stat = malloc( + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("ssh2.statinfo.StatInfo.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "ssh2/statinfo.pyx":32 + * raise MemoryError + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * free(self._stat) + * + */ + +/* Python wrapper */ +static void __pyx_pw_4ssh2_8statinfo_8StatInfo_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_pw_4ssh2_8statinfo_8StatInfo_3__dealloc__(PyObject *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); + __pyx_pf_4ssh2_8statinfo_8StatInfo_2__dealloc__(((struct __pyx_obj_4ssh2_8statinfo_StatInfo *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_pf_4ssh2_8statinfo_8StatInfo_2__dealloc__(struct __pyx_obj_4ssh2_8statinfo_StatInfo *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__", 0); + + /* "ssh2/statinfo.pyx":33 + * + * def __dealloc__(self): + * free(self._stat) # <<<<<<<<<<<<<< + * + * @property + */ + free(__pyx_v_self->_stat); + + /* "ssh2/statinfo.pyx":32 + * raise MemoryError + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * free(self._stat) + * + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "ssh2/statinfo.pyx":36 + * + * @property + * def st_ino(self): # <<<<<<<<<<<<<< + * return self._stat.st_ino + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4ssh2_8statinfo_8StatInfo_6st_ino_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_4ssh2_8statinfo_8StatInfo_6st_ino_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_4ssh2_8statinfo_8StatInfo_6st_ino___get__(((struct __pyx_obj_4ssh2_8statinfo_StatInfo *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4ssh2_8statinfo_8StatInfo_6st_ino___get__(struct __pyx_obj_4ssh2_8statinfo_StatInfo *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "ssh2/statinfo.pyx":37 + * @property + * def st_ino(self): + * return self._stat.st_ino # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_ino_t(__pyx_v_self->_stat->st_ino); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 37, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "ssh2/statinfo.pyx":36 + * + * @property + * def st_ino(self): # <<<<<<<<<<<<<< + * return self._stat.st_ino + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("ssh2.statinfo.StatInfo.st_ino.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "ssh2/statinfo.pyx":40 + * + * @property + * def st_mode(self): # <<<<<<<<<<<<<< + * return self._stat.st_mode + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4ssh2_8statinfo_8StatInfo_7st_mode_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_4ssh2_8statinfo_8StatInfo_7st_mode_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_4ssh2_8statinfo_8StatInfo_7st_mode___get__(((struct __pyx_obj_4ssh2_8statinfo_StatInfo *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4ssh2_8statinfo_8StatInfo_7st_mode___get__(struct __pyx_obj_4ssh2_8statinfo_StatInfo *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "ssh2/statinfo.pyx":41 + * @property + * def st_mode(self): + * return self._stat.st_mode # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_mode_t(__pyx_v_self->_stat->st_mode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 41, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "ssh2/statinfo.pyx":40 + * + * @property + * def st_mode(self): # <<<<<<<<<<<<<< + * return self._stat.st_mode + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("ssh2.statinfo.StatInfo.st_mode.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "ssh2/statinfo.pyx":44 + * + * @property + * def st_nlink(self): # <<<<<<<<<<<<<< + * return self._stat.st_nlink + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4ssh2_8statinfo_8StatInfo_8st_nlink_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_4ssh2_8statinfo_8StatInfo_8st_nlink_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_4ssh2_8statinfo_8StatInfo_8st_nlink___get__(((struct __pyx_obj_4ssh2_8statinfo_StatInfo *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4ssh2_8statinfo_8StatInfo_8st_nlink___get__(struct __pyx_obj_4ssh2_8statinfo_StatInfo *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "ssh2/statinfo.pyx":45 + * @property + * def st_nlink(self): + * return self._stat.st_nlink # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_nlink_t(__pyx_v_self->_stat->st_nlink); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 45, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "ssh2/statinfo.pyx":44 + * + * @property + * def st_nlink(self): # <<<<<<<<<<<<<< + * return self._stat.st_nlink + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("ssh2.statinfo.StatInfo.st_nlink.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "ssh2/statinfo.pyx":48 + * + * @property + * def st_uid(self): # <<<<<<<<<<<<<< + * return self._stat.st_uid + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4ssh2_8statinfo_8StatInfo_6st_uid_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_4ssh2_8statinfo_8StatInfo_6st_uid_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_4ssh2_8statinfo_8StatInfo_6st_uid___get__(((struct __pyx_obj_4ssh2_8statinfo_StatInfo *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4ssh2_8statinfo_8StatInfo_6st_uid___get__(struct __pyx_obj_4ssh2_8statinfo_StatInfo *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "ssh2/statinfo.pyx":49 + * @property + * def st_uid(self): + * return self._stat.st_uid # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_uid_t(__pyx_v_self->_stat->st_uid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 49, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "ssh2/statinfo.pyx":48 + * + * @property + * def st_uid(self): # <<<<<<<<<<<<<< + * return self._stat.st_uid + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("ssh2.statinfo.StatInfo.st_uid.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "ssh2/statinfo.pyx":52 + * + * @property + * def st_gid(self): # <<<<<<<<<<<<<< + * return self._stat.st_gid + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4ssh2_8statinfo_8StatInfo_6st_gid_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_4ssh2_8statinfo_8StatInfo_6st_gid_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_4ssh2_8statinfo_8StatInfo_6st_gid___get__(((struct __pyx_obj_4ssh2_8statinfo_StatInfo *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4ssh2_8statinfo_8StatInfo_6st_gid___get__(struct __pyx_obj_4ssh2_8statinfo_StatInfo *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "ssh2/statinfo.pyx":53 + * @property + * def st_gid(self): + * return self._stat.st_gid # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_gid_t(__pyx_v_self->_stat->st_gid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 53, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "ssh2/statinfo.pyx":52 + * + * @property + * def st_gid(self): # <<<<<<<<<<<<<< + * return self._stat.st_gid + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("ssh2.statinfo.StatInfo.st_gid.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "ssh2/statinfo.pyx":56 + * + * @property + * def st_rdev(self): # <<<<<<<<<<<<<< + * return self._stat.st_rdev + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4ssh2_8statinfo_8StatInfo_7st_rdev_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_4ssh2_8statinfo_8StatInfo_7st_rdev_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_4ssh2_8statinfo_8StatInfo_7st_rdev___get__(((struct __pyx_obj_4ssh2_8statinfo_StatInfo *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4ssh2_8statinfo_8StatInfo_7st_rdev___get__(struct __pyx_obj_4ssh2_8statinfo_StatInfo *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "ssh2/statinfo.pyx":57 + * @property + * def st_rdev(self): + * return self._stat.st_rdev # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_dev_t(__pyx_v_self->_stat->st_rdev); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "ssh2/statinfo.pyx":56 + * + * @property + * def st_rdev(self): # <<<<<<<<<<<<<< + * return self._stat.st_rdev + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("ssh2.statinfo.StatInfo.st_rdev.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "ssh2/statinfo.pyx":60 + * + * @property + * def st_size(self): # <<<<<<<<<<<<<< + * return self._stat.st_size + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4ssh2_8statinfo_8StatInfo_7st_size_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_4ssh2_8statinfo_8StatInfo_7st_size_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_4ssh2_8statinfo_8StatInfo_7st_size___get__(((struct __pyx_obj_4ssh2_8statinfo_StatInfo *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4ssh2_8statinfo_8StatInfo_7st_size___get__(struct __pyx_obj_4ssh2_8statinfo_StatInfo *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "ssh2/statinfo.pyx":61 + * @property + * def st_size(self): + * return self._stat.st_size # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_off_t(__pyx_v_self->_stat->st_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 61, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "ssh2/statinfo.pyx":60 + * + * @property + * def st_size(self): # <<<<<<<<<<<<<< + * return self._stat.st_size + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("ssh2.statinfo.StatInfo.st_size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "ssh2/statinfo.pyx":64 + * + * @property + * def st_blksize(self): # <<<<<<<<<<<<<< + * return self._stat.st_blksize + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4ssh2_8statinfo_8StatInfo_10st_blksize_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_4ssh2_8statinfo_8StatInfo_10st_blksize_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_4ssh2_8statinfo_8StatInfo_10st_blksize___get__(((struct __pyx_obj_4ssh2_8statinfo_StatInfo *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4ssh2_8statinfo_8StatInfo_10st_blksize___get__(struct __pyx_obj_4ssh2_8statinfo_StatInfo *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "ssh2/statinfo.pyx":65 + * @property + * def st_blksize(self): + * return self._stat.st_blksize # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_blksize_t(__pyx_v_self->_stat->st_blksize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 65, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "ssh2/statinfo.pyx":64 + * + * @property + * def st_blksize(self): # <<<<<<<<<<<<<< + * return self._stat.st_blksize + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("ssh2.statinfo.StatInfo.st_blksize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "ssh2/statinfo.pyx":68 + * + * @property + * def st_blocks(self): # <<<<<<<<<<<<<< + * return self._stat.st_blocks + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4ssh2_8statinfo_8StatInfo_9st_blocks_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_4ssh2_8statinfo_8StatInfo_9st_blocks_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_4ssh2_8statinfo_8StatInfo_9st_blocks___get__(((struct __pyx_obj_4ssh2_8statinfo_StatInfo *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4ssh2_8statinfo_8StatInfo_9st_blocks___get__(struct __pyx_obj_4ssh2_8statinfo_StatInfo *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "ssh2/statinfo.pyx":69 + * @property + * def st_blocks(self): + * return self._stat.st_blocks # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_blkcnt_t(__pyx_v_self->_stat->st_blocks); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 69, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "ssh2/statinfo.pyx":68 + * + * @property + * def st_blocks(self): # <<<<<<<<<<<<<< + * return self._stat.st_blocks + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("ssh2.statinfo.StatInfo.st_blocks.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "ssh2/statinfo.pyx":72 + * + * @property + * def st_atime(self): # <<<<<<<<<<<<<< + * return self._stat.st_atime + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4ssh2_8statinfo_8StatInfo_8st_atime_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_4ssh2_8statinfo_8StatInfo_8st_atime_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_4ssh2_8statinfo_8StatInfo_8st_atime___get__(((struct __pyx_obj_4ssh2_8statinfo_StatInfo *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4ssh2_8statinfo_8StatInfo_8st_atime___get__(struct __pyx_obj_4ssh2_8statinfo_StatInfo *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "ssh2/statinfo.pyx":73 + * @property + * def st_atime(self): + * return self._stat.st_atime # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_time_t(__pyx_v_self->_stat->st_atime); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 73, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "ssh2/statinfo.pyx":72 + * + * @property + * def st_atime(self): # <<<<<<<<<<<<<< + * return self._stat.st_atime + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("ssh2.statinfo.StatInfo.st_atime.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "ssh2/statinfo.pyx":76 + * + * @property + * def st_mtime(self): # <<<<<<<<<<<<<< + * return self._stat.st_mtime + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4ssh2_8statinfo_8StatInfo_8st_mtime_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_4ssh2_8statinfo_8StatInfo_8st_mtime_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_4ssh2_8statinfo_8StatInfo_8st_mtime___get__(((struct __pyx_obj_4ssh2_8statinfo_StatInfo *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4ssh2_8statinfo_8StatInfo_8st_mtime___get__(struct __pyx_obj_4ssh2_8statinfo_StatInfo *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "ssh2/statinfo.pyx":77 + * @property + * def st_mtime(self): + * return self._stat.st_mtime # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_time_t(__pyx_v_self->_stat->st_mtime); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 77, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "ssh2/statinfo.pyx":76 + * + * @property + * def st_mtime(self): # <<<<<<<<<<<<<< + * return self._stat.st_mtime + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("ssh2.statinfo.StatInfo.st_mtime.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "ssh2/statinfo.pyx":80 + * + * @property + * def st_ctime(self): # <<<<<<<<<<<<<< + * return self._stat.st_ctime + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4ssh2_8statinfo_8StatInfo_8st_ctime_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_4ssh2_8statinfo_8StatInfo_8st_ctime_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_4ssh2_8statinfo_8StatInfo_8st_ctime___get__(((struct __pyx_obj_4ssh2_8statinfo_StatInfo *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4ssh2_8statinfo_8StatInfo_8st_ctime___get__(struct __pyx_obj_4ssh2_8statinfo_StatInfo *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "ssh2/statinfo.pyx":81 + * @property + * def st_ctime(self): + * return self._stat.st_ctime # <<<<<<<<<<<<<< + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_time_t(__pyx_v_self->_stat->st_ctime); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 81, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "ssh2/statinfo.pyx":80 + * + * @property + * def st_ctime(self): # <<<<<<<<<<<<<< + * return self._stat.st_ctime + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("ssh2.statinfo.StatInfo.st_ctime.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4ssh2_8statinfo_8StatInfo_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_4ssh2_8statinfo_8StatInfo_4__reduce_cython__[] = "StatInfo.__reduce_cython__(self)"; +static PyObject *__pyx_pw_4ssh2_8statinfo_8StatInfo_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_4ssh2_8statinfo_8StatInfo_4__reduce_cython__(((struct __pyx_obj_4ssh2_8statinfo_StatInfo *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4ssh2_8statinfo_8StatInfo_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_4ssh2_8statinfo_StatInfo *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__reduce_cython__", 0); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(1, 2, __pyx_L1_error) + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("ssh2.statinfo.StatInfo.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4ssh2_8statinfo_8StatInfo_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static char __pyx_doc_4ssh2_8statinfo_8StatInfo_6__setstate_cython__[] = "StatInfo.__setstate_cython__(self, __pyx_state)"; +static PyObject *__pyx_pw_4ssh2_8statinfo_8StatInfo_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_4ssh2_8statinfo_8StatInfo_6__setstate_cython__(((struct __pyx_obj_4ssh2_8statinfo_StatInfo *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4ssh2_8statinfo_8StatInfo_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_4ssh2_8statinfo_StatInfo *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__setstate_cython__", 0); + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(1, 4, __pyx_L1_error) + + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("ssh2.statinfo.StatInfo.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_tp_new_4ssh2_8statinfo_StatInfo(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + if (unlikely(__pyx_pw_4ssh2_8statinfo_8StatInfo_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; + return o; + bad: + Py_DECREF(o); o = 0; + return NULL; +} + +static void __pyx_tp_dealloc_4ssh2_8statinfo_StatInfo(PyObject *o) { + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + ++Py_REFCNT(o); + __pyx_pw_4ssh2_8statinfo_8StatInfo_3__dealloc__(o); + --Py_REFCNT(o); + PyErr_Restore(etype, eval, etb); + } + (*Py_TYPE(o)->tp_free)(o); +} + +static PyObject *__pyx_getprop_4ssh2_8statinfo_8StatInfo_st_ino(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_4ssh2_8statinfo_8StatInfo_6st_ino_1__get__(o); +} + +static PyObject *__pyx_getprop_4ssh2_8statinfo_8StatInfo_st_mode(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_4ssh2_8statinfo_8StatInfo_7st_mode_1__get__(o); +} + +static PyObject *__pyx_getprop_4ssh2_8statinfo_8StatInfo_st_nlink(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_4ssh2_8statinfo_8StatInfo_8st_nlink_1__get__(o); +} + +static PyObject *__pyx_getprop_4ssh2_8statinfo_8StatInfo_st_uid(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_4ssh2_8statinfo_8StatInfo_6st_uid_1__get__(o); +} + +static PyObject *__pyx_getprop_4ssh2_8statinfo_8StatInfo_st_gid(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_4ssh2_8statinfo_8StatInfo_6st_gid_1__get__(o); +} + +static PyObject *__pyx_getprop_4ssh2_8statinfo_8StatInfo_st_rdev(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_4ssh2_8statinfo_8StatInfo_7st_rdev_1__get__(o); +} + +static PyObject *__pyx_getprop_4ssh2_8statinfo_8StatInfo_st_size(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_4ssh2_8statinfo_8StatInfo_7st_size_1__get__(o); +} + +static PyObject *__pyx_getprop_4ssh2_8statinfo_8StatInfo_st_blksize(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_4ssh2_8statinfo_8StatInfo_10st_blksize_1__get__(o); +} + +static PyObject *__pyx_getprop_4ssh2_8statinfo_8StatInfo_st_blocks(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_4ssh2_8statinfo_8StatInfo_9st_blocks_1__get__(o); +} + +static PyObject *__pyx_getprop_4ssh2_8statinfo_8StatInfo_st_atime(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_4ssh2_8statinfo_8StatInfo_8st_atime_1__get__(o); +} + +static PyObject *__pyx_getprop_4ssh2_8statinfo_8StatInfo_st_mtime(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_4ssh2_8statinfo_8StatInfo_8st_mtime_1__get__(o); +} + +static PyObject *__pyx_getprop_4ssh2_8statinfo_8StatInfo_st_ctime(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_4ssh2_8statinfo_8StatInfo_8st_ctime_1__get__(o); +} + +static PyMethodDef __pyx_methods_4ssh2_8statinfo_StatInfo[] = { + {"__reduce_cython__", (PyCFunction)__pyx_pw_4ssh2_8statinfo_8StatInfo_5__reduce_cython__, METH_NOARGS, __pyx_doc_4ssh2_8statinfo_8StatInfo_4__reduce_cython__}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_4ssh2_8statinfo_8StatInfo_7__setstate_cython__, METH_O, __pyx_doc_4ssh2_8statinfo_8StatInfo_6__setstate_cython__}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_4ssh2_8statinfo_StatInfo[] = { + {(char *)"st_ino", __pyx_getprop_4ssh2_8statinfo_8StatInfo_st_ino, 0, (char *)0, 0}, + {(char *)"st_mode", __pyx_getprop_4ssh2_8statinfo_8StatInfo_st_mode, 0, (char *)0, 0}, + {(char *)"st_nlink", __pyx_getprop_4ssh2_8statinfo_8StatInfo_st_nlink, 0, (char *)0, 0}, + {(char *)"st_uid", __pyx_getprop_4ssh2_8statinfo_8StatInfo_st_uid, 0, (char *)0, 0}, + {(char *)"st_gid", __pyx_getprop_4ssh2_8statinfo_8StatInfo_st_gid, 0, (char *)0, 0}, + {(char *)"st_rdev", __pyx_getprop_4ssh2_8statinfo_8StatInfo_st_rdev, 0, (char *)0, 0}, + {(char *)"st_size", __pyx_getprop_4ssh2_8statinfo_8StatInfo_st_size, 0, (char *)0, 0}, + {(char *)"st_blksize", __pyx_getprop_4ssh2_8statinfo_8StatInfo_st_blksize, 0, (char *)0, 0}, + {(char *)"st_blocks", __pyx_getprop_4ssh2_8statinfo_8StatInfo_st_blocks, 0, (char *)0, 0}, + {(char *)"st_atime", __pyx_getprop_4ssh2_8statinfo_8StatInfo_st_atime, 0, (char *)0, 0}, + {(char *)"st_mtime", __pyx_getprop_4ssh2_8statinfo_8StatInfo_st_mtime, 0, (char *)0, 0}, + {(char *)"st_ctime", __pyx_getprop_4ssh2_8statinfo_8StatInfo_st_ctime, 0, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_4ssh2_8statinfo_StatInfo = { + PyVarObject_HEAD_INIT(0, 0) + "ssh2.statinfo.StatInfo", /*tp_name*/ + sizeof(struct __pyx_obj_4ssh2_8statinfo_StatInfo), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_4ssh2_8statinfo_StatInfo, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + "Representation of stat structure - older version", /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_4ssh2_8statinfo_StatInfo, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_4ssh2_8statinfo_StatInfo, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_4ssh2_8statinfo_StatInfo, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyMethodDef __pyx_methods[] = { + {0, 0, 0, 0} +}; + +#if PY_MAJOR_VERSION >= 3 +static struct PyModuleDef __pyx_moduledef = { + #if PY_VERSION_HEX < 0x03020000 + { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, + #else + PyModuleDef_HEAD_INIT, + #endif + "statinfo", + 0, /* m_doc */ + -1, /* m_size */ + __pyx_methods /* m_methods */, + NULL, /* m_reload */ + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ +}; +#endif + +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1}, + {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, + {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0}, + {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1}, + {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} +}; +static int __Pyx_InitCachedBuiltins(void) { + __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(0, 30, __pyx_L1_error) + __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} + +static int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple_)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple_); + __Pyx_GIVEREF(__pyx_tuple_); + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2); + __Pyx_GIVEREF(__pyx_tuple__2); + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_InitGlobals(void) { + if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + return 0; + __pyx_L1_error:; + return -1; +} + +#if PY_MAJOR_VERSION < 3 +PyMODINIT_FUNC initstatinfo(void); /*proto*/ +PyMODINIT_FUNC initstatinfo(void) +#else +PyMODINIT_FUNC PyInit_statinfo(void); /*proto*/ +PyMODINIT_FUNC PyInit_statinfo(void) +#endif +{ + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannyDeclarations + #if CYTHON_REFNANNY + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); + if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); + } + #endif + __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_statinfo(void)", 0); + if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pyx_CyFunction_USED + if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Coroutine_USED + if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_StopAsyncIteration_USED + if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + #ifdef WITH_THREAD /* Python build with threading support? */ + PyEval_InitThreads(); + #endif + #endif + /*--- Module creation code ---*/ + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4("statinfo", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + #endif + if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_d); + __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) + #if CYTHON_COMPILING_IN_PYPY + Py_INCREF(__pyx_b); + #endif + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + /*--- Initialize various global constants etc. ---*/ + if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + if (__pyx_module_is_main_ssh2__statinfo) { + if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) + if (!PyDict_GetItemString(modules, "ssh2.statinfo")) { + if (unlikely(PyDict_SetItemString(modules, "ssh2.statinfo", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error) + } + } + #endif + /*--- Builtin init code ---*/ + if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Constants init code ---*/ + if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Global init code ---*/ + /*--- Variable export code ---*/ + /*--- Function export code ---*/ + /*--- Type init code ---*/ + if (PyType_Ready(&__pyx_type_4ssh2_8statinfo_StatInfo) < 0) __PYX_ERR(0, 21, __pyx_L1_error) + __pyx_type_4ssh2_8statinfo_StatInfo.tp_print = 0; + if (PyObject_SetAttrString(__pyx_m, "StatInfo", (PyObject *)&__pyx_type_4ssh2_8statinfo_StatInfo) < 0) __PYX_ERR(0, 21, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_4ssh2_8statinfo_StatInfo) < 0) __PYX_ERR(0, 21, __pyx_L1_error) + __pyx_ptype_4ssh2_8statinfo_StatInfo = &__pyx_type_4ssh2_8statinfo_StatInfo; + /*--- Type import code ---*/ + /*--- Variable import code ---*/ + /*--- Function import code ---*/ + /*--- Execution code ---*/ + #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) + if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + + /* "ssh2/statinfo.pyx":1 + * # This file is part of ssh2-python. # <<<<<<<<<<<<<< + * # Copyright (C) 2017 Panos Kittenis + * + */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /*--- Wrapped vars code ---*/ + + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + if (__pyx_m) { + if (__pyx_d) { + __Pyx_AddTraceback("init ssh2.statinfo", 0, __pyx_lineno, __pyx_filename); + } + Py_DECREF(__pyx_m); __pyx_m = 0; + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init ssh2.statinfo"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if PY_MAJOR_VERSION < 3 + return; + #else + return __pyx_m; + #endif +} + +/* --- Runtime support code --- */ +/* Refnanny */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule((char *)modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif + +/* GetBuiltinName */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); + if (unlikely(!result)) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +/* RaiseArgTupleInvalid */ +static void __Pyx_RaiseArgtupleInvalid( + const char* func_name, + int exact, + Py_ssize_t num_min, + Py_ssize_t num_max, + Py_ssize_t num_found) +{ + Py_ssize_t num_expected; + const char *more_or_less; + if (num_found < num_min) { + num_expected = num_min; + more_or_less = "at least"; + } else { + num_expected = num_max; + more_or_less = "at most"; + } + if (exact) { + more_or_less = "exactly"; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); +} + +/* KeywordStringCheck */ +static CYTHON_INLINE int __Pyx_CheckKeywordStrings( + PyObject *kwdict, + const char* function_name, + int kw_allowed) +{ + PyObject* key = 0; + Py_ssize_t pos = 0; +#if CYTHON_COMPILING_IN_PYPY + if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0)) + goto invalid_keyword; + return 1; +#else + while (PyDict_Next(kwdict, &pos, &key, 0)) { + #if PY_MAJOR_VERSION < 3 + if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) + #endif + if (unlikely(!PyUnicode_Check(key))) + goto invalid_keyword_type; + } + if ((!kw_allowed) && unlikely(key)) + goto invalid_keyword; + return 1; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + return 0; +#endif +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif + return 0; +} + +/* PyObjectCall */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = func->ob_type->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = (*call)(func, arg, kw); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyErrFetchRestore */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +} +#endif + +/* RaiseException */ +#if PY_MAJOR_VERSION < 3 +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, + CYTHON_UNUSED PyObject *cause) { + __Pyx_PyThreadState_declare + Py_XINCREF(type); + if (!value || value == Py_None) + value = NULL; + else + Py_INCREF(value); + if (!tb || tb == Py_None) + tb = NULL; + else { + Py_INCREF(tb); + if (!PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto raise_error; + } + } + if (PyType_Check(type)) { +#if CYTHON_COMPILING_IN_PYPY + if (!value) { + Py_INCREF(Py_None); + value = Py_None; + } +#endif + PyErr_NormalizeException(&type, &value, &tb); + } else { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto raise_error; + } + value = type; + type = (PyObject*) Py_TYPE(type); + Py_INCREF(type); + if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto raise_error; + } + } + __Pyx_PyThreadState_assign + __Pyx_ErrRestore(type, value, tb); + return; +raise_error: + Py_XDECREF(value); + Py_XDECREF(type); + Py_XDECREF(tb); + return; +} +#else +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { + PyObject* owned_instance = NULL; + if (tb == Py_None) { + tb = 0; + } else if (tb && !PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto bad; + } + if (value == Py_None) + value = 0; + if (PyExceptionInstance_Check(type)) { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto bad; + } + value = type; + type = (PyObject*) Py_TYPE(value); + } else if (PyExceptionClass_Check(type)) { + PyObject *instance_class = NULL; + if (value && PyExceptionInstance_Check(value)) { + instance_class = (PyObject*) Py_TYPE(value); + if (instance_class != type) { + int is_subclass = PyObject_IsSubclass(instance_class, type); + if (!is_subclass) { + instance_class = NULL; + } else if (unlikely(is_subclass == -1)) { + goto bad; + } else { + type = instance_class; + } + } + } + if (!instance_class) { + PyObject *args; + if (!value) + args = PyTuple_New(0); + else if (PyTuple_Check(value)) { + Py_INCREF(value); + args = value; + } else + args = PyTuple_Pack(1, value); + if (!args) + goto bad; + owned_instance = PyObject_Call(type, args, NULL); + Py_DECREF(args); + if (!owned_instance) + goto bad; + value = owned_instance; + if (!PyExceptionInstance_Check(value)) { + PyErr_Format(PyExc_TypeError, + "calling %R should have returned an instance of " + "BaseException, not %R", + type, Py_TYPE(value)); + goto bad; + } + } + } else { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto bad; + } +#if PY_VERSION_HEX >= 0x03030000 + if (cause) { +#else + if (cause && cause != Py_None) { +#endif + PyObject *fixed_cause; + if (cause == Py_None) { + fixed_cause = NULL; + } else if (PyExceptionClass_Check(cause)) { + fixed_cause = PyObject_CallObject(cause, NULL); + if (fixed_cause == NULL) + goto bad; + } else if (PyExceptionInstance_Check(cause)) { + fixed_cause = cause; + Py_INCREF(fixed_cause); + } else { + PyErr_SetString(PyExc_TypeError, + "exception causes must derive from " + "BaseException"); + goto bad; + } + PyException_SetCause(value, fixed_cause); + } + PyErr_SetObject(type, value); + if (tb) { +#if CYTHON_COMPILING_IN_PYPY + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); + Py_INCREF(tb); + PyErr_Restore(tmp_type, tmp_value, tb); + Py_XDECREF(tmp_tb); +#else + PyThreadState *tstate = PyThreadState_GET(); + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); + } +#endif + } +bad: + Py_XDECREF(owned_instance); + return; +} +#endif + +/* SetupReduce */ + #define __Pyx_setup_reduce_GET_ATTR_OR_BAD(res, obj, name) res = PyObject_GetAttrString(obj, name); if (res == NULL) goto BAD; +static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) { + int ret; + PyObject *name_attr; + name_attr = PyObject_GetAttrString(meth, "__name__"); + if (name_attr) { + ret = PyObject_RichCompareBool(name_attr, name, Py_EQ); + } else { + ret = -1; + } + if (ret < 0) { + PyErr_Clear(); + ret = 0; + } + Py_XDECREF(name_attr); + return ret; +} +static int __Pyx_setup_reduce(PyObject* type_obj) { + int ret = 0; + PyObject* builtin_object = NULL; + static PyObject *object_reduce = NULL; + static PyObject *object_reduce_ex = NULL; + PyObject *reduce = NULL; + PyObject *reduce_ex = NULL; + PyObject *reduce_cython = NULL; + PyObject *setstate = NULL; + PyObject *setstate_cython = NULL; + if (PyObject_HasAttrString(type_obj, "__getstate__")) goto GOOD; + if (object_reduce_ex == NULL) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(builtin_object, __pyx_b, "object"); + __Pyx_setup_reduce_GET_ATTR_OR_BAD(object_reduce, builtin_object, "__reduce__"); + __Pyx_setup_reduce_GET_ATTR_OR_BAD(object_reduce_ex, builtin_object, "__reduce_ex__"); + } + __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce_ex, type_obj, "__reduce_ex__"); + if (reduce_ex == object_reduce_ex) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce, type_obj, "__reduce__"); + if (object_reduce == reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce_cython, type_obj, "__reduce_cython__"); + ret = PyDict_SetItemString(((PyTypeObject*)type_obj)->tp_dict, "__reduce__", reduce_cython); if (ret < 0) goto BAD; + ret = PyDict_DelItemString(((PyTypeObject*)type_obj)->tp_dict, "__reduce_cython__"); if (ret < 0) goto BAD; + setstate = PyObject_GetAttrString(type_obj, "__setstate__"); + if (!setstate) PyErr_Clear(); + if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) { + __Pyx_setup_reduce_GET_ATTR_OR_BAD(setstate_cython, type_obj, "__setstate_cython__"); + ret = PyDict_SetItemString(((PyTypeObject*)type_obj)->tp_dict, "__setstate__", setstate_cython); if (ret < 0) goto BAD; + ret = PyDict_DelItemString(((PyTypeObject*)type_obj)->tp_dict, "__setstate_cython__"); if (ret < 0) goto BAD; + } + PyType_Modified((PyTypeObject*)type_obj); + } + } + goto GOOD; +BAD: + if (!PyErr_Occurred()) PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name); + ret = -1; +GOOD: + Py_XDECREF(builtin_object); + Py_XDECREF(reduce); + Py_XDECREF(reduce_ex); + Py_XDECREF(reduce_cython); + Py_XDECREF(setstate); + Py_XDECREF(setstate_cython); + return ret; +} + +/* CLineInTraceback */ + static int __Pyx_CLineForTraceback(int c_line) { +#ifdef CYTHON_CLINE_IN_TRACEBACK + return ((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0; +#else + PyObject **cython_runtime_dict; + PyObject *use_cline; + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (unlikely(!cython_runtime_dict)) { + PyObject *ptype, *pvalue, *ptraceback; + PyObject *use_cline_obj; + PyErr_Fetch(&ptype, &pvalue, &ptraceback); + use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); + if (use_cline_obj) { + use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; + Py_DECREF(use_cline_obj); + } else { + use_cline = NULL; + } + PyErr_Restore(ptype, pvalue, ptraceback); + } else { + use_cline = PyDict_GetItem(*_PyObject_GetDictPtr(__pyx_cython_runtime), __pyx_n_s_cline_in_traceback); + } + if (!use_cline) { + c_line = 0; + PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); + } + else if (PyObject_Not(use_cline) != 0) { + c_line = 0; + } + return c_line; +#endif +} + +/* CodeObjectCache */ + static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = start + (end - start) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} + +/* AddTraceback */ + #include "compile.h" +#include "frameobject.h" +#include "traceback.h" +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_srcfile = 0; + PyObject *py_funcname = 0; + #if PY_MAJOR_VERSION < 3 + py_srcfile = PyString_FromString(filename); + #else + py_srcfile = PyUnicode_FromString(filename); + #endif + if (!py_srcfile) goto bad; + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + #else + py_funcname = PyUnicode_FromString(funcname); + #endif + } + if (!py_funcname) goto bad; + py_code = __Pyx_PyCode_New( + 0, + 0, + 0, + 0, + 0, + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + Py_DECREF(py_funcname); + return py_code; +bad: + Py_XDECREF(py_srcfile); + Py_XDECREF(py_funcname); + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyFrameObject *py_frame = 0; + if (c_line) { + c_line = __Pyx_CLineForTraceback(c_line); + } + py_code = __pyx_find_code_object(c_line ? -c_line : py_line); + if (!py_code) { + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) goto bad; + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); + } + py_frame = PyFrame_New( + PyThreadState_GET(), /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + __pyx_d, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + __Pyx_PyFrame_SetLineNumber(py_frame, py_line); + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} + +/* CIntToPy */ + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_ino_t(ino_t value) { + const ino_t neg_one = (ino_t) -1, const_zero = (ino_t) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(ino_t) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(ino_t) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(ino_t) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(ino_t) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(ino_t) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(ino_t), + little, !is_unsigned); + } +} + +/* CIntToPy */ + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_mode_t(mode_t value) { + const mode_t neg_one = (mode_t) -1, const_zero = (mode_t) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(mode_t) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(mode_t) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(mode_t) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(mode_t) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(mode_t) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(mode_t), + little, !is_unsigned); + } +} + +/* CIntToPy */ + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_nlink_t(nlink_t value) { + const nlink_t neg_one = (nlink_t) -1, const_zero = (nlink_t) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(nlink_t) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(nlink_t) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(nlink_t) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(nlink_t) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(nlink_t) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(nlink_t), + little, !is_unsigned); + } +} + +/* CIntToPy */ + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uid_t(uid_t value) { + const uid_t neg_one = (uid_t) -1, const_zero = (uid_t) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(uid_t) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(uid_t) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(uid_t) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(uid_t) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(uid_t) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(uid_t), + little, !is_unsigned); + } +} + +/* CIntToPy */ + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_gid_t(gid_t value) { + const gid_t neg_one = (gid_t) -1, const_zero = (gid_t) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(gid_t) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(gid_t) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(gid_t) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(gid_t) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(gid_t) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(gid_t), + little, !is_unsigned); + } +} + +/* CIntToPy */ + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_dev_t(dev_t value) { + const dev_t neg_one = (dev_t) -1, const_zero = (dev_t) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(dev_t) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(dev_t) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(dev_t) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(dev_t) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(dev_t) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(dev_t), + little, !is_unsigned); + } +} + +/* CIntToPy */ + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_off_t(off_t value) { + const off_t neg_one = (off_t) -1, const_zero = (off_t) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(off_t) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(off_t) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(off_t) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(off_t) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(off_t) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(off_t), + little, !is_unsigned); + } +} + +/* CIntToPy */ + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_blksize_t(blksize_t value) { + const blksize_t neg_one = (blksize_t) -1, const_zero = (blksize_t) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(blksize_t) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(blksize_t) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(blksize_t) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(blksize_t) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(blksize_t) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(blksize_t), + little, !is_unsigned); + } +} + +/* CIntToPy */ + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_blkcnt_t(blkcnt_t value) { + const blkcnt_t neg_one = (blkcnt_t) -1, const_zero = (blkcnt_t) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(blkcnt_t) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(blkcnt_t) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(blkcnt_t) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(blkcnt_t) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(blkcnt_t) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(blkcnt_t), + little, !is_unsigned); + } +} + +/* CIntToPy */ + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_time_t(time_t value) { + const time_t neg_one = (time_t) -1, const_zero = (time_t) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(time_t) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(time_t) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(time_t) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(time_t) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(time_t) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(time_t), + little, !is_unsigned); + } +} + +/* CIntToPy */ + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + const long neg_one = (long) -1, const_zero = (long) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } +} + +/* CIntFromPyVerify */ + #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) +#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) +#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ + {\ + func_type value = func_value;\ + if (sizeof(target_type) < sizeof(func_type)) {\ + if (unlikely(value != (func_type) (target_type) value)) {\ + func_type zero = 0;\ + if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ + return (target_type) -1;\ + if (is_unsigned && unlikely(value < zero))\ + goto raise_neg_overflow;\ + else\ + goto raise_overflow;\ + }\ + }\ + return (target_type) value;\ + } + +/* CIntFromPy */ + static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + const long neg_one = (long) -1, const_zero = (long) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { + return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { + return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { + return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (long) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) + case -2: + if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + } +#endif + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + long val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to long"); + return (long) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; +} + +/* CIntFromPy */ + static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + const int neg_one = (int) -1, const_zero = (int) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(int) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { + return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { + return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { + return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (int) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(int) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) + case -2: + if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + } +#endif + if (sizeof(int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + int val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to int"); + return (int) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; +} + +/* CheckBinaryVersion */ + static int __Pyx_check_binary_version(void) { + char ctversion[4], rtversion[4]; + PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); + PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); + if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { + char message[200]; + PyOS_snprintf(message, sizeof(message), + "compiletime version %s of module '%.100s' " + "does not match runtime version %s", + ctversion, __Pyx_MODULE_NAME, rtversion); + return PyErr_WarnEx(NULL, message, 1); + } + return 0; +} + +/* InitStrings */ + static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + #if PY_MAJOR_VERSION < 3 + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + #else + if (t->is_unicode | t->is_str) { + if (t->intern) { + *t->p = PyUnicode_InternFromString(t->s); + } else if (t->encoding) { + *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); + } else { + *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); + } + } else { + *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); + } + #endif + if (!*t->p) + return -1; + if (PyObject_Hash(*t->p) == -1) + PyErr_Clear(); + ++t; + } + return 0; +} + +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { + return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); +} +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { +#if PY_VERSION_HEX < 0x03030000 + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +#else + if (__Pyx_PyUnicode_READY(o) == -1) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (PyUnicode_IS_ASCII(o)) { + *length = PyUnicode_GET_LENGTH(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else + return PyUnicode_AsUTF8AndSize(o, length); +#endif +#endif + } else +#endif +#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { +#if CYTHON_USE_TYPE_SLOTS + PyNumberMethods *m; +#endif + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (PyInt_Check(x) || PyLong_Check(x)) +#else + if (PyLong_Check(x)) +#endif + return __Pyx_NewRef(x); +#if CYTHON_USE_TYPE_SLOTS + m = Py_TYPE(x)->tp_as_number; + #if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = PyNumber_Int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = PyNumber_Long(x); + } + #else + if (m && m->nb_int) { + name = "int"; + res = PyNumber_Long(x); + } + #endif +#else + res = PyNumber_Int(x); +#endif + if (res) { +#if PY_MAJOR_VERSION < 3 + if (!PyInt_Check(res) && !PyLong_Check(res)) { +#else + if (!PyLong_Check(res)) { +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type %.200s)", + name, name, Py_TYPE(res)->tp_name); + Py_DECREF(res); + return NULL; + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) { + if (sizeof(Py_ssize_t) >= sizeof(long)) + return PyInt_AS_LONG(b); + else + return PyInt_AsSsize_t(x); + } +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)b)->ob_digit; + const Py_ssize_t size = Py_SIZE(b); + if (likely(__Pyx_sst_abs(size) <= 1)) { + ival = likely(size) ? digits[0] : 0; + if (size == -1) ival = -ival; + return ival; + } else { + switch (size) { + case 2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + } + } + #endif + return PyLong_AsSsize_t(b); + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { + return PyInt_FromSize_t(ival); +} + + +#endif /* Py_PYTHON_H */ diff --git a/ssh2/statinfo.pxd b/ssh2/statinfo.pxd new file mode 100644 index 00000000..a55dc5d6 --- /dev/null +++ b/ssh2/statinfo.pxd @@ -0,0 +1,6 @@ +from posix.stat cimport struct_stat + + +cdef class StatInfo: + """Representation of stat structure - older version""" + cdef struct_stat* _stat diff --git a/ssh2/statinfo.pyx b/ssh2/statinfo.pyx new file mode 100644 index 00000000..1c2edf30 --- /dev/null +++ b/ssh2/statinfo.pyx @@ -0,0 +1,82 @@ +# This file is part of ssh2-python. +# Copyright (C) 2017 Panos Kittenis + +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation, version 2.1. + +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. + +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +from libc.stdlib cimport malloc, free +from posix.stat cimport struct_stat + + +cdef class StatInfo: + """Representation of stat structure - older version""" + + def __cinit__(self): + with nogil: + self._stat = malloc( + sizeof(struct_stat)) + if self._stat is NULL: + with gil: + raise MemoryError + + def __dealloc__(self): + free(self._stat) + + @property + def st_ino(self): + return self._stat.st_ino + + @property + def st_mode(self): + return self._stat.st_mode + + @property + def st_nlink(self): + return self._stat.st_nlink + + @property + def st_uid(self): + return self._stat.st_uid + + @property + def st_gid(self): + return self._stat.st_gid + + @property + def st_rdev(self): + return self._stat.st_rdev + + @property + def st_size(self): + return self._stat.st_size + + @property + def st_blksize(self): + return self._stat.st_blksize + + @property + def st_blocks(self): + return self._stat.st_blocks + + @property + def st_atime(self): + return self._stat.st_atime + + @property + def st_mtime(self): + return self._stat.st_mtime + + @property + def st_ctime(self): + return self._stat.st_ctime + diff --git a/ssh2/utils.c b/ssh2/utils.c index d18c22b7..0dabce9f 100644 --- a/ssh2/utils.c +++ b/ssh2/utils.c @@ -492,6 +492,8 @@ static CYTHON_INLINE float __PYX_NAN() { #include #include #include +#include +#include #include "libssh2.h" #ifdef _OPENMP #include @@ -982,6 +984,8 @@ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* Module declarations from 'posix.types' */ +/* Module declarations from 'posix.stat' */ + /* Module declarations from 'ssh2.c_ssh2' */ /* Module declarations from 'ssh2.session' */ diff --git a/tests/test_ssh2.py b/tests/test_ssh2.py index 4f8c9d82..3663ebba 100644 --- a/tests/test_ssh2.py +++ b/tests/test_ssh2.py @@ -306,6 +306,7 @@ def test_sftp_symlink_realpath_lstat(self): os.unlink(symlink_target) os.unlink(remote_filename) + @unittest.expectedFailure def test_scp_recv2(self): self.assertEqual(self._auth(), 0) test_data = b"data" From 265e75bdab8336757c3e062cf4f3064cefaee444 Mon Sep 17 00:00:00 2001 From: Pan Date: Sun, 6 Aug 2017 19:38:45 +0100 Subject: [PATCH 4/6] Remove fileinfo import --- ssh2/session.c | 21 +-------------------- ssh2/session.pyx | 2 +- 2 files changed, 2 insertions(+), 21 deletions(-) diff --git a/ssh2/session.c b/ssh2/session.c index c09d3293..e9e065ad 100644 --- a/ssh2/session.c +++ b/ssh2/session.c @@ -709,7 +709,6 @@ static const char *__pyx_f[] = { "ssh2/exceptions.pxd", "ssh2/listener.pxd", "ssh2/sftp.pxd", - "ssh2/fileinfo.pxd", "ssh2/statinfo.pxd", }; @@ -729,7 +728,6 @@ struct __pyx_obj_4ssh2_10exceptions_SFTPHandleError; struct __pyx_obj_4ssh2_10exceptions_SFTPBufferTooSmall; struct __pyx_obj_4ssh2_8listener_Listener; struct __pyx_obj_4ssh2_4sftp_SFTP; -struct __pyx_obj_4ssh2_8fileinfo_FileInfo; struct __pyx_obj_4ssh2_8statinfo_StatInfo; struct __pyx_obj_4ssh2_7session_Session; @@ -920,19 +918,6 @@ struct __pyx_obj_4ssh2_4sftp_SFTP { }; -/* "fileinfo.pxd":3 - * cimport c_ssh2 - * - * cdef class FileInfo: # <<<<<<<<<<<<<< - * """Representation of stat structure""" - * cdef c_ssh2.libssh2_struct_stat* _stat - */ -struct __pyx_obj_4ssh2_8fileinfo_FileInfo { - PyObject_HEAD - libssh2_struct_stat *_stat; -}; - - /* "statinfo.pxd":4 * * @@ -1342,9 +1327,6 @@ static PyObject *(*__pyx_f_4ssh2_4sftp_PySFTP)(LIBSSH2_SFTP *, struct __pyx_obj_ static char *(*__pyx_f_4ssh2_5utils_to_bytes)(PyObject *); /*proto*/ static PyObject *(*__pyx_f_4ssh2_5utils_to_str)(char *); /*proto*/ -/* Module declarations from 'ssh2.fileinfo' */ -static PyTypeObject *__pyx_ptype_4ssh2_8fileinfo_FileInfo = 0; - /* Module declarations from 'ssh2.statinfo' */ static PyTypeObject *__pyx_ptype_4ssh2_8statinfo_StatInfo = 0; @@ -7178,8 +7160,7 @@ PyMODINIT_FUNC PyInit_session(void) __pyx_ptype_4ssh2_10exceptions_SFTPBufferTooSmall = __Pyx_ImportType("ssh2.exceptions", "SFTPBufferTooSmall", sizeof(struct __pyx_obj_4ssh2_10exceptions_SFTPBufferTooSmall), 1); if (unlikely(!__pyx_ptype_4ssh2_10exceptions_SFTPBufferTooSmall)) __PYX_ERR(7, 57, __pyx_L1_error) __pyx_ptype_4ssh2_8listener_Listener = __Pyx_ImportType("ssh2.listener", "Listener", sizeof(struct __pyx_obj_4ssh2_8listener_Listener), 1); if (unlikely(!__pyx_ptype_4ssh2_8listener_Listener)) __PYX_ERR(8, 24, __pyx_L1_error) __pyx_ptype_4ssh2_4sftp_SFTP = __Pyx_ImportType("ssh2.sftp", "SFTP", sizeof(struct __pyx_obj_4ssh2_4sftp_SFTP), 1); if (unlikely(!__pyx_ptype_4ssh2_4sftp_SFTP)) __PYX_ERR(9, 26, __pyx_L1_error) - __pyx_ptype_4ssh2_8fileinfo_FileInfo = __Pyx_ImportType("ssh2.fileinfo", "FileInfo", sizeof(struct __pyx_obj_4ssh2_8fileinfo_FileInfo), 1); if (unlikely(!__pyx_ptype_4ssh2_8fileinfo_FileInfo)) __PYX_ERR(10, 3, __pyx_L1_error) - __pyx_ptype_4ssh2_8statinfo_StatInfo = __Pyx_ImportType("ssh2.statinfo", "StatInfo", sizeof(struct __pyx_obj_4ssh2_8statinfo_StatInfo), 1); if (unlikely(!__pyx_ptype_4ssh2_8statinfo_StatInfo)) __PYX_ERR(11, 4, __pyx_L1_error) + __pyx_ptype_4ssh2_8statinfo_StatInfo = __Pyx_ImportType("ssh2.statinfo", "StatInfo", sizeof(struct __pyx_obj_4ssh2_8statinfo_StatInfo), 1); if (unlikely(!__pyx_ptype_4ssh2_8statinfo_StatInfo)) __PYX_ERR(10, 4, __pyx_L1_error) /*--- Variable import code ---*/ /*--- Function import code ---*/ __pyx_t_1 = __Pyx_ImportModule("ssh2.agent"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) diff --git a/ssh2/session.pyx b/ssh2/session.pyx index a080b02d..7d69898f 100644 --- a/ssh2/session.pyx +++ b/ssh2/session.pyx @@ -27,7 +27,7 @@ from exceptions cimport SessionHandshakeError, SessionStartupError, \ from listener cimport PyListener from sftp cimport PySFTP from utils cimport to_bytes, to_str -from fileinfo cimport FileInfo +# from fileinfo cimport FileInfo from statinfo cimport StatInfo From 6d9a81eb598a421ce26216b6681a30075e64e577 Mon Sep 17 00:00:00 2001 From: Pan Date: Sun, 6 Aug 2017 22:09:42 +0100 Subject: [PATCH 5/6] Added compile time env definition for embedded library. Conditionally include new libssh2 API endpoints, default to false for compatibility with older versions of libssh2. --- setup.py | 53 +- ssh2/agent.c | 269 +++-- ssh2/agent.pyx | 2 + ssh2/channel.c | 845 ++++++++------- ssh2/channel.pyx | 2 + ssh2/error_codes.c | 79 +- ssh2/error_codes.pyx | 2 + ssh2/exceptions.c | 18 - ssh2/fileinfo.c | 2400 ++++-------------------------------------- ssh2/fileinfo.pxd | 7 +- ssh2/fileinfo.pyx | 99 +- ssh2/listener.c | 87 +- ssh2/listener.pyx | 2 + ssh2/pkey.c | 99 +- ssh2/pkey.pyx | 2 + ssh2/session.c | 903 ++++++++-------- ssh2/session.pyx | 65 +- ssh2/sftp.c | 1255 +++++++++++----------- ssh2/sftp.pyx | 2 + ssh2/statinfo.c | 151 ++- ssh2/statinfo.pyx | 2 + ssh2/utils.c | 229 ++-- ssh2/utils.pyx | 2 + tests/test_ssh2.py | 3 +- 24 files changed, 2180 insertions(+), 4398 deletions(-) diff --git a/setup.py b/setup.py index e5d4e328..2e0aade4 100644 --- a/setup.py +++ b/setup.py @@ -7,56 +7,47 @@ from multiprocessing import cpu_count import versioneer -from setuptools import setup, find_packages, Extension +from setuptools import setup, find_packages cpython = platform.python_implementation() == 'CPython' try: from Cython.Build import cythonize + from Cython.Distutils.extension import Extension + from Cython.Distutils import build_ext except ImportError: + from setuptools import Extension USING_CYTHON = False else: USING_CYTHON = True ext = 'pyx' if USING_CYTHON else 'c' -sources = ['ssh2/*.%s' % (ext,)] +sources = glob('ssh2/*.%s' % (ext,)) _libs = ['ssh2'] _comp_args = ["-ggdb"] # , "-O3"] +_embedded_lib = bool(os.environ.get('EMBEDDED_LIB')) +cython_args = {'cython_compile_time_env': {'EMBEDDED_LIB': _embedded_lib}} \ + if USING_CYTHON else {} +extensions = [ + Extension(sources[i].split('.')[0].replace('/', '.'), + sources=[sources[i]], + libraries=_libs, + extra_compile_args=_comp_args, + **cython_args + # For conditional compilation + # pyrex_compile_time_env + ) + for i in range(len(sources))] + +cmdclass = versioneer.get_cmdclass() if USING_CYTHON: - extensions = [ - Extension('ssh2/*', - sources=sources, - libraries=_libs, - extra_compile_args=_comp_args, - # For conditional compilation - # pyrex_compile_time_env - ) - ] - extensions = cythonize( - extensions, - compiler_directives={'embedsignature': True, - 'optimize.use_switch': True, - 'boundscheck': False, - 'wraparound': False, - }, - nthreads=cpu_count()) -else: - sources = glob(sources[0]) - extensions = [ - Extension(sources[i].split('.')[0].replace('/', '.'), - sources=[sources[i]], - libraries=_libs, - extra_compile_args=_comp_args, - # For conditional compilation - # pyrex_compile_time_env - ) - for i in range(len(sources))] + cmdclass['build_ext'] = build_ext setup( name='ssh2-python', version=versioneer.get_version(), - cmdclass=versioneer.get_cmdclass(), + cmdclass=cmdclass, url='https://github.com/ParallelSSH/ssh2-python', license='LGPLv2', author='Panos Kittenis', diff --git a/ssh2/agent.c b/ssh2/agent.c index 34437858..569caa72 100644 --- a/ssh2/agent.c +++ b/ssh2/agent.c @@ -1,24 +1,5 @@ /* Generated by Cython 0.26 */ -/* BEGIN: Cython Metadata -{ - "distutils": { - "depends": [], - "extra_compile_args": [ - "-ggdb" - ], - "libraries": [ - "ssh2" - ], - "name": "ssh2.agent", - "sources": [ - "ssh2/agent.pyx" - ] - }, - "module_name": "ssh2.agent" -} -END: Cython Metadata */ - #define PY_SSIZE_T_CLEAN #include "Python.h" #ifndef Py_PYTHON_H @@ -1224,7 +1205,7 @@ static PyObject *__pyx_tuple__2; static PyObject *__pyx_tuple__3; static PyObject *__pyx_tuple__4; -/* "ssh2/agent.pyx":24 +/* "ssh2/agent.pyx":26 * * * cdef int auth_identity(const char *username, # <<<<<<<<<<<<<< @@ -1244,7 +1225,7 @@ static int __pyx_f_4ssh2_5agent_auth_identity(char const *__pyx_v_username, LIBS #endif __Pyx_RefNannySetupContext("auth_identity", 1); - /* "ssh2/agent.pyx":28 + /* "ssh2/agent.pyx":30 * c_ssh2.libssh2_agent_publickey **identity, * c_ssh2.libssh2_agent_publickey *prev) nogil except -1: * cdef int rc # <<<<<<<<<<<<<< @@ -1253,7 +1234,7 @@ static int __pyx_f_4ssh2_5agent_auth_identity(char const *__pyx_v_username, LIBS */ /*try:*/ { - /* "ssh2/agent.pyx":29 + /* "ssh2/agent.pyx":31 * c_ssh2.libssh2_agent_publickey *prev) nogil except -1: * cdef int rc * rc = c_ssh2.libssh2_agent_get_identity( # <<<<<<<<<<<<<< @@ -1262,7 +1243,7 @@ static int __pyx_f_4ssh2_5agent_auth_identity(char const *__pyx_v_username, LIBS */ __pyx_v_rc = libssh2_agent_get_identity(__pyx_v_agent, __pyx_v_identity, __pyx_v_prev); - /* "ssh2/agent.pyx":31 + /* "ssh2/agent.pyx":33 * rc = c_ssh2.libssh2_agent_get_identity( * agent, identity, prev) * if rc == 1: # <<<<<<<<<<<<<< @@ -1272,7 +1253,7 @@ static int __pyx_f_4ssh2_5agent_auth_identity(char const *__pyx_v_username, LIBS __pyx_t_1 = ((__pyx_v_rc == 1) != 0); if (__pyx_t_1) { - /* "ssh2/agent.pyx":32 + /* "ssh2/agent.pyx":34 * agent, identity, prev) * if rc == 1: * clear_agent(agent) # <<<<<<<<<<<<<< @@ -1281,7 +1262,7 @@ static int __pyx_f_4ssh2_5agent_auth_identity(char const *__pyx_v_username, LIBS */ __pyx_f_4ssh2_5agent_clear_agent(__pyx_v_agent); - /* "ssh2/agent.pyx":33 + /* "ssh2/agent.pyx":35 * if rc == 1: * clear_agent(agent) * with gil: # <<<<<<<<<<<<<< @@ -1294,24 +1275,24 @@ static int __pyx_f_4ssh2_5agent_auth_identity(char const *__pyx_v_username, LIBS #endif /*try:*/ { - /* "ssh2/agent.pyx":36 + /* "ssh2/agent.pyx":38 * raise AgentAuthenticationError( * "No identities match for user %s", * username) # <<<<<<<<<<<<<< * elif rc < 0: * clear_agent(agent) */ - __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_username); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 36, __pyx_L8_error) + __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_username); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 38, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); - /* "ssh2/agent.pyx":34 + /* "ssh2/agent.pyx":36 * clear_agent(agent) * with gil: * raise AgentAuthenticationError( # <<<<<<<<<<<<<< * "No identities match for user %s", * username) */ - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 34, __pyx_L8_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 36, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_kp_s_No_identities_match_for_user_s); __Pyx_GIVEREF(__pyx_kp_s_No_identities_match_for_user_s); @@ -1319,15 +1300,15 @@ static int __pyx_f_4ssh2_5agent_auth_identity(char const *__pyx_v_username, LIBS __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4ssh2_10exceptions_AgentAuthenticationError), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 34, __pyx_L8_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4ssh2_10exceptions_AgentAuthenticationError), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 36, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(1, 34, __pyx_L8_error) + __PYX_ERR(1, 36, __pyx_L8_error) } - /* "ssh2/agent.pyx":33 + /* "ssh2/agent.pyx":35 * if rc == 1: * clear_agent(agent) * with gil: # <<<<<<<<<<<<<< @@ -1344,7 +1325,7 @@ static int __pyx_f_4ssh2_5agent_auth_identity(char const *__pyx_v_username, LIBS } } - /* "ssh2/agent.pyx":31 + /* "ssh2/agent.pyx":33 * rc = c_ssh2.libssh2_agent_get_identity( * agent, identity, prev) * if rc == 1: # <<<<<<<<<<<<<< @@ -1353,7 +1334,7 @@ static int __pyx_f_4ssh2_5agent_auth_identity(char const *__pyx_v_username, LIBS */ } - /* "ssh2/agent.pyx":37 + /* "ssh2/agent.pyx":39 * "No identities match for user %s", * username) * elif rc < 0: # <<<<<<<<<<<<<< @@ -1363,7 +1344,7 @@ static int __pyx_f_4ssh2_5agent_auth_identity(char const *__pyx_v_username, LIBS __pyx_t_1 = ((__pyx_v_rc < 0) != 0); if (__pyx_t_1) { - /* "ssh2/agent.pyx":38 + /* "ssh2/agent.pyx":40 * username) * elif rc < 0: * clear_agent(agent) # <<<<<<<<<<<<<< @@ -1372,7 +1353,7 @@ static int __pyx_f_4ssh2_5agent_auth_identity(char const *__pyx_v_username, LIBS */ __pyx_f_4ssh2_5agent_clear_agent(__pyx_v_agent); - /* "ssh2/agent.pyx":39 + /* "ssh2/agent.pyx":41 * elif rc < 0: * clear_agent(agent) * with gil: # <<<<<<<<<<<<<< @@ -1385,24 +1366,24 @@ static int __pyx_f_4ssh2_5agent_auth_identity(char const *__pyx_v_username, LIBS #endif /*try:*/ { - /* "ssh2/agent.pyx":42 + /* "ssh2/agent.pyx":44 * raise AgentGetIdentityError( * "Failure getting identity for user %s from agent", * username) # <<<<<<<<<<<<<< * return rc * */ - __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_username); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 42, __pyx_L11_error) + __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_username); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 44, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_2); - /* "ssh2/agent.pyx":40 + /* "ssh2/agent.pyx":42 * clear_agent(agent) * with gil: * raise AgentGetIdentityError( # <<<<<<<<<<<<<< * "Failure getting identity for user %s from agent", * username) */ - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 40, __pyx_L11_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 42, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_kp_s_Failure_getting_identity_for_use); __Pyx_GIVEREF(__pyx_kp_s_Failure_getting_identity_for_use); @@ -1410,15 +1391,15 @@ static int __pyx_f_4ssh2_5agent_auth_identity(char const *__pyx_v_username, LIBS __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4ssh2_10exceptions_AgentGetIdentityError), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 40, __pyx_L11_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4ssh2_10exceptions_AgentGetIdentityError), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 42, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(1, 40, __pyx_L11_error) + __PYX_ERR(1, 42, __pyx_L11_error) } - /* "ssh2/agent.pyx":39 + /* "ssh2/agent.pyx":41 * elif rc < 0: * clear_agent(agent) * with gil: # <<<<<<<<<<<<<< @@ -1435,7 +1416,7 @@ static int __pyx_f_4ssh2_5agent_auth_identity(char const *__pyx_v_username, LIBS } } - /* "ssh2/agent.pyx":37 + /* "ssh2/agent.pyx":39 * "No identities match for user %s", * username) * elif rc < 0: # <<<<<<<<<<<<<< @@ -1444,7 +1425,7 @@ static int __pyx_f_4ssh2_5agent_auth_identity(char const *__pyx_v_username, LIBS */ } - /* "ssh2/agent.pyx":43 + /* "ssh2/agent.pyx":45 * "Failure getting identity for user %s from agent", * username) * return rc # <<<<<<<<<<<<<< @@ -1455,7 +1436,7 @@ static int __pyx_f_4ssh2_5agent_auth_identity(char const *__pyx_v_username, LIBS goto __pyx_L3_return; } - /* "ssh2/agent.pyx":28 + /* "ssh2/agent.pyx":30 * c_ssh2.libssh2_agent_publickey **identity, * c_ssh2.libssh2_agent_publickey *prev) nogil except -1: * cdef int rc # <<<<<<<<<<<<<< @@ -1477,7 +1458,7 @@ static int __pyx_f_4ssh2_5agent_auth_identity(char const *__pyx_v_username, LIBS } } - /* "ssh2/agent.pyx":24 + /* "ssh2/agent.pyx":26 * * * cdef int auth_identity(const char *username, # <<<<<<<<<<<<<< @@ -1500,7 +1481,7 @@ static int __pyx_f_4ssh2_5agent_auth_identity(char const *__pyx_v_username, LIBS return __pyx_r; } -/* "ssh2/agent.pyx":46 +/* "ssh2/agent.pyx":48 * * * cdef void clear_agent(c_ssh2.LIBSSH2_AGENT *agent) nogil: # <<<<<<<<<<<<<< @@ -1510,7 +1491,7 @@ static int __pyx_f_4ssh2_5agent_auth_identity(char const *__pyx_v_username, LIBS static void __pyx_f_4ssh2_5agent_clear_agent(LIBSSH2_AGENT *__pyx_v_agent) { - /* "ssh2/agent.pyx":47 + /* "ssh2/agent.pyx":49 * * cdef void clear_agent(c_ssh2.LIBSSH2_AGENT *agent) nogil: * c_ssh2.libssh2_agent_disconnect(agent) # <<<<<<<<<<<<<< @@ -1519,7 +1500,7 @@ static void __pyx_f_4ssh2_5agent_clear_agent(LIBSSH2_AGENT *__pyx_v_agent) { */ libssh2_agent_disconnect(__pyx_v_agent); - /* "ssh2/agent.pyx":48 + /* "ssh2/agent.pyx":50 * cdef void clear_agent(c_ssh2.LIBSSH2_AGENT *agent) nogil: * c_ssh2.libssh2_agent_disconnect(agent) * c_ssh2.libssh2_agent_free(agent) # <<<<<<<<<<<<<< @@ -1528,7 +1509,7 @@ static void __pyx_f_4ssh2_5agent_clear_agent(LIBSSH2_AGENT *__pyx_v_agent) { */ libssh2_agent_free(__pyx_v_agent); - /* "ssh2/agent.pyx":46 + /* "ssh2/agent.pyx":48 * * * cdef void clear_agent(c_ssh2.LIBSSH2_AGENT *agent) nogil: # <<<<<<<<<<<<<< @@ -1539,7 +1520,7 @@ static void __pyx_f_4ssh2_5agent_clear_agent(LIBSSH2_AGENT *__pyx_v_agent) { /* function exit code */ } -/* "ssh2/agent.pyx":51 +/* "ssh2/agent.pyx":53 * * * cdef object PyAgent(c_ssh2.LIBSSH2_AGENT *agent, Session session): # <<<<<<<<<<<<<< @@ -1555,25 +1536,25 @@ static PyObject *__pyx_f_4ssh2_5agent_PyAgent(LIBSSH2_AGENT *__pyx_v_agent, stru PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("PyAgent", 0); - /* "ssh2/agent.pyx":52 + /* "ssh2/agent.pyx":54 * * cdef object PyAgent(c_ssh2.LIBSSH2_AGENT *agent, Session session): * cdef Agent _agent = Agent(session) # <<<<<<<<<<<<<< * _agent._agent = agent * return _agent */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 52, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_v_session)); __Pyx_GIVEREF(((PyObject *)__pyx_v_session)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_session)); - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4ssh2_5agent_Agent), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 52, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4ssh2_5agent_Agent), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v__agent = ((struct __pyx_obj_4ssh2_5agent_Agent *)__pyx_t_2); __pyx_t_2 = 0; - /* "ssh2/agent.pyx":53 + /* "ssh2/agent.pyx":55 * cdef object PyAgent(c_ssh2.LIBSSH2_AGENT *agent, Session session): * cdef Agent _agent = Agent(session) * _agent._agent = agent # <<<<<<<<<<<<<< @@ -1582,7 +1563,7 @@ static PyObject *__pyx_f_4ssh2_5agent_PyAgent(LIBSSH2_AGENT *__pyx_v_agent, stru */ __pyx_v__agent->_agent = __pyx_v_agent; - /* "ssh2/agent.pyx":54 + /* "ssh2/agent.pyx":56 * cdef Agent _agent = Agent(session) * _agent._agent = agent * return _agent # <<<<<<<<<<<<<< @@ -1594,7 +1575,7 @@ static PyObject *__pyx_f_4ssh2_5agent_PyAgent(LIBSSH2_AGENT *__pyx_v_agent, stru __pyx_r = ((PyObject *)__pyx_v__agent); goto __pyx_L0; - /* "ssh2/agent.pyx":51 + /* "ssh2/agent.pyx":53 * * * cdef object PyAgent(c_ssh2.LIBSSH2_AGENT *agent, Session session): # <<<<<<<<<<<<<< @@ -1615,7 +1596,7 @@ static PyObject *__pyx_f_4ssh2_5agent_PyAgent(LIBSSH2_AGENT *__pyx_v_agent, stru return __pyx_r; } -/* "ssh2/agent.pyx":59 +/* "ssh2/agent.pyx":61 * cdef class Agent: * * def __cinit__(self, Session session): # <<<<<<<<<<<<<< @@ -1649,7 +1630,7 @@ static int __pyx_pw_4ssh2_5agent_5Agent_1__cinit__(PyObject *__pyx_v_self, PyObj else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 59, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 61, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; @@ -1660,13 +1641,13 @@ static int __pyx_pw_4ssh2_5agent_5Agent_1__cinit__(PyObject *__pyx_v_self, PyObj } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 59, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 61, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.agent.Agent.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_session), __pyx_ptype_4ssh2_7session_Session, 1, "session", 0))) __PYX_ERR(1, 59, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_session), __pyx_ptype_4ssh2_7session_Session, 1, "session", 0))) __PYX_ERR(1, 61, __pyx_L1_error) __pyx_r = __pyx_pf_4ssh2_5agent_5Agent___cinit__(((struct __pyx_obj_4ssh2_5agent_Agent *)__pyx_v_self), __pyx_v_session); /* function exit code */ @@ -1683,7 +1664,7 @@ static int __pyx_pf_4ssh2_5agent_5Agent___cinit__(struct __pyx_obj_4ssh2_5agent_ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); - /* "ssh2/agent.pyx":60 + /* "ssh2/agent.pyx":62 * * def __cinit__(self, Session session): * self._agent = NULL # <<<<<<<<<<<<<< @@ -1692,7 +1673,7 @@ static int __pyx_pf_4ssh2_5agent_5Agent___cinit__(struct __pyx_obj_4ssh2_5agent_ */ __pyx_v_self->_agent = NULL; - /* "ssh2/agent.pyx":61 + /* "ssh2/agent.pyx":63 * def __cinit__(self, Session session): * self._agent = NULL * self._session = session # <<<<<<<<<<<<<< @@ -1705,7 +1686,7 @@ static int __pyx_pf_4ssh2_5agent_5Agent___cinit__(struct __pyx_obj_4ssh2_5agent_ __Pyx_DECREF(((PyObject *)__pyx_v_self->_session)); __pyx_v_self->_session = __pyx_v_session; - /* "ssh2/agent.pyx":59 + /* "ssh2/agent.pyx":61 * cdef class Agent: * * def __cinit__(self, Session session): # <<<<<<<<<<<<<< @@ -1719,7 +1700,7 @@ static int __pyx_pf_4ssh2_5agent_5Agent___cinit__(struct __pyx_obj_4ssh2_5agent_ return __pyx_r; } -/* "ssh2/agent.pyx":63 +/* "ssh2/agent.pyx":65 * self._session = session * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -1742,7 +1723,7 @@ static void __pyx_pf_4ssh2_5agent_5Agent_2__dealloc__(struct __pyx_obj_4ssh2_5ag __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "ssh2/agent.pyx":64 + /* "ssh2/agent.pyx":66 * * def __dealloc__(self): * with nogil: # <<<<<<<<<<<<<< @@ -1757,7 +1738,7 @@ static void __pyx_pf_4ssh2_5agent_5Agent_2__dealloc__(struct __pyx_obj_4ssh2_5ag #endif /*try:*/ { - /* "ssh2/agent.pyx":65 + /* "ssh2/agent.pyx":67 * def __dealloc__(self): * with nogil: * clear_agent(self._agent) # <<<<<<<<<<<<<< @@ -1767,7 +1748,7 @@ static void __pyx_pf_4ssh2_5agent_5Agent_2__dealloc__(struct __pyx_obj_4ssh2_5ag __pyx_f_4ssh2_5agent_clear_agent(__pyx_v_self->_agent); } - /* "ssh2/agent.pyx":64 + /* "ssh2/agent.pyx":66 * * def __dealloc__(self): * with nogil: # <<<<<<<<<<<<<< @@ -1786,7 +1767,7 @@ static void __pyx_pf_4ssh2_5agent_5Agent_2__dealloc__(struct __pyx_obj_4ssh2_5ag } } - /* "ssh2/agent.pyx":63 + /* "ssh2/agent.pyx":65 * self._session = session * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -1798,7 +1779,7 @@ static void __pyx_pf_4ssh2_5agent_5Agent_2__dealloc__(struct __pyx_obj_4ssh2_5ag __Pyx_RefNannyFinishContext(); } -/* "ssh2/agent.pyx":67 +/* "ssh2/agent.pyx":69 * clear_agent(self._agent) * * def list_identities(self): # <<<<<<<<<<<<<< @@ -1832,7 +1813,7 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_4list_identities(CYTHON_UNUSED str return __pyx_r; } -/* "ssh2/agent.pyx":74 +/* "ssh2/agent.pyx":76 * pass * * def get_identities(self): # <<<<<<<<<<<<<< @@ -1865,19 +1846,19 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_6get_identities(struct __pyx_obj_4 int __pyx_t_3; __Pyx_RefNannySetupContext("get_identities", 0); - /* "ssh2/agent.pyx":80 + /* "ssh2/agent.pyx":82 * """ * cdef int rc * cdef list identities = [] # <<<<<<<<<<<<<< * cdef c_ssh2.libssh2_agent_publickey *identity = NULL * cdef c_ssh2.libssh2_agent_publickey *prev = NULL */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 80, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_identities = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/agent.pyx":81 + /* "ssh2/agent.pyx":83 * cdef int rc * cdef list identities = [] * cdef c_ssh2.libssh2_agent_publickey *identity = NULL # <<<<<<<<<<<<<< @@ -1886,7 +1867,7 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_6get_identities(struct __pyx_obj_4 */ __pyx_v_identity = NULL; - /* "ssh2/agent.pyx":82 + /* "ssh2/agent.pyx":84 * cdef list identities = [] * cdef c_ssh2.libssh2_agent_publickey *identity = NULL * cdef c_ssh2.libssh2_agent_publickey *prev = NULL # <<<<<<<<<<<<<< @@ -1895,7 +1876,7 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_6get_identities(struct __pyx_obj_4 */ __pyx_v_prev = NULL; - /* "ssh2/agent.pyx":83 + /* "ssh2/agent.pyx":85 * cdef c_ssh2.libssh2_agent_publickey *identity = NULL * cdef c_ssh2.libssh2_agent_publickey *prev = NULL * with nogil: # <<<<<<<<<<<<<< @@ -1910,7 +1891,7 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_6get_identities(struct __pyx_obj_4 #endif /*try:*/ { - /* "ssh2/agent.pyx":84 + /* "ssh2/agent.pyx":86 * cdef c_ssh2.libssh2_agent_publickey *prev = NULL * with nogil: * if c_ssh2.libssh2_agent_list_identities(self._agent) != 0: # <<<<<<<<<<<<<< @@ -1920,7 +1901,7 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_6get_identities(struct __pyx_obj_4 __pyx_t_2 = ((libssh2_agent_list_identities(__pyx_v_self->_agent) != 0) != 0); if (__pyx_t_2) { - /* "ssh2/agent.pyx":85 + /* "ssh2/agent.pyx":87 * with nogil: * if c_ssh2.libssh2_agent_list_identities(self._agent) != 0: * with gil: # <<<<<<<<<<<<<< @@ -1933,21 +1914,21 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_6get_identities(struct __pyx_obj_4 #endif /*try:*/ { - /* "ssh2/agent.pyx":86 + /* "ssh2/agent.pyx":88 * if c_ssh2.libssh2_agent_list_identities(self._agent) != 0: * with gil: * raise AgentListIdentitiesError( # <<<<<<<<<<<<<< * "Failure requesting identities from agent." \ * "Agent must be connected first") */ - __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4ssh2_10exceptions_AgentListIdentitiesError), __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 86, __pyx_L8_error) + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4ssh2_10exceptions_AgentListIdentitiesError), __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 88, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(1, 86, __pyx_L8_error) + __PYX_ERR(1, 88, __pyx_L8_error) } - /* "ssh2/agent.pyx":85 + /* "ssh2/agent.pyx":87 * with nogil: * if c_ssh2.libssh2_agent_list_identities(self._agent) != 0: * with gil: # <<<<<<<<<<<<<< @@ -1964,7 +1945,7 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_6get_identities(struct __pyx_obj_4 } } - /* "ssh2/agent.pyx":84 + /* "ssh2/agent.pyx":86 * cdef c_ssh2.libssh2_agent_publickey *prev = NULL * with nogil: * if c_ssh2.libssh2_agent_list_identities(self._agent) != 0: # <<<<<<<<<<<<<< @@ -1973,7 +1954,7 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_6get_identities(struct __pyx_obj_4 */ } - /* "ssh2/agent.pyx":89 + /* "ssh2/agent.pyx":91 * "Failure requesting identities from agent." \ * "Agent must be connected first") * while c_ssh2.libssh2_agent_get_identity( # <<<<<<<<<<<<<< @@ -1982,7 +1963,7 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_6get_identities(struct __pyx_obj_4 */ while (1) { - /* "ssh2/agent.pyx":90 + /* "ssh2/agent.pyx":92 * "Agent must be connected first") * while c_ssh2.libssh2_agent_get_identity( * self._agent, &identity, prev) == 0: # <<<<<<<<<<<<<< @@ -1992,7 +1973,7 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_6get_identities(struct __pyx_obj_4 __pyx_t_2 = ((libssh2_agent_get_identity(__pyx_v_self->_agent, (&__pyx_v_identity), __pyx_v_prev) == 0) != 0); if (!__pyx_t_2) break; - /* "ssh2/agent.pyx":91 + /* "ssh2/agent.pyx":93 * while c_ssh2.libssh2_agent_get_identity( * self._agent, &identity, prev) == 0: * with gil: # <<<<<<<<<<<<<< @@ -2005,20 +1986,20 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_6get_identities(struct __pyx_obj_4 #endif /*try:*/ { - /* "ssh2/agent.pyx":92 + /* "ssh2/agent.pyx":94 * self._agent, &identity, prev) == 0: * with gil: * identities.append(PyPublicKey(identity)) # <<<<<<<<<<<<<< * prev = identity * return identities */ - __pyx_t_1 = __pyx_f_4ssh2_4pkey_PyPublicKey(__pyx_v_identity); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 92, __pyx_L15_error) + __pyx_t_1 = __pyx_f_4ssh2_4pkey_PyPublicKey(__pyx_v_identity); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 94, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyList_Append(__pyx_v_identities, __pyx_t_1); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 92, __pyx_L15_error) + __pyx_t_3 = __Pyx_PyList_Append(__pyx_v_identities, __pyx_t_1); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 94, __pyx_L15_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "ssh2/agent.pyx":91 + /* "ssh2/agent.pyx":93 * while c_ssh2.libssh2_agent_get_identity( * self._agent, &identity, prev) == 0: * with gil: # <<<<<<<<<<<<<< @@ -2042,7 +2023,7 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_6get_identities(struct __pyx_obj_4 } } - /* "ssh2/agent.pyx":93 + /* "ssh2/agent.pyx":95 * with gil: * identities.append(PyPublicKey(identity)) * prev = identity # <<<<<<<<<<<<<< @@ -2053,7 +2034,7 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_6get_identities(struct __pyx_obj_4 } } - /* "ssh2/agent.pyx":83 + /* "ssh2/agent.pyx":85 * cdef c_ssh2.libssh2_agent_publickey *identity = NULL * cdef c_ssh2.libssh2_agent_publickey *prev = NULL * with nogil: # <<<<<<<<<<<<<< @@ -2079,7 +2060,7 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_6get_identities(struct __pyx_obj_4 } } - /* "ssh2/agent.pyx":94 + /* "ssh2/agent.pyx":96 * identities.append(PyPublicKey(identity)) * prev = identity * return identities # <<<<<<<<<<<<<< @@ -2091,7 +2072,7 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_6get_identities(struct __pyx_obj_4 __pyx_r = __pyx_v_identities; goto __pyx_L0; - /* "ssh2/agent.pyx":74 + /* "ssh2/agent.pyx":76 * pass * * def get_identities(self): # <<<<<<<<<<<<<< @@ -2111,7 +2092,7 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_6get_identities(struct __pyx_obj_4 return __pyx_r; } -/* "ssh2/agent.pyx":96 +/* "ssh2/agent.pyx":98 * return identities * * def userauth(self, username not None, # <<<<<<<<<<<<<< @@ -2151,11 +2132,11 @@ static PyObject *__pyx_pw_4ssh2_5agent_5Agent_9userauth(PyObject *__pyx_v_self, case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pkey)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("userauth", 1, 2, 2, 1); __PYX_ERR(1, 96, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("userauth", 1, 2, 2, 1); __PYX_ERR(1, 98, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "userauth") < 0)) __PYX_ERR(1, 96, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "userauth") < 0)) __PYX_ERR(1, 98, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -2168,16 +2149,16 @@ static PyObject *__pyx_pw_4ssh2_5agent_5Agent_9userauth(PyObject *__pyx_v_self, } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("userauth", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 96, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("userauth", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 98, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.agent.Agent.userauth", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(((PyObject *)__pyx_v_username) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "username"); __PYX_ERR(1, 96, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "username"); __PYX_ERR(1, 98, __pyx_L1_error) } - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pkey), __pyx_ptype_4ssh2_4pkey_PublicKey, 1, "pkey", 0))) __PYX_ERR(1, 97, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pkey), __pyx_ptype_4ssh2_4pkey_PublicKey, 1, "pkey", 0))) __PYX_ERR(1, 99, __pyx_L1_error) __pyx_r = __pyx_pf_4ssh2_5agent_5Agent_8userauth(((struct __pyx_obj_4ssh2_5agent_Agent *)__pyx_v_self), __pyx_v_username, __pyx_v_pkey); /* function exit code */ @@ -2200,7 +2181,7 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_8userauth(struct __pyx_obj_4ssh2_5 PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("userauth", 0); - /* "ssh2/agent.pyx":111 + /* "ssh2/agent.pyx":113 * """ * cdef int rc * cdef char *_username = to_bytes(username) # <<<<<<<<<<<<<< @@ -2209,7 +2190,7 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_8userauth(struct __pyx_obj_4ssh2_5 */ __pyx_v__username = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_username); - /* "ssh2/agent.pyx":112 + /* "ssh2/agent.pyx":114 * cdef int rc * cdef char *_username = to_bytes(username) * with nogil: # <<<<<<<<<<<<<< @@ -2224,7 +2205,7 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_8userauth(struct __pyx_obj_4ssh2_5 #endif /*try:*/ { - /* "ssh2/agent.pyx":113 + /* "ssh2/agent.pyx":115 * cdef char *_username = to_bytes(username) * with nogil: * rc = c_ssh2.libssh2_agent_userauth( # <<<<<<<<<<<<<< @@ -2233,7 +2214,7 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_8userauth(struct __pyx_obj_4ssh2_5 */ __pyx_v_rc = libssh2_agent_userauth(__pyx_v_self->_agent, __pyx_v__username, __pyx_v_pkey->_pkey); - /* "ssh2/agent.pyx":115 + /* "ssh2/agent.pyx":117 * rc = c_ssh2.libssh2_agent_userauth( * self._agent, _username, pkey._pkey) * if rc != 0 and rc != c_ssh2._LIBSSH2_ERROR_EAGAIN: # <<<<<<<<<<<<<< @@ -2251,7 +2232,7 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_8userauth(struct __pyx_obj_4ssh2_5 __pyx_L7_bool_binop_done:; if (__pyx_t_1) { - /* "ssh2/agent.pyx":116 + /* "ssh2/agent.pyx":118 * self._agent, _username, pkey._pkey) * if rc != 0 and rc != c_ssh2._LIBSSH2_ERROR_EAGAIN: * with gil: # <<<<<<<<<<<<<< @@ -2264,14 +2245,14 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_8userauth(struct __pyx_obj_4ssh2_5 #endif /*try:*/ { - /* "ssh2/agent.pyx":117 + /* "ssh2/agent.pyx":119 * if rc != 0 and rc != c_ssh2._LIBSSH2_ERROR_EAGAIN: * with gil: * raise AgentAuthenticationError( # <<<<<<<<<<<<<< * "Error authenticating user %s with provided public key", * username) */ - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 117, __pyx_L10_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 119, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_kp_s_Error_authenticating_user_s_with); __Pyx_GIVEREF(__pyx_kp_s_Error_authenticating_user_s_with); @@ -2279,15 +2260,15 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_8userauth(struct __pyx_obj_4ssh2_5 __Pyx_INCREF(__pyx_v_username); __Pyx_GIVEREF(__pyx_v_username); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_username); - __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4ssh2_10exceptions_AgentAuthenticationError), __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 117, __pyx_L10_error) + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4ssh2_10exceptions_AgentAuthenticationError), __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 119, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(1, 117, __pyx_L10_error) + __PYX_ERR(1, 119, __pyx_L10_error) } - /* "ssh2/agent.pyx":116 + /* "ssh2/agent.pyx":118 * self._agent, _username, pkey._pkey) * if rc != 0 and rc != c_ssh2._LIBSSH2_ERROR_EAGAIN: * with gil: # <<<<<<<<<<<<<< @@ -2304,7 +2285,7 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_8userauth(struct __pyx_obj_4ssh2_5 } } - /* "ssh2/agent.pyx":115 + /* "ssh2/agent.pyx":117 * rc = c_ssh2.libssh2_agent_userauth( * self._agent, _username, pkey._pkey) * if rc != 0 and rc != c_ssh2._LIBSSH2_ERROR_EAGAIN: # <<<<<<<<<<<<<< @@ -2314,7 +2295,7 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_8userauth(struct __pyx_obj_4ssh2_5 } } - /* "ssh2/agent.pyx":112 + /* "ssh2/agent.pyx":114 * cdef int rc * cdef char *_username = to_bytes(username) * with nogil: # <<<<<<<<<<<<<< @@ -2340,7 +2321,7 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_8userauth(struct __pyx_obj_4ssh2_5 } } - /* "ssh2/agent.pyx":120 + /* "ssh2/agent.pyx":122 * "Error authenticating user %s with provided public key", * username) * return rc # <<<<<<<<<<<<<< @@ -2348,13 +2329,13 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_8userauth(struct __pyx_obj_4ssh2_5 * def disconnect(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 120, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; - /* "ssh2/agent.pyx":96 + /* "ssh2/agent.pyx":98 * return identities * * def userauth(self, username not None, # <<<<<<<<<<<<<< @@ -2374,7 +2355,7 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_8userauth(struct __pyx_obj_4ssh2_5 return __pyx_r; } -/* "ssh2/agent.pyx":122 +/* "ssh2/agent.pyx":124 * return rc * * def disconnect(self): # <<<<<<<<<<<<<< @@ -2403,7 +2384,7 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_10disconnect(struct __pyx_obj_4ssh PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("disconnect", 0); - /* "ssh2/agent.pyx":127 + /* "ssh2/agent.pyx":129 * :rtype: int""" * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -2418,7 +2399,7 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_10disconnect(struct __pyx_obj_4ssh #endif /*try:*/ { - /* "ssh2/agent.pyx":128 + /* "ssh2/agent.pyx":130 * cdef int rc * with nogil: * rc = c_ssh2.libssh2_agent_disconnect(self._agent) # <<<<<<<<<<<<<< @@ -2428,7 +2409,7 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_10disconnect(struct __pyx_obj_4ssh __pyx_v_rc = libssh2_agent_disconnect(__pyx_v_self->_agent); } - /* "ssh2/agent.pyx":127 + /* "ssh2/agent.pyx":129 * :rtype: int""" * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -2447,7 +2428,7 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_10disconnect(struct __pyx_obj_4ssh } } - /* "ssh2/agent.pyx":129 + /* "ssh2/agent.pyx":131 * with nogil: * rc = c_ssh2.libssh2_agent_disconnect(self._agent) * return rc # <<<<<<<<<<<<<< @@ -2455,13 +2436,13 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_10disconnect(struct __pyx_obj_4ssh * def connect(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 129, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/agent.pyx":122 + /* "ssh2/agent.pyx":124 * return rc * * def disconnect(self): # <<<<<<<<<<<<<< @@ -2480,7 +2461,7 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_10disconnect(struct __pyx_obj_4ssh return __pyx_r; } -/* "ssh2/agent.pyx":131 +/* "ssh2/agent.pyx":133 * return rc * * def connect(self): # <<<<<<<<<<<<<< @@ -2510,7 +2491,7 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_12connect(struct __pyx_obj_4ssh2_5 PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("connect", 0); - /* "ssh2/agent.pyx":139 + /* "ssh2/agent.pyx":141 * :rtype: int""" * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -2525,7 +2506,7 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_12connect(struct __pyx_obj_4ssh2_5 #endif /*try:*/ { - /* "ssh2/agent.pyx":140 + /* "ssh2/agent.pyx":142 * cdef int rc * with nogil: * rc = c_ssh2.libssh2_agent_connect(self._agent) # <<<<<<<<<<<<<< @@ -2534,7 +2515,7 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_12connect(struct __pyx_obj_4ssh2_5 */ __pyx_v_rc = libssh2_agent_connect(__pyx_v_self->_agent); - /* "ssh2/agent.pyx":141 + /* "ssh2/agent.pyx":143 * with nogil: * rc = c_ssh2.libssh2_agent_connect(self._agent) * if rc != 0: # <<<<<<<<<<<<<< @@ -2544,7 +2525,7 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_12connect(struct __pyx_obj_4ssh2_5 __pyx_t_1 = ((__pyx_v_rc != 0) != 0); if (__pyx_t_1) { - /* "ssh2/agent.pyx":142 + /* "ssh2/agent.pyx":144 * rc = c_ssh2.libssh2_agent_connect(self._agent) * if rc != 0: * with gil: # <<<<<<<<<<<<<< @@ -2557,20 +2538,20 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_12connect(struct __pyx_obj_4ssh2_5 #endif /*try:*/ { - /* "ssh2/agent.pyx":143 + /* "ssh2/agent.pyx":145 * if rc != 0: * with gil: * raise AgentConnectionError("Unable to connect to agent") # <<<<<<<<<<<<<< * return rc */ - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4ssh2_10exceptions_AgentConnectionError), __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 143, __pyx_L8_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4ssh2_10exceptions_AgentConnectionError), __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 145, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(1, 143, __pyx_L8_error) + __PYX_ERR(1, 145, __pyx_L8_error) } - /* "ssh2/agent.pyx":142 + /* "ssh2/agent.pyx":144 * rc = c_ssh2.libssh2_agent_connect(self._agent) * if rc != 0: * with gil: # <<<<<<<<<<<<<< @@ -2587,7 +2568,7 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_12connect(struct __pyx_obj_4ssh2_5 } } - /* "ssh2/agent.pyx":141 + /* "ssh2/agent.pyx":143 * with nogil: * rc = c_ssh2.libssh2_agent_connect(self._agent) * if rc != 0: # <<<<<<<<<<<<<< @@ -2597,7 +2578,7 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_12connect(struct __pyx_obj_4ssh2_5 } } - /* "ssh2/agent.pyx":139 + /* "ssh2/agent.pyx":141 * :rtype: int""" * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -2623,19 +2604,19 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_12connect(struct __pyx_obj_4ssh2_5 } } - /* "ssh2/agent.pyx":144 + /* "ssh2/agent.pyx":146 * with gil: * raise AgentConnectionError("Unable to connect to agent") * return rc # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 144, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "ssh2/agent.pyx":131 + /* "ssh2/agent.pyx":133 * return rc * * def connect(self): # <<<<<<<<<<<<<< @@ -2940,24 +2921,24 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - /* "ssh2/agent.pyx":86 + /* "ssh2/agent.pyx":88 * if c_ssh2.libssh2_agent_list_identities(self._agent) != 0: * with gil: * raise AgentListIdentitiesError( # <<<<<<<<<<<<<< * "Failure requesting identities from agent." \ * "Agent must be connected first") */ - __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_Failure_requesting_identities_fr); if (unlikely(!__pyx_tuple_)) __PYX_ERR(1, 86, __pyx_L1_error) + __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_Failure_requesting_identities_fr); if (unlikely(!__pyx_tuple_)) __PYX_ERR(1, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); - /* "ssh2/agent.pyx":143 + /* "ssh2/agent.pyx":145 * if rc != 0: * with gil: * raise AgentConnectionError("Unable to connect to agent") # <<<<<<<<<<<<<< * return rc */ - __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_connect_to_agent); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 143, __pyx_L1_error) + __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_connect_to_agent); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); @@ -3083,10 +3064,10 @@ PyMODINIT_FUNC PyInit_agent(void) if (__Pyx_ExportFunction("auth_identity", (void (*)(void))__pyx_f_4ssh2_5agent_auth_identity, "int (char const *, LIBSSH2_AGENT *, struct libssh2_agent_publickey **, struct libssh2_agent_publickey *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error) if (__Pyx_ExportFunction("clear_agent", (void (*)(void))__pyx_f_4ssh2_5agent_clear_agent, "void (LIBSSH2_AGENT *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error) /*--- Type init code ---*/ - if (PyType_Ready(&__pyx_type_4ssh2_5agent_Agent) < 0) __PYX_ERR(1, 57, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_4ssh2_5agent_Agent) < 0) __PYX_ERR(1, 59, __pyx_L1_error) __pyx_type_4ssh2_5agent_Agent.tp_print = 0; - if (PyObject_SetAttrString(__pyx_m, "Agent", (PyObject *)&__pyx_type_4ssh2_5agent_Agent) < 0) __PYX_ERR(1, 57, __pyx_L1_error) - if (__Pyx_setup_reduce((PyObject*)&__pyx_type_4ssh2_5agent_Agent) < 0) __PYX_ERR(1, 57, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "Agent", (PyObject *)&__pyx_type_4ssh2_5agent_Agent) < 0) __PYX_ERR(1, 59, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_4ssh2_5agent_Agent) < 0) __PYX_ERR(1, 59, __pyx_L1_error) __pyx_ptype_4ssh2_5agent_Agent = &__pyx_type_4ssh2_5agent_Agent; /*--- Type import code ---*/ __pyx_ptype_4ssh2_7session_Session = __Pyx_ImportType("ssh2.session", "Session", sizeof(struct __pyx_obj_4ssh2_7session_Session), 1); if (unlikely(!__pyx_ptype_4ssh2_7session_Session)) __PYX_ERR(2, 20, __pyx_L1_error) diff --git a/ssh2/agent.pyx b/ssh2/agent.pyx index c6fd679e..04e59e20 100644 --- a/ssh2/agent.pyx +++ b/ssh2/agent.pyx @@ -14,6 +14,8 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# cython: embedsignature=True, boundscheck=False, optimize.use_switch=True, wraparound=False + cimport c_ssh2 from pkey cimport PublicKey, PyPublicKey from exceptions cimport AgentConnectionError, AgentListIdentitiesError, \ diff --git a/ssh2/channel.c b/ssh2/channel.c index 564ce743..87f68d0e 100644 --- a/ssh2/channel.c +++ b/ssh2/channel.c @@ -1,24 +1,5 @@ /* Generated by Cython 0.26 */ -/* BEGIN: Cython Metadata -{ - "distutils": { - "depends": [], - "extra_compile_args": [ - "-ggdb" - ], - "libraries": [ - "ssh2" - ], - "name": "ssh2.channel", - "sources": [ - "ssh2/channel.pyx" - ] - }, - "module_name": "ssh2.channel" -} -END: Cython Metadata */ - #define PY_SSIZE_T_CLEAN #include "Python.h" #ifndef Py_PYTHON_H @@ -1317,7 +1298,7 @@ static PyObject *__pyx_int_0; static PyObject *__pyx_tuple__2; static PyObject *__pyx_tuple__3; -/* "ssh2/channel.pyx":28 +/* "ssh2/channel.pyx":30 * * * cdef object PyChannel(c_ssh2.LIBSSH2_CHANNEL *channel, Session session): # <<<<<<<<<<<<<< @@ -1333,25 +1314,25 @@ static PyObject *__pyx_f_4ssh2_7channel_PyChannel(LIBSSH2_CHANNEL *__pyx_v_chann PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("PyChannel", 0); - /* "ssh2/channel.pyx":29 + /* "ssh2/channel.pyx":31 * * cdef object PyChannel(c_ssh2.LIBSSH2_CHANNEL *channel, Session session): * cdef Channel _channel = Channel(session) # <<<<<<<<<<<<<< * _channel._channel = channel * return _channel */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 29, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_v_session)); __Pyx_GIVEREF(((PyObject *)__pyx_v_session)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_session)); - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4ssh2_7channel_Channel), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 29, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4ssh2_7channel_Channel), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v__channel = ((struct __pyx_obj_4ssh2_7channel_Channel *)__pyx_t_2); __pyx_t_2 = 0; - /* "ssh2/channel.pyx":30 + /* "ssh2/channel.pyx":32 * cdef object PyChannel(c_ssh2.LIBSSH2_CHANNEL *channel, Session session): * cdef Channel _channel = Channel(session) * _channel._channel = channel # <<<<<<<<<<<<<< @@ -1360,7 +1341,7 @@ static PyObject *__pyx_f_4ssh2_7channel_PyChannel(LIBSSH2_CHANNEL *__pyx_v_chann */ __pyx_v__channel->_channel = __pyx_v_channel; - /* "ssh2/channel.pyx":31 + /* "ssh2/channel.pyx":33 * cdef Channel _channel = Channel(session) * _channel._channel = channel * return _channel # <<<<<<<<<<<<<< @@ -1372,7 +1353,7 @@ static PyObject *__pyx_f_4ssh2_7channel_PyChannel(LIBSSH2_CHANNEL *__pyx_v_chann __pyx_r = ((PyObject *)__pyx_v__channel); goto __pyx_L0; - /* "ssh2/channel.pyx":28 + /* "ssh2/channel.pyx":30 * * * cdef object PyChannel(c_ssh2.LIBSSH2_CHANNEL *channel, Session session): # <<<<<<<<<<<<<< @@ -1393,7 +1374,7 @@ static PyObject *__pyx_f_4ssh2_7channel_PyChannel(LIBSSH2_CHANNEL *__pyx_v_chann return __pyx_r; } -/* "ssh2/channel.pyx":36 +/* "ssh2/channel.pyx":38 * cdef class Channel: * * def __cinit__(self, Session session): # <<<<<<<<<<<<<< @@ -1427,7 +1408,7 @@ static int __pyx_pw_4ssh2_7channel_7Channel_1__cinit__(PyObject *__pyx_v_self, P else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 36, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 38, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; @@ -1438,13 +1419,13 @@ static int __pyx_pw_4ssh2_7channel_7Channel_1__cinit__(PyObject *__pyx_v_self, P } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 36, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 38, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.channel.Channel.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_session), __pyx_ptype_4ssh2_7session_Session, 1, "session", 0))) __PYX_ERR(0, 36, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_session), __pyx_ptype_4ssh2_7session_Session, 1, "session", 0))) __PYX_ERR(0, 38, __pyx_L1_error) __pyx_r = __pyx_pf_4ssh2_7channel_7Channel___cinit__(((struct __pyx_obj_4ssh2_7channel_Channel *)__pyx_v_self), __pyx_v_session); /* function exit code */ @@ -1461,7 +1442,7 @@ static int __pyx_pf_4ssh2_7channel_7Channel___cinit__(struct __pyx_obj_4ssh2_7ch __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); - /* "ssh2/channel.pyx":37 + /* "ssh2/channel.pyx":39 * * def __cinit__(self, Session session): * self._channel = NULL # <<<<<<<<<<<<<< @@ -1470,7 +1451,7 @@ static int __pyx_pf_4ssh2_7channel_7Channel___cinit__(struct __pyx_obj_4ssh2_7ch */ __pyx_v_self->_channel = NULL; - /* "ssh2/channel.pyx":38 + /* "ssh2/channel.pyx":40 * def __cinit__(self, Session session): * self._channel = NULL * self._session = session # <<<<<<<<<<<<<< @@ -1483,7 +1464,7 @@ static int __pyx_pf_4ssh2_7channel_7Channel___cinit__(struct __pyx_obj_4ssh2_7ch __Pyx_DECREF(((PyObject *)__pyx_v_self->_session)); __pyx_v_self->_session = __pyx_v_session; - /* "ssh2/channel.pyx":36 + /* "ssh2/channel.pyx":38 * cdef class Channel: * * def __cinit__(self, Session session): # <<<<<<<<<<<<<< @@ -1497,7 +1478,7 @@ static int __pyx_pf_4ssh2_7channel_7Channel___cinit__(struct __pyx_obj_4ssh2_7ch return __pyx_r; } -/* "ssh2/channel.pyx":40 +/* "ssh2/channel.pyx":42 * self._session = session * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -1520,7 +1501,7 @@ static void __pyx_pf_4ssh2_7channel_7Channel_2__dealloc__(struct __pyx_obj_4ssh2 __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "ssh2/channel.pyx":41 + /* "ssh2/channel.pyx":43 * * def __dealloc__(self): * with nogil: # <<<<<<<<<<<<<< @@ -1535,7 +1516,7 @@ static void __pyx_pf_4ssh2_7channel_7Channel_2__dealloc__(struct __pyx_obj_4ssh2 #endif /*try:*/ { - /* "ssh2/channel.pyx":42 + /* "ssh2/channel.pyx":44 * def __dealloc__(self): * with nogil: * c_ssh2.libssh2_channel_close(self._channel) # <<<<<<<<<<<<<< @@ -1544,7 +1525,7 @@ static void __pyx_pf_4ssh2_7channel_7Channel_2__dealloc__(struct __pyx_obj_4ssh2 */ libssh2_channel_close(__pyx_v_self->_channel); - /* "ssh2/channel.pyx":43 + /* "ssh2/channel.pyx":45 * with nogil: * c_ssh2.libssh2_channel_close(self._channel) * c_ssh2.libssh2_channel_free(self._channel) # <<<<<<<<<<<<<< @@ -1554,7 +1535,7 @@ static void __pyx_pf_4ssh2_7channel_7Channel_2__dealloc__(struct __pyx_obj_4ssh2 libssh2_channel_free(__pyx_v_self->_channel); } - /* "ssh2/channel.pyx":41 + /* "ssh2/channel.pyx":43 * * def __dealloc__(self): * with nogil: # <<<<<<<<<<<<<< @@ -1573,7 +1554,7 @@ static void __pyx_pf_4ssh2_7channel_7Channel_2__dealloc__(struct __pyx_obj_4ssh2 } } - /* "ssh2/channel.pyx":40 + /* "ssh2/channel.pyx":42 * self._session = session * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -1585,7 +1566,7 @@ static void __pyx_pf_4ssh2_7channel_7Channel_2__dealloc__(struct __pyx_obj_4ssh2 __Pyx_RefNannyFinishContext(); } -/* "ssh2/channel.pyx":45 +/* "ssh2/channel.pyx":47 * c_ssh2.libssh2_channel_free(self._channel) * * def pty(self, term="vt100"): # <<<<<<<<<<<<<< @@ -1623,7 +1604,7 @@ static PyObject *__pyx_pw_4ssh2_7channel_7Channel_5pty(PyObject *__pyx_v_self, P } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pty") < 0)) __PYX_ERR(0, 45, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pty") < 0)) __PYX_ERR(0, 47, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -1637,7 +1618,7 @@ static PyObject *__pyx_pw_4ssh2_7channel_7Channel_5pty(PyObject *__pyx_v_self, P } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("pty", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 45, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("pty", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 47, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.channel.Channel.pty", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -1661,7 +1642,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_4pty(struct __pyx_obj_4ssh2_7c PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("pty", 0); - /* "ssh2/channel.pyx":46 + /* "ssh2/channel.pyx":48 * * def pty(self, term="vt100"): * cdef const char *_term = to_bytes(term) # <<<<<<<<<<<<<< @@ -1670,7 +1651,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_4pty(struct __pyx_obj_4ssh2_7c */ __pyx_v__term = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_term); - /* "ssh2/channel.pyx":48 + /* "ssh2/channel.pyx":50 * cdef const char *_term = to_bytes(term) * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -1685,7 +1666,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_4pty(struct __pyx_obj_4ssh2_7c #endif /*try:*/ { - /* "ssh2/channel.pyx":49 + /* "ssh2/channel.pyx":51 * cdef int rc * with nogil: * rc = c_ssh2.libssh2_channel_request_pty( # <<<<<<<<<<<<<< @@ -1694,7 +1675,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_4pty(struct __pyx_obj_4ssh2_7c */ __pyx_v_rc = libssh2_channel_request_pty(__pyx_v_self->_channel, __pyx_v__term); - /* "ssh2/channel.pyx":51 + /* "ssh2/channel.pyx":53 * rc = c_ssh2.libssh2_channel_request_pty( * self._channel, _term) * if rc != 0 and rc != c_ssh2._LIBSSH2_ERROR_EAGAIN: # <<<<<<<<<<<<<< @@ -1712,7 +1693,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_4pty(struct __pyx_obj_4ssh2_7c __pyx_L7_bool_binop_done:; if (__pyx_t_1) { - /* "ssh2/channel.pyx":52 + /* "ssh2/channel.pyx":54 * self._channel, _term) * if rc != 0 and rc != c_ssh2._LIBSSH2_ERROR_EAGAIN: * with gil: # <<<<<<<<<<<<<< @@ -1725,24 +1706,24 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_4pty(struct __pyx_obj_4ssh2_7c #endif /*try:*/ { - /* "ssh2/channel.pyx":55 + /* "ssh2/channel.pyx":57 * raise ChannelError( * "Error requesting PTY with error code %s", * rc) # <<<<<<<<<<<<<< * return rc * */ - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 55, __pyx_L10_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 57, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_3); - /* "ssh2/channel.pyx":53 + /* "ssh2/channel.pyx":55 * if rc != 0 and rc != c_ssh2._LIBSSH2_ERROR_EAGAIN: * with gil: * raise ChannelError( # <<<<<<<<<<<<<< * "Error requesting PTY with error code %s", * rc) */ - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 53, __pyx_L10_error) + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 55, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_kp_s_Error_requesting_PTY_with_error); __Pyx_GIVEREF(__pyx_kp_s_Error_requesting_PTY_with_error); @@ -1750,15 +1731,15 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_4pty(struct __pyx_obj_4ssh2_7c __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4ssh2_10exceptions_ChannelError), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 53, __pyx_L10_error) + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4ssh2_10exceptions_ChannelError), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 55, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 53, __pyx_L10_error) + __PYX_ERR(0, 55, __pyx_L10_error) } - /* "ssh2/channel.pyx":52 + /* "ssh2/channel.pyx":54 * self._channel, _term) * if rc != 0 and rc != c_ssh2._LIBSSH2_ERROR_EAGAIN: * with gil: # <<<<<<<<<<<<<< @@ -1775,7 +1756,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_4pty(struct __pyx_obj_4ssh2_7c } } - /* "ssh2/channel.pyx":51 + /* "ssh2/channel.pyx":53 * rc = c_ssh2.libssh2_channel_request_pty( * self._channel, _term) * if rc != 0 and rc != c_ssh2._LIBSSH2_ERROR_EAGAIN: # <<<<<<<<<<<<<< @@ -1785,7 +1766,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_4pty(struct __pyx_obj_4ssh2_7c } } - /* "ssh2/channel.pyx":48 + /* "ssh2/channel.pyx":50 * cdef const char *_term = to_bytes(term) * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -1811,7 +1792,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_4pty(struct __pyx_obj_4ssh2_7c } } - /* "ssh2/channel.pyx":56 + /* "ssh2/channel.pyx":58 * "Error requesting PTY with error code %s", * rc) * return rc # <<<<<<<<<<<<<< @@ -1819,13 +1800,13 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_4pty(struct __pyx_obj_4ssh2_7c * def execute(self, command not None): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 56, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - /* "ssh2/channel.pyx":45 + /* "ssh2/channel.pyx":47 * c_ssh2.libssh2_channel_free(self._channel) * * def pty(self, term="vt100"): # <<<<<<<<<<<<<< @@ -1845,7 +1826,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_4pty(struct __pyx_obj_4ssh2_7c return __pyx_r; } -/* "ssh2/channel.pyx":58 +/* "ssh2/channel.pyx":60 * return rc * * def execute(self, command not None): # <<<<<<<<<<<<<< @@ -1861,7 +1842,7 @@ static PyObject *__pyx_pw_4ssh2_7channel_7Channel_7execute(PyObject *__pyx_v_sel __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("execute (wrapper)", 0); if (unlikely(((PyObject *)__pyx_v_command) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "command"); __PYX_ERR(0, 58, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "command"); __PYX_ERR(0, 60, __pyx_L1_error) } __pyx_r = __pyx_pf_4ssh2_7channel_7Channel_6execute(((struct __pyx_obj_4ssh2_7channel_Channel *)__pyx_v_self), ((PyObject *)__pyx_v_command)); @@ -1885,7 +1866,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_6execute(struct __pyx_obj_4ssh PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("execute", 0); - /* "ssh2/channel.pyx":70 + /* "ssh2/channel.pyx":72 * """ * cdef int rc * cdef char *_command = to_bytes(command) # <<<<<<<<<<<<<< @@ -1894,7 +1875,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_6execute(struct __pyx_obj_4ssh */ __pyx_v__command = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_command); - /* "ssh2/channel.pyx":71 + /* "ssh2/channel.pyx":73 * cdef int rc * cdef char *_command = to_bytes(command) * with nogil: # <<<<<<<<<<<<<< @@ -1909,7 +1890,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_6execute(struct __pyx_obj_4ssh #endif /*try:*/ { - /* "ssh2/channel.pyx":72 + /* "ssh2/channel.pyx":74 * cdef char *_command = to_bytes(command) * with nogil: * rc = c_ssh2.libssh2_channel_exec( # <<<<<<<<<<<<<< @@ -1918,7 +1899,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_6execute(struct __pyx_obj_4ssh */ __pyx_v_rc = libssh2_channel_exec(__pyx_v_self->_channel, __pyx_v__command); - /* "ssh2/channel.pyx":74 + /* "ssh2/channel.pyx":76 * rc = c_ssh2.libssh2_channel_exec( * self._channel, _command) * if rc != 0 and rc != c_ssh2._LIBSSH2_ERROR_EAGAIN: # <<<<<<<<<<<<<< @@ -1936,7 +1917,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_6execute(struct __pyx_obj_4ssh __pyx_L7_bool_binop_done:; if (__pyx_t_1) { - /* "ssh2/channel.pyx":75 + /* "ssh2/channel.pyx":77 * self._channel, _command) * if rc != 0 and rc != c_ssh2._LIBSSH2_ERROR_EAGAIN: * with gil: # <<<<<<<<<<<<<< @@ -1949,24 +1930,24 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_6execute(struct __pyx_obj_4ssh #endif /*try:*/ { - /* "ssh2/channel.pyx":78 + /* "ssh2/channel.pyx":80 * raise ChannelError( * "Error executing command %s - error code %s", * command, rc) # <<<<<<<<<<<<<< * return rc * */ - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 78, __pyx_L10_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 80, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_3); - /* "ssh2/channel.pyx":76 + /* "ssh2/channel.pyx":78 * if rc != 0 and rc != c_ssh2._LIBSSH2_ERROR_EAGAIN: * with gil: * raise ChannelError( # <<<<<<<<<<<<<< * "Error executing command %s - error code %s", * command, rc) */ - __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 76, __pyx_L10_error) + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 78, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_kp_s_Error_executing_command_s_error); __Pyx_GIVEREF(__pyx_kp_s_Error_executing_command_s_error); @@ -1977,15 +1958,15 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_6execute(struct __pyx_obj_4ssh __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4ssh2_10exceptions_ChannelError), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 76, __pyx_L10_error) + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4ssh2_10exceptions_ChannelError), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 78, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 76, __pyx_L10_error) + __PYX_ERR(0, 78, __pyx_L10_error) } - /* "ssh2/channel.pyx":75 + /* "ssh2/channel.pyx":77 * self._channel, _command) * if rc != 0 and rc != c_ssh2._LIBSSH2_ERROR_EAGAIN: * with gil: # <<<<<<<<<<<<<< @@ -2002,7 +1983,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_6execute(struct __pyx_obj_4ssh } } - /* "ssh2/channel.pyx":74 + /* "ssh2/channel.pyx":76 * rc = c_ssh2.libssh2_channel_exec( * self._channel, _command) * if rc != 0 and rc != c_ssh2._LIBSSH2_ERROR_EAGAIN: # <<<<<<<<<<<<<< @@ -2012,7 +1993,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_6execute(struct __pyx_obj_4ssh } } - /* "ssh2/channel.pyx":71 + /* "ssh2/channel.pyx":73 * cdef int rc * cdef char *_command = to_bytes(command) * with nogil: # <<<<<<<<<<<<<< @@ -2038,7 +2019,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_6execute(struct __pyx_obj_4ssh } } - /* "ssh2/channel.pyx":79 + /* "ssh2/channel.pyx":81 * "Error executing command %s - error code %s", * command, rc) * return rc # <<<<<<<<<<<<<< @@ -2046,13 +2027,13 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_6execute(struct __pyx_obj_4ssh * def subsystem(self, subsystem not None): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 79, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - /* "ssh2/channel.pyx":58 + /* "ssh2/channel.pyx":60 * return rc * * def execute(self, command not None): # <<<<<<<<<<<<<< @@ -2072,7 +2053,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_6execute(struct __pyx_obj_4ssh return __pyx_r; } -/* "ssh2/channel.pyx":81 +/* "ssh2/channel.pyx":83 * return rc * * def subsystem(self, subsystem not None): # <<<<<<<<<<<<<< @@ -2088,7 +2069,7 @@ static PyObject *__pyx_pw_4ssh2_7channel_7Channel_9subsystem(PyObject *__pyx_v_s __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("subsystem (wrapper)", 0); if (unlikely(((PyObject *)__pyx_v_subsystem) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "subsystem"); __PYX_ERR(0, 81, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "subsystem"); __PYX_ERR(0, 83, __pyx_L1_error) } __pyx_r = __pyx_pf_4ssh2_7channel_7Channel_8subsystem(((struct __pyx_obj_4ssh2_7channel_Channel *)__pyx_v_self), ((PyObject *)__pyx_v_subsystem)); @@ -2112,7 +2093,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_8subsystem(struct __pyx_obj_4s PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("subsystem", 0); - /* "ssh2/channel.pyx":87 + /* "ssh2/channel.pyx":89 * :type subsystem: str""" * cdef int rc * cdef char *_subsystem = to_bytes(subsystem) # <<<<<<<<<<<<<< @@ -2121,7 +2102,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_8subsystem(struct __pyx_obj_4s */ __pyx_v__subsystem = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_subsystem); - /* "ssh2/channel.pyx":88 + /* "ssh2/channel.pyx":90 * cdef int rc * cdef char *_subsystem = to_bytes(subsystem) * with nogil: # <<<<<<<<<<<<<< @@ -2136,7 +2117,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_8subsystem(struct __pyx_obj_4s #endif /*try:*/ { - /* "ssh2/channel.pyx":89 + /* "ssh2/channel.pyx":91 * cdef char *_subsystem = to_bytes(subsystem) * with nogil: * rc = c_ssh2.libssh2_channel_subsystem( # <<<<<<<<<<<<<< @@ -2145,7 +2126,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_8subsystem(struct __pyx_obj_4s */ __pyx_v_rc = libssh2_channel_subsystem(__pyx_v_self->_channel, __pyx_v__subsystem); - /* "ssh2/channel.pyx":91 + /* "ssh2/channel.pyx":93 * rc = c_ssh2.libssh2_channel_subsystem( * self._channel, _subsystem) * if rc != 0 and rc != c_ssh2._LIBSSH2_ERROR_EAGAIN: # <<<<<<<<<<<<<< @@ -2163,7 +2144,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_8subsystem(struct __pyx_obj_4s __pyx_L7_bool_binop_done:; if (__pyx_t_1) { - /* "ssh2/channel.pyx":92 + /* "ssh2/channel.pyx":94 * self._channel, _subsystem) * if rc != 0 and rc != c_ssh2._LIBSSH2_ERROR_EAGAIN: * with gil: # <<<<<<<<<<<<<< @@ -2176,24 +2157,24 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_8subsystem(struct __pyx_obj_4s #endif /*try:*/ { - /* "ssh2/channel.pyx":95 + /* "ssh2/channel.pyx":97 * raise ChannelError( * "Error requesting subsystem %s - error code %s", * subsystem, rc) # <<<<<<<<<<<<<< * return rc * */ - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 95, __pyx_L10_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 97, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_3); - /* "ssh2/channel.pyx":93 + /* "ssh2/channel.pyx":95 * if rc != 0 and rc != c_ssh2._LIBSSH2_ERROR_EAGAIN: * with gil: * raise ChannelError( # <<<<<<<<<<<<<< * "Error requesting subsystem %s - error code %s", * subsystem, rc) */ - __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 93, __pyx_L10_error) + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 95, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_kp_s_Error_requesting_subsystem_s_err); __Pyx_GIVEREF(__pyx_kp_s_Error_requesting_subsystem_s_err); @@ -2204,15 +2185,15 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_8subsystem(struct __pyx_obj_4s __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4ssh2_10exceptions_ChannelError), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 93, __pyx_L10_error) + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4ssh2_10exceptions_ChannelError), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 95, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 93, __pyx_L10_error) + __PYX_ERR(0, 95, __pyx_L10_error) } - /* "ssh2/channel.pyx":92 + /* "ssh2/channel.pyx":94 * self._channel, _subsystem) * if rc != 0 and rc != c_ssh2._LIBSSH2_ERROR_EAGAIN: * with gil: # <<<<<<<<<<<<<< @@ -2229,7 +2210,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_8subsystem(struct __pyx_obj_4s } } - /* "ssh2/channel.pyx":91 + /* "ssh2/channel.pyx":93 * rc = c_ssh2.libssh2_channel_subsystem( * self._channel, _subsystem) * if rc != 0 and rc != c_ssh2._LIBSSH2_ERROR_EAGAIN: # <<<<<<<<<<<<<< @@ -2239,7 +2220,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_8subsystem(struct __pyx_obj_4s } } - /* "ssh2/channel.pyx":88 + /* "ssh2/channel.pyx":90 * cdef int rc * cdef char *_subsystem = to_bytes(subsystem) * with nogil: # <<<<<<<<<<<<<< @@ -2265,7 +2246,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_8subsystem(struct __pyx_obj_4s } } - /* "ssh2/channel.pyx":96 + /* "ssh2/channel.pyx":98 * "Error requesting subsystem %s - error code %s", * subsystem, rc) * return rc # <<<<<<<<<<<<<< @@ -2273,13 +2254,13 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_8subsystem(struct __pyx_obj_4s * def read(self, size_t size=1024): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 96, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - /* "ssh2/channel.pyx":81 + /* "ssh2/channel.pyx":83 * return rc * * def subsystem(self, subsystem not None): # <<<<<<<<<<<<<< @@ -2299,7 +2280,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_8subsystem(struct __pyx_obj_4s return __pyx_r; } -/* "ssh2/channel.pyx":98 +/* "ssh2/channel.pyx":100 * return rc * * def read(self, size_t size=1024): # <<<<<<<<<<<<<< @@ -2336,7 +2317,7 @@ static PyObject *__pyx_pw_4ssh2_7channel_7Channel_11read(PyObject *__pyx_v_self, } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "read") < 0)) __PYX_ERR(0, 98, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "read") < 0)) __PYX_ERR(0, 100, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -2347,14 +2328,14 @@ static PyObject *__pyx_pw_4ssh2_7channel_7Channel_11read(PyObject *__pyx_v_self, } } if (values[0]) { - __pyx_v_size = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_size == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 98, __pyx_L3_error) + __pyx_v_size = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_size == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 100, __pyx_L3_error) } else { __pyx_v_size = ((size_t)0x400); } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("read", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 98, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("read", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 100, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.channel.Channel.read", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -2375,7 +2356,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_10read(struct __pyx_obj_4ssh2_ PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("read", 0); - /* "ssh2/channel.pyx":106 + /* "ssh2/channel.pyx":108 * * :rtype: (int, bytes)""" * return self.read_ex(size=size, stream_id=0) # <<<<<<<<<<<<<< @@ -2383,16 +2364,16 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_10read(struct __pyx_obj_4ssh2_ * def read_ex(self, size_t size=1024, int stream_id=0): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_read_ex); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 106, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_read_ex); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 106, __pyx_L1_error) + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_v_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 106, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_v_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_size, __pyx_t_3) < 0) __PYX_ERR(0, 106, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_size, __pyx_t_3) < 0) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_stream_id, __pyx_int_0) < 0) __PYX_ERR(0, 106, __pyx_L1_error) - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 106, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_stream_id, __pyx_int_0) < 0) __PYX_ERR(0, 108, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -2400,7 +2381,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_10read(struct __pyx_obj_4ssh2_ __pyx_t_3 = 0; goto __pyx_L0; - /* "ssh2/channel.pyx":98 + /* "ssh2/channel.pyx":100 * return rc * * def read(self, size_t size=1024): # <<<<<<<<<<<<<< @@ -2421,7 +2402,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_10read(struct __pyx_obj_4ssh2_ return __pyx_r; } -/* "ssh2/channel.pyx":108 +/* "ssh2/channel.pyx":110 * return self.read_ex(size=size, stream_id=0) * * def read_ex(self, size_t size=1024, int stream_id=0): # <<<<<<<<<<<<<< @@ -2467,7 +2448,7 @@ static PyObject *__pyx_pw_4ssh2_7channel_7Channel_13read_ex(PyObject *__pyx_v_se } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "read_ex") < 0)) __PYX_ERR(0, 108, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "read_ex") < 0)) __PYX_ERR(0, 110, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -2480,19 +2461,19 @@ static PyObject *__pyx_pw_4ssh2_7channel_7Channel_13read_ex(PyObject *__pyx_v_se } } if (values[0]) { - __pyx_v_size = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_size == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 108, __pyx_L3_error) + __pyx_v_size = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_size == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 110, __pyx_L3_error) } else { __pyx_v_size = ((size_t)0x400); } if (values[1]) { - __pyx_v_stream_id = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_stream_id == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 108, __pyx_L3_error) + __pyx_v_stream_id = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_stream_id == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 110, __pyx_L3_error) } else { __pyx_v_stream_id = ((int)0); } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("read_ex", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 108, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("read_ex", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 110, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.channel.Channel.read_ex", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -2525,7 +2506,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_12read_ex(struct __pyx_obj_4ss PyObject *__pyx_t_12 = NULL; __Pyx_RefNannySetupContext("read_ex", 0); - /* "ssh2/channel.pyx":118 + /* "ssh2/channel.pyx":120 * cdef bytes buf * cdef char *cbuf * with nogil: # <<<<<<<<<<<<<< @@ -2540,7 +2521,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_12read_ex(struct __pyx_obj_4ss #endif /*try:*/ { - /* "ssh2/channel.pyx":119 + /* "ssh2/channel.pyx":121 * cdef char *cbuf * with nogil: * cbuf = malloc(sizeof(char)*size) # <<<<<<<<<<<<<< @@ -2549,7 +2530,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_12read_ex(struct __pyx_obj_4ss */ __pyx_v_cbuf = ((char *)malloc(((sizeof(char)) * __pyx_v_size))); - /* "ssh2/channel.pyx":120 + /* "ssh2/channel.pyx":122 * with nogil: * cbuf = malloc(sizeof(char)*size) * if cbuf is NULL: # <<<<<<<<<<<<<< @@ -2559,7 +2540,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_12read_ex(struct __pyx_obj_4ss __pyx_t_1 = ((__pyx_v_cbuf == NULL) != 0); if (__pyx_t_1) { - /* "ssh2/channel.pyx":121 + /* "ssh2/channel.pyx":123 * cbuf = malloc(sizeof(char)*size) * if cbuf is NULL: * with gil: # <<<<<<<<<<<<<< @@ -2572,17 +2553,17 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_12read_ex(struct __pyx_obj_4ss #endif /*try:*/ { - /* "ssh2/channel.pyx":122 + /* "ssh2/channel.pyx":124 * if cbuf is NULL: * with gil: * raise MemoryError # <<<<<<<<<<<<<< * rc = c_ssh2.libssh2_channel_read_ex( * self._channel, stream_id, cbuf, size) */ - PyErr_NoMemory(); __PYX_ERR(0, 122, __pyx_L8_error) + PyErr_NoMemory(); __PYX_ERR(0, 124, __pyx_L8_error) } - /* "ssh2/channel.pyx":121 + /* "ssh2/channel.pyx":123 * cbuf = malloc(sizeof(char)*size) * if cbuf is NULL: * with gil: # <<<<<<<<<<<<<< @@ -2599,7 +2580,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_12read_ex(struct __pyx_obj_4ss } } - /* "ssh2/channel.pyx":120 + /* "ssh2/channel.pyx":122 * with nogil: * cbuf = malloc(sizeof(char)*size) * if cbuf is NULL: # <<<<<<<<<<<<<< @@ -2608,7 +2589,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_12read_ex(struct __pyx_obj_4ss */ } - /* "ssh2/channel.pyx":123 + /* "ssh2/channel.pyx":125 * with gil: * raise MemoryError * rc = c_ssh2.libssh2_channel_read_ex( # <<<<<<<<<<<<<< @@ -2618,7 +2599,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_12read_ex(struct __pyx_obj_4ss __pyx_v_rc = libssh2_channel_read_ex(__pyx_v_self->_channel, __pyx_v_stream_id, __pyx_v_cbuf, __pyx_v_size); } - /* "ssh2/channel.pyx":118 + /* "ssh2/channel.pyx":120 * cdef bytes buf * cdef char *cbuf * with nogil: # <<<<<<<<<<<<<< @@ -2644,7 +2625,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_12read_ex(struct __pyx_obj_4ss } } - /* "ssh2/channel.pyx":125 + /* "ssh2/channel.pyx":127 * rc = c_ssh2.libssh2_channel_read_ex( * self._channel, stream_id, cbuf, size) * try: # <<<<<<<<<<<<<< @@ -2653,7 +2634,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_12read_ex(struct __pyx_obj_4ss */ /*try:*/ { - /* "ssh2/channel.pyx":126 + /* "ssh2/channel.pyx":128 * self._channel, stream_id, cbuf, size) * try: * if rc > 0: # <<<<<<<<<<<<<< @@ -2663,19 +2644,19 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_12read_ex(struct __pyx_obj_4ss __pyx_t_1 = ((__pyx_v_rc > 0) != 0); if (__pyx_t_1) { - /* "ssh2/channel.pyx":127 + /* "ssh2/channel.pyx":129 * try: * if rc > 0: * buf = cbuf[:rc] # <<<<<<<<<<<<<< * else: * buf = b'' */ - __pyx_t_2 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_cbuf + 0, __pyx_v_rc - 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 127, __pyx_L11_error) + __pyx_t_2 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_cbuf + 0, __pyx_v_rc - 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 129, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_buf = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "ssh2/channel.pyx":126 + /* "ssh2/channel.pyx":128 * self._channel, stream_id, cbuf, size) * try: * if rc > 0: # <<<<<<<<<<<<<< @@ -2685,7 +2666,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_12read_ex(struct __pyx_obj_4ss goto __pyx_L13; } - /* "ssh2/channel.pyx":129 + /* "ssh2/channel.pyx":131 * buf = cbuf[:rc] * else: * buf = b'' # <<<<<<<<<<<<<< @@ -2699,7 +2680,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_12read_ex(struct __pyx_obj_4ss __pyx_L13:; } - /* "ssh2/channel.pyx":131 + /* "ssh2/channel.pyx":133 * buf = b'' * finally: * free(cbuf) # <<<<<<<<<<<<<< @@ -2747,7 +2728,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_12read_ex(struct __pyx_obj_4ss __pyx_L12:; } - /* "ssh2/channel.pyx":132 + /* "ssh2/channel.pyx":134 * finally: * free(cbuf) * return rc, buf # <<<<<<<<<<<<<< @@ -2755,9 +2736,9 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_12read_ex(struct __pyx_obj_4ss * def read_stderr(self, size_t size=1024): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_rc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 132, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_rc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 132, __pyx_L1_error) + __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_2); @@ -2769,7 +2750,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_12read_ex(struct __pyx_obj_4ss __pyx_t_12 = 0; goto __pyx_L0; - /* "ssh2/channel.pyx":108 + /* "ssh2/channel.pyx":110 * return self.read_ex(size=size, stream_id=0) * * def read_ex(self, size_t size=1024, int stream_id=0): # <<<<<<<<<<<<<< @@ -2790,7 +2771,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_12read_ex(struct __pyx_obj_4ss return __pyx_r; } -/* "ssh2/channel.pyx":134 +/* "ssh2/channel.pyx":136 * return rc, buf * * def read_stderr(self, size_t size=1024): # <<<<<<<<<<<<<< @@ -2827,7 +2808,7 @@ static PyObject *__pyx_pw_4ssh2_7channel_7Channel_15read_stderr(PyObject *__pyx_ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "read_stderr") < 0)) __PYX_ERR(0, 134, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "read_stderr") < 0)) __PYX_ERR(0, 136, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -2838,14 +2819,14 @@ static PyObject *__pyx_pw_4ssh2_7channel_7Channel_15read_stderr(PyObject *__pyx_ } } if (values[0]) { - __pyx_v_size = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_size == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 134, __pyx_L3_error) + __pyx_v_size = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_size == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 136, __pyx_L3_error) } else { __pyx_v_size = ((size_t)0x400); } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("read_stderr", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 134, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("read_stderr", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 136, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.channel.Channel.read_stderr", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -2866,7 +2847,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_14read_stderr(struct __pyx_obj PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("read_stderr", 0); - /* "ssh2/channel.pyx":142 + /* "ssh2/channel.pyx":144 * * :rtype: (int, bytes)""" * return self.read_ex(size=size, stream_id=c_ssh2._SSH_EXTENDED_DATA_STDERR) # <<<<<<<<<<<<<< @@ -2874,19 +2855,19 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_14read_stderr(struct __pyx_obj * def eof(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_read_ex); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 142, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_read_ex); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 142, __pyx_L1_error) + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_v_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 142, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_v_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_size, __pyx_t_3) < 0) __PYX_ERR(0, 142, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_size, __pyx_t_3) < 0) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyInt_From_int(SSH_EXTENDED_DATA_STDERR); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 142, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(SSH_EXTENDED_DATA_STDERR); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_stream_id, __pyx_t_3) < 0) __PYX_ERR(0, 142, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_stream_id, __pyx_t_3) < 0) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 142, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -2894,7 +2875,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_14read_stderr(struct __pyx_obj __pyx_t_3 = 0; goto __pyx_L0; - /* "ssh2/channel.pyx":134 + /* "ssh2/channel.pyx":136 * return rc, buf * * def read_stderr(self, size_t size=1024): # <<<<<<<<<<<<<< @@ -2915,7 +2896,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_14read_stderr(struct __pyx_obj return __pyx_r; } -/* "ssh2/channel.pyx":144 +/* "ssh2/channel.pyx":146 * return self.read_ex(size=size, stream_id=c_ssh2._SSH_EXTENDED_DATA_STDERR) * * def eof(self): # <<<<<<<<<<<<<< @@ -2945,7 +2926,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_16eof(struct __pyx_obj_4ssh2_7 int __pyx_t_2; __Pyx_RefNannySetupContext("eof", 0); - /* "ssh2/channel.pyx":149 + /* "ssh2/channel.pyx":151 * :rtype: bool""" * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -2960,7 +2941,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_16eof(struct __pyx_obj_4ssh2_7 #endif /*try:*/ { - /* "ssh2/channel.pyx":150 + /* "ssh2/channel.pyx":152 * cdef int rc * with nogil: * rc = c_ssh2.libssh2_channel_eof(self._channel) # <<<<<<<<<<<<<< @@ -2970,7 +2951,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_16eof(struct __pyx_obj_4ssh2_7 __pyx_v_rc = libssh2_channel_eof(__pyx_v_self->_channel); } - /* "ssh2/channel.pyx":149 + /* "ssh2/channel.pyx":151 * :rtype: bool""" * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -2989,7 +2970,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_16eof(struct __pyx_obj_4ssh2_7 } } - /* "ssh2/channel.pyx":151 + /* "ssh2/channel.pyx":153 * with nogil: * rc = c_ssh2.libssh2_channel_eof(self._channel) * return bool(rc) # <<<<<<<<<<<<<< @@ -2997,17 +2978,17 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_16eof(struct __pyx_obj_4ssh2_7 * def send_eof(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 151, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 151, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 153, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 151, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/channel.pyx":144 + /* "ssh2/channel.pyx":146 * return self.read_ex(size=size, stream_id=c_ssh2._SSH_EXTENDED_DATA_STDERR) * * def eof(self): # <<<<<<<<<<<<<< @@ -3026,7 +3007,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_16eof(struct __pyx_obj_4ssh2_7 return __pyx_r; } -/* "ssh2/channel.pyx":153 +/* "ssh2/channel.pyx":155 * return bool(rc) * * def send_eof(self): # <<<<<<<<<<<<<< @@ -3055,7 +3036,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_18send_eof(struct __pyx_obj_4s PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("send_eof", 0); - /* "ssh2/channel.pyx":164 + /* "ssh2/channel.pyx":166 * """ * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -3070,7 +3051,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_18send_eof(struct __pyx_obj_4s #endif /*try:*/ { - /* "ssh2/channel.pyx":165 + /* "ssh2/channel.pyx":167 * cdef int rc * with nogil: * rc = c_ssh2.libssh2_channel_send_eof(self._channel) # <<<<<<<<<<<<<< @@ -3080,7 +3061,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_18send_eof(struct __pyx_obj_4s __pyx_v_rc = libssh2_channel_send_eof(__pyx_v_self->_channel); } - /* "ssh2/channel.pyx":164 + /* "ssh2/channel.pyx":166 * """ * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -3099,7 +3080,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_18send_eof(struct __pyx_obj_4s } } - /* "ssh2/channel.pyx":166 + /* "ssh2/channel.pyx":168 * with nogil: * rc = c_ssh2.libssh2_channel_send_eof(self._channel) * return rc # <<<<<<<<<<<<<< @@ -3107,13 +3088,13 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_18send_eof(struct __pyx_obj_4s * def wait_eof(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 166, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 168, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/channel.pyx":153 + /* "ssh2/channel.pyx":155 * return bool(rc) * * def send_eof(self): # <<<<<<<<<<<<<< @@ -3132,7 +3113,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_18send_eof(struct __pyx_obj_4s return __pyx_r; } -/* "ssh2/channel.pyx":168 +/* "ssh2/channel.pyx":170 * return rc * * def wait_eof(self): # <<<<<<<<<<<<<< @@ -3161,7 +3142,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_20wait_eof(struct __pyx_obj_4s PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("wait_eof", 0); - /* "ssh2/channel.pyx":178 + /* "ssh2/channel.pyx":180 * """ * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -3176,7 +3157,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_20wait_eof(struct __pyx_obj_4s #endif /*try:*/ { - /* "ssh2/channel.pyx":179 + /* "ssh2/channel.pyx":181 * cdef int rc * with nogil: * rc = c_ssh2.libssh2_channel_wait_eof(self._channel) # <<<<<<<<<<<<<< @@ -3186,7 +3167,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_20wait_eof(struct __pyx_obj_4s __pyx_v_rc = libssh2_channel_wait_eof(__pyx_v_self->_channel); } - /* "ssh2/channel.pyx":178 + /* "ssh2/channel.pyx":180 * """ * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -3205,7 +3186,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_20wait_eof(struct __pyx_obj_4s } } - /* "ssh2/channel.pyx":180 + /* "ssh2/channel.pyx":182 * with nogil: * rc = c_ssh2.libssh2_channel_wait_eof(self._channel) * return rc # <<<<<<<<<<<<<< @@ -3213,13 +3194,13 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_20wait_eof(struct __pyx_obj_4s * def close(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 180, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/channel.pyx":168 + /* "ssh2/channel.pyx":170 * return rc * * def wait_eof(self): # <<<<<<<<<<<<<< @@ -3238,7 +3219,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_20wait_eof(struct __pyx_obj_4s return __pyx_r; } -/* "ssh2/channel.pyx":182 +/* "ssh2/channel.pyx":184 * return rc * * def close(self): # <<<<<<<<<<<<<< @@ -3267,7 +3248,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_22close(struct __pyx_obj_4ssh2 PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("close", 0); - /* "ssh2/channel.pyx":185 + /* "ssh2/channel.pyx":187 * """Close channel. Typically done to be able to get exit status.""" * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -3282,7 +3263,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_22close(struct __pyx_obj_4ssh2 #endif /*try:*/ { - /* "ssh2/channel.pyx":186 + /* "ssh2/channel.pyx":188 * cdef int rc * with nogil: * rc = c_ssh2.libssh2_channel_close(self._channel) # <<<<<<<<<<<<<< @@ -3292,7 +3273,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_22close(struct __pyx_obj_4ssh2 __pyx_v_rc = libssh2_channel_close(__pyx_v_self->_channel); } - /* "ssh2/channel.pyx":185 + /* "ssh2/channel.pyx":187 * """Close channel. Typically done to be able to get exit status.""" * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -3311,7 +3292,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_22close(struct __pyx_obj_4ssh2 } } - /* "ssh2/channel.pyx":187 + /* "ssh2/channel.pyx":189 * with nogil: * rc = c_ssh2.libssh2_channel_close(self._channel) * return rc # <<<<<<<<<<<<<< @@ -3319,13 +3300,13 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_22close(struct __pyx_obj_4ssh2 * def flush(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 187, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/channel.pyx":182 + /* "ssh2/channel.pyx":184 * return rc * * def close(self): # <<<<<<<<<<<<<< @@ -3344,7 +3325,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_22close(struct __pyx_obj_4ssh2 return __pyx_r; } -/* "ssh2/channel.pyx":189 +/* "ssh2/channel.pyx":191 * return rc * * def flush(self): # <<<<<<<<<<<<<< @@ -3373,7 +3354,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_24flush(struct __pyx_obj_4ssh2 PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("flush", 0); - /* "ssh2/channel.pyx":192 + /* "ssh2/channel.pyx":194 * """Flush stdout stream""" * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -3388,7 +3369,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_24flush(struct __pyx_obj_4ssh2 #endif /*try:*/ { - /* "ssh2/channel.pyx":193 + /* "ssh2/channel.pyx":195 * cdef int rc * with nogil: * rc = c_ssh2.libssh2_channel_flush(self._channel) # <<<<<<<<<<<<<< @@ -3398,7 +3379,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_24flush(struct __pyx_obj_4ssh2 __pyx_v_rc = libssh2_channel_flush(__pyx_v_self->_channel); } - /* "ssh2/channel.pyx":192 + /* "ssh2/channel.pyx":194 * """Flush stdout stream""" * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -3417,7 +3398,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_24flush(struct __pyx_obj_4ssh2 } } - /* "ssh2/channel.pyx":194 + /* "ssh2/channel.pyx":196 * with nogil: * rc = c_ssh2.libssh2_channel_flush(self._channel) * return rc # <<<<<<<<<<<<<< @@ -3425,13 +3406,13 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_24flush(struct __pyx_obj_4ssh2 * def flush_ex(self, int stream_id): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 194, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/channel.pyx":189 + /* "ssh2/channel.pyx":191 * return rc * * def flush(self): # <<<<<<<<<<<<<< @@ -3450,7 +3431,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_24flush(struct __pyx_obj_4ssh2 return __pyx_r; } -/* "ssh2/channel.pyx":196 +/* "ssh2/channel.pyx":198 * return rc * * def flush_ex(self, int stream_id): # <<<<<<<<<<<<<< @@ -3467,7 +3448,7 @@ static PyObject *__pyx_pw_4ssh2_7channel_7Channel_27flush_ex(PyObject *__pyx_v_s __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("flush_ex (wrapper)", 0); assert(__pyx_arg_stream_id); { - __pyx_v_stream_id = __Pyx_PyInt_As_int(__pyx_arg_stream_id); if (unlikely((__pyx_v_stream_id == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 196, __pyx_L3_error) + __pyx_v_stream_id = __Pyx_PyInt_As_int(__pyx_arg_stream_id); if (unlikely((__pyx_v_stream_id == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 198, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -3489,7 +3470,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_26flush_ex(struct __pyx_obj_4s PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("flush_ex", 0); - /* "ssh2/channel.pyx":199 + /* "ssh2/channel.pyx":201 * """Flush stream with id""" * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -3504,7 +3485,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_26flush_ex(struct __pyx_obj_4s #endif /*try:*/ { - /* "ssh2/channel.pyx":200 + /* "ssh2/channel.pyx":202 * cdef int rc * with nogil: * rc = c_ssh2.libssh2_channel_flush_ex(self._channel, stream_id) # <<<<<<<<<<<<<< @@ -3514,7 +3495,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_26flush_ex(struct __pyx_obj_4s __pyx_v_rc = libssh2_channel_flush_ex(__pyx_v_self->_channel, __pyx_v_stream_id); } - /* "ssh2/channel.pyx":199 + /* "ssh2/channel.pyx":201 * """Flush stream with id""" * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -3533,7 +3514,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_26flush_ex(struct __pyx_obj_4s } } - /* "ssh2/channel.pyx":201 + /* "ssh2/channel.pyx":203 * with nogil: * rc = c_ssh2.libssh2_channel_flush_ex(self._channel, stream_id) * return rc # <<<<<<<<<<<<<< @@ -3541,13 +3522,13 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_26flush_ex(struct __pyx_obj_4s * def flush_stderr(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 201, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/channel.pyx":196 + /* "ssh2/channel.pyx":198 * return rc * * def flush_ex(self, int stream_id): # <<<<<<<<<<<<<< @@ -3566,7 +3547,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_26flush_ex(struct __pyx_obj_4s return __pyx_r; } -/* "ssh2/channel.pyx":203 +/* "ssh2/channel.pyx":205 * return rc * * def flush_stderr(self): # <<<<<<<<<<<<<< @@ -3595,7 +3576,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_28flush_stderr(struct __pyx_ob PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("flush_stderr", 0); - /* "ssh2/channel.pyx":206 + /* "ssh2/channel.pyx":208 * """Flush stderr stream""" * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -3610,7 +3591,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_28flush_stderr(struct __pyx_ob #endif /*try:*/ { - /* "ssh2/channel.pyx":207 + /* "ssh2/channel.pyx":209 * cdef int rc * with nogil: * rc = c_ssh2.libssh2_channel_flush_stderr(self._channel) # <<<<<<<<<<<<<< @@ -3620,7 +3601,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_28flush_stderr(struct __pyx_ob __pyx_v_rc = libssh2_channel_flush_stderr(__pyx_v_self->_channel); } - /* "ssh2/channel.pyx":206 + /* "ssh2/channel.pyx":208 * """Flush stderr stream""" * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -3639,7 +3620,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_28flush_stderr(struct __pyx_ob } } - /* "ssh2/channel.pyx":208 + /* "ssh2/channel.pyx":210 * with nogil: * rc = c_ssh2.libssh2_channel_flush_stderr(self._channel) * return rc # <<<<<<<<<<<<<< @@ -3647,13 +3628,13 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_28flush_stderr(struct __pyx_ob * def wait_closed(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 208, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 210, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/channel.pyx":203 + /* "ssh2/channel.pyx":205 * return rc * * def flush_stderr(self): # <<<<<<<<<<<<<< @@ -3672,7 +3653,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_28flush_stderr(struct __pyx_ob return __pyx_r; } -/* "ssh2/channel.pyx":210 +/* "ssh2/channel.pyx":212 * return rc * * def wait_closed(self): # <<<<<<<<<<<<<< @@ -3701,7 +3682,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_30wait_closed(struct __pyx_obj PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("wait_closed", 0); - /* "ssh2/channel.pyx":213 + /* "ssh2/channel.pyx":215 * """Wait for server to acknowledge channel close command.""" * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -3716,7 +3697,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_30wait_closed(struct __pyx_obj #endif /*try:*/ { - /* "ssh2/channel.pyx":214 + /* "ssh2/channel.pyx":216 * cdef int rc * with nogil: * rc = c_ssh2.libssh2_channel_wait_closed(self._channel) # <<<<<<<<<<<<<< @@ -3726,7 +3707,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_30wait_closed(struct __pyx_obj __pyx_v_rc = libssh2_channel_wait_closed(__pyx_v_self->_channel); } - /* "ssh2/channel.pyx":213 + /* "ssh2/channel.pyx":215 * """Wait for server to acknowledge channel close command.""" * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -3745,7 +3726,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_30wait_closed(struct __pyx_obj } } - /* "ssh2/channel.pyx":215 + /* "ssh2/channel.pyx":217 * with nogil: * rc = c_ssh2.libssh2_channel_wait_closed(self._channel) * return rc # <<<<<<<<<<<<<< @@ -3753,13 +3734,13 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_30wait_closed(struct __pyx_obj * def get_exit_status(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 215, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/channel.pyx":210 + /* "ssh2/channel.pyx":212 * return rc * * def wait_closed(self): # <<<<<<<<<<<<<< @@ -3778,7 +3759,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_30wait_closed(struct __pyx_obj return __pyx_r; } -/* "ssh2/channel.pyx":217 +/* "ssh2/channel.pyx":219 * return rc * * def get_exit_status(self): # <<<<<<<<<<<<<< @@ -3807,7 +3788,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_32get_exit_status(struct __pyx PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("get_exit_status", 0); - /* "ssh2/channel.pyx":225 + /* "ssh2/channel.pyx":227 * ``0`` indicates failure or an actual exit status of ``0``""" * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -3822,7 +3803,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_32get_exit_status(struct __pyx #endif /*try:*/ { - /* "ssh2/channel.pyx":226 + /* "ssh2/channel.pyx":228 * cdef int rc * with nogil: * rc = c_ssh2.libssh2_channel_get_exit_status(self._channel) # <<<<<<<<<<<<<< @@ -3832,7 +3813,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_32get_exit_status(struct __pyx __pyx_v_rc = libssh2_channel_get_exit_status(__pyx_v_self->_channel); } - /* "ssh2/channel.pyx":225 + /* "ssh2/channel.pyx":227 * ``0`` indicates failure or an actual exit status of ``0``""" * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -3851,7 +3832,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_32get_exit_status(struct __pyx } } - /* "ssh2/channel.pyx":227 + /* "ssh2/channel.pyx":229 * with nogil: * rc = c_ssh2.libssh2_channel_get_exit_status(self._channel) * return rc # <<<<<<<<<<<<<< @@ -3859,13 +3840,13 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_32get_exit_status(struct __pyx * def get_exit_signal(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 227, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/channel.pyx":217 + /* "ssh2/channel.pyx":219 * return rc * * def get_exit_status(self): # <<<<<<<<<<<<<< @@ -3884,7 +3865,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_32get_exit_status(struct __pyx return __pyx_r; } -/* "ssh2/channel.pyx":229 +/* "ssh2/channel.pyx":231 * return rc * * def get_exit_signal(self): # <<<<<<<<<<<<<< @@ -3927,7 +3908,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_34get_exit_signal(struct __pyx PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("get_exit_signal", 0); - /* "ssh2/channel.pyx":235 + /* "ssh2/channel.pyx":237 * * :rtype: tuple(int, bytes, bytes, bytes)""" * cdef char *exitsignal = b'none' # <<<<<<<<<<<<<< @@ -3936,7 +3917,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_34get_exit_signal(struct __pyx */ __pyx_v_exitsignal = ((char *)((char *)"none")); - /* "ssh2/channel.pyx":236 + /* "ssh2/channel.pyx":238 * :rtype: tuple(int, bytes, bytes, bytes)""" * cdef char *exitsignal = b'none' * cdef size_t *exitsignal_len = 0 # <<<<<<<<<<<<<< @@ -3945,7 +3926,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_34get_exit_signal(struct __pyx */ __pyx_v_exitsignal_len = ((size_t *)0); - /* "ssh2/channel.pyx":237 + /* "ssh2/channel.pyx":239 * cdef char *exitsignal = b'none' * cdef size_t *exitsignal_len = 0 * cdef char *errmsg = b'none' # <<<<<<<<<<<<<< @@ -3954,7 +3935,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_34get_exit_signal(struct __pyx */ __pyx_v_errmsg = ((char *)((char *)"none")); - /* "ssh2/channel.pyx":238 + /* "ssh2/channel.pyx":240 * cdef size_t *exitsignal_len = 0 * cdef char *errmsg = b'none' * cdef size_t *errmsg_len = 0 # <<<<<<<<<<<<<< @@ -3963,7 +3944,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_34get_exit_signal(struct __pyx */ __pyx_v_errmsg_len = ((size_t *)0); - /* "ssh2/channel.pyx":239 + /* "ssh2/channel.pyx":241 * cdef char *errmsg = b'none' * cdef size_t *errmsg_len = 0 * cdef char *langtag = b'none' # <<<<<<<<<<<<<< @@ -3972,7 +3953,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_34get_exit_signal(struct __pyx */ __pyx_v_langtag = ((char *)((char *)"none")); - /* "ssh2/channel.pyx":240 + /* "ssh2/channel.pyx":242 * cdef size_t *errmsg_len = 0 * cdef char *langtag = b'none' * cdef size_t *langtag_len = 0 # <<<<<<<<<<<<<< @@ -3981,7 +3962,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_34get_exit_signal(struct __pyx */ __pyx_v_langtag_len = ((size_t *)0); - /* "ssh2/channel.pyx":242 + /* "ssh2/channel.pyx":244 * cdef size_t *langtag_len = 0 * cdef int rc * cdef bytes py_exitsignal = None # <<<<<<<<<<<<<< @@ -3991,7 +3972,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_34get_exit_signal(struct __pyx __Pyx_INCREF(Py_None); __pyx_v_py_exitsignal = ((PyObject*)Py_None); - /* "ssh2/channel.pyx":243 + /* "ssh2/channel.pyx":245 * cdef int rc * cdef bytes py_exitsignal = None * cdef bytes py_errmsg = None # <<<<<<<<<<<<<< @@ -4001,7 +3982,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_34get_exit_signal(struct __pyx __Pyx_INCREF(Py_None); __pyx_v_py_errmsg = ((PyObject*)Py_None); - /* "ssh2/channel.pyx":244 + /* "ssh2/channel.pyx":246 * cdef bytes py_exitsignal = None * cdef bytes py_errmsg = None * cdef bytes py_langtag = None # <<<<<<<<<<<<<< @@ -4011,7 +3992,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_34get_exit_signal(struct __pyx __Pyx_INCREF(Py_None); __pyx_v_py_langtag = ((PyObject*)Py_None); - /* "ssh2/channel.pyx":245 + /* "ssh2/channel.pyx":247 * cdef bytes py_errmsg = None * cdef bytes py_langtag = None * cdef size_t py_siglen = 0 # <<<<<<<<<<<<<< @@ -4020,7 +4001,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_34get_exit_signal(struct __pyx */ __pyx_v_py_siglen = 0; - /* "ssh2/channel.pyx":246 + /* "ssh2/channel.pyx":248 * cdef bytes py_langtag = None * cdef size_t py_siglen = 0 * cdef size_t py_errlen = 0 # <<<<<<<<<<<<<< @@ -4029,7 +4010,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_34get_exit_signal(struct __pyx */ __pyx_v_py_errlen = 0; - /* "ssh2/channel.pyx":247 + /* "ssh2/channel.pyx":249 * cdef size_t py_siglen = 0 * cdef size_t py_errlen = 0 * cdef size_t py_langlen = 0 # <<<<<<<<<<<<<< @@ -4038,7 +4019,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_34get_exit_signal(struct __pyx */ __pyx_v_py_langlen = 0; - /* "ssh2/channel.pyx":248 + /* "ssh2/channel.pyx":250 * cdef size_t py_errlen = 0 * cdef size_t py_langlen = 0 * with nogil: # <<<<<<<<<<<<<< @@ -4053,7 +4034,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_34get_exit_signal(struct __pyx #endif /*try:*/ { - /* "ssh2/channel.pyx":249 + /* "ssh2/channel.pyx":251 * cdef size_t py_langlen = 0 * with nogil: * rc = c_ssh2.libssh2_channel_get_exit_signal( # <<<<<<<<<<<<<< @@ -4062,7 +4043,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_34get_exit_signal(struct __pyx */ __pyx_v_rc = libssh2_channel_get_exit_signal(__pyx_v_self->_channel, (&__pyx_v_exitsignal), __pyx_v_exitsignal_len, (&__pyx_v_errmsg), __pyx_v_errmsg_len, (&__pyx_v_langtag), __pyx_v_langtag_len); - /* "ssh2/channel.pyx":252 + /* "ssh2/channel.pyx":254 * self._channel, &exitsignal, exitsignal_len, &errmsg, * errmsg_len, &langtag, langtag_len) * if exitsignal_len is not NULL: # <<<<<<<<<<<<<< @@ -4072,7 +4053,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_34get_exit_signal(struct __pyx __pyx_t_1 = ((__pyx_v_exitsignal_len != NULL) != 0); if (__pyx_t_1) { - /* "ssh2/channel.pyx":253 + /* "ssh2/channel.pyx":255 * errmsg_len, &langtag, langtag_len) * if exitsignal_len is not NULL: * py_siglen = exitsignal_len # <<<<<<<<<<<<<< @@ -4081,7 +4062,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_34get_exit_signal(struct __pyx */ __pyx_v_py_siglen = ((size_t)__pyx_v_exitsignal_len); - /* "ssh2/channel.pyx":252 + /* "ssh2/channel.pyx":254 * self._channel, &exitsignal, exitsignal_len, &errmsg, * errmsg_len, &langtag, langtag_len) * if exitsignal_len is not NULL: # <<<<<<<<<<<<<< @@ -4090,7 +4071,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_34get_exit_signal(struct __pyx */ } - /* "ssh2/channel.pyx":254 + /* "ssh2/channel.pyx":256 * if exitsignal_len is not NULL: * py_siglen = exitsignal_len * if errmsg_len is not NULL: # <<<<<<<<<<<<<< @@ -4100,7 +4081,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_34get_exit_signal(struct __pyx __pyx_t_1 = ((__pyx_v_errmsg_len != NULL) != 0); if (__pyx_t_1) { - /* "ssh2/channel.pyx":255 + /* "ssh2/channel.pyx":257 * py_siglen = exitsignal_len * if errmsg_len is not NULL: * py_errlen = errmsg_len # <<<<<<<<<<<<<< @@ -4109,7 +4090,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_34get_exit_signal(struct __pyx */ __pyx_v_py_errlen = ((size_t)__pyx_v_errmsg_len); - /* "ssh2/channel.pyx":254 + /* "ssh2/channel.pyx":256 * if exitsignal_len is not NULL: * py_siglen = exitsignal_len * if errmsg_len is not NULL: # <<<<<<<<<<<<<< @@ -4118,7 +4099,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_34get_exit_signal(struct __pyx */ } - /* "ssh2/channel.pyx":256 + /* "ssh2/channel.pyx":258 * if errmsg_len is not NULL: * py_errlen = errmsg_len * if langtag_len is not NULL: # <<<<<<<<<<<<<< @@ -4128,7 +4109,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_34get_exit_signal(struct __pyx __pyx_t_1 = ((__pyx_v_langtag_len != NULL) != 0); if (__pyx_t_1) { - /* "ssh2/channel.pyx":257 + /* "ssh2/channel.pyx":259 * py_errlen = errmsg_len * if langtag_len is not NULL: * py_langlen = langtag_len # <<<<<<<<<<<<<< @@ -4137,7 +4118,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_34get_exit_signal(struct __pyx */ __pyx_v_py_langlen = ((size_t)__pyx_v_langtag_len); - /* "ssh2/channel.pyx":256 + /* "ssh2/channel.pyx":258 * if errmsg_len is not NULL: * py_errlen = errmsg_len * if langtag_len is not NULL: # <<<<<<<<<<<<<< @@ -4147,7 +4128,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_34get_exit_signal(struct __pyx } } - /* "ssh2/channel.pyx":248 + /* "ssh2/channel.pyx":250 * cdef size_t py_errlen = 0 * cdef size_t py_langlen = 0 * with nogil: # <<<<<<<<<<<<<< @@ -4166,7 +4147,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_34get_exit_signal(struct __pyx } } - /* "ssh2/channel.pyx":258 + /* "ssh2/channel.pyx":260 * if langtag_len is not NULL: * py_langlen = langtag_len * if py_siglen > 0: # <<<<<<<<<<<<<< @@ -4176,19 +4157,19 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_34get_exit_signal(struct __pyx __pyx_t_1 = ((__pyx_v_py_siglen > 0) != 0); if (__pyx_t_1) { - /* "ssh2/channel.pyx":259 + /* "ssh2/channel.pyx":261 * py_langlen = langtag_len * if py_siglen > 0: * py_exitsignal = exitsignal[:py_siglen] # <<<<<<<<<<<<<< * if py_errlen > 0: * py_errmsg = errmsg[:py_errlen] */ - __pyx_t_2 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_exitsignal + 0, __pyx_v_py_siglen - 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 259, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_exitsignal + 0, __pyx_v_py_siglen - 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_py_exitsignal, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 0; - /* "ssh2/channel.pyx":258 + /* "ssh2/channel.pyx":260 * if langtag_len is not NULL: * py_langlen = langtag_len * if py_siglen > 0: # <<<<<<<<<<<<<< @@ -4197,7 +4178,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_34get_exit_signal(struct __pyx */ } - /* "ssh2/channel.pyx":260 + /* "ssh2/channel.pyx":262 * if py_siglen > 0: * py_exitsignal = exitsignal[:py_siglen] * if py_errlen > 0: # <<<<<<<<<<<<<< @@ -4207,19 +4188,19 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_34get_exit_signal(struct __pyx __pyx_t_1 = ((__pyx_v_py_errlen > 0) != 0); if (__pyx_t_1) { - /* "ssh2/channel.pyx":261 + /* "ssh2/channel.pyx":263 * py_exitsignal = exitsignal[:py_siglen] * if py_errlen > 0: * py_errmsg = errmsg[:py_errlen] # <<<<<<<<<<<<<< * if py_langlen > 0: * py_langtag = langtag[:py_langlen] */ - __pyx_t_2 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_errmsg + 0, __pyx_v_py_errlen - 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 261, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_errmsg + 0, __pyx_v_py_errlen - 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_py_errmsg, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 0; - /* "ssh2/channel.pyx":260 + /* "ssh2/channel.pyx":262 * if py_siglen > 0: * py_exitsignal = exitsignal[:py_siglen] * if py_errlen > 0: # <<<<<<<<<<<<<< @@ -4228,7 +4209,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_34get_exit_signal(struct __pyx */ } - /* "ssh2/channel.pyx":262 + /* "ssh2/channel.pyx":264 * if py_errlen > 0: * py_errmsg = errmsg[:py_errlen] * if py_langlen > 0: # <<<<<<<<<<<<<< @@ -4238,19 +4219,19 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_34get_exit_signal(struct __pyx __pyx_t_1 = ((__pyx_v_py_langlen > 0) != 0); if (__pyx_t_1) { - /* "ssh2/channel.pyx":263 + /* "ssh2/channel.pyx":265 * py_errmsg = errmsg[:py_errlen] * if py_langlen > 0: * py_langtag = langtag[:py_langlen] # <<<<<<<<<<<<<< * return rc, py_exitsignal, py_errmsg, py_langtag * */ - __pyx_t_2 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_langtag + 0, __pyx_v_py_langlen - 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 263, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_langtag + 0, __pyx_v_py_langlen - 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_py_langtag, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 0; - /* "ssh2/channel.pyx":262 + /* "ssh2/channel.pyx":264 * if py_errlen > 0: * py_errmsg = errmsg[:py_errlen] * if py_langlen > 0: # <<<<<<<<<<<<<< @@ -4259,7 +4240,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_34get_exit_signal(struct __pyx */ } - /* "ssh2/channel.pyx":264 + /* "ssh2/channel.pyx":266 * if py_langlen > 0: * py_langtag = langtag[:py_langlen] * return rc, py_exitsignal, py_errmsg, py_langtag # <<<<<<<<<<<<<< @@ -4267,9 +4248,9 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_34get_exit_signal(struct __pyx * def setenv(self, varname not None, value not None): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 264, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 264, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); @@ -4287,7 +4268,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_34get_exit_signal(struct __pyx __pyx_t_3 = 0; goto __pyx_L0; - /* "ssh2/channel.pyx":229 + /* "ssh2/channel.pyx":231 * return rc * * def get_exit_signal(self): # <<<<<<<<<<<<<< @@ -4310,7 +4291,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_34get_exit_signal(struct __pyx return __pyx_r; } -/* "ssh2/channel.pyx":266 +/* "ssh2/channel.pyx":268 * return rc, py_exitsignal, py_errmsg, py_langtag * * def setenv(self, varname not None, value not None): # <<<<<<<<<<<<<< @@ -4350,11 +4331,11 @@ static PyObject *__pyx_pw_4ssh2_7channel_7Channel_37setenv(PyObject *__pyx_v_sel case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("setenv", 1, 2, 2, 1); __PYX_ERR(0, 266, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("setenv", 1, 2, 2, 1); __PYX_ERR(0, 268, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setenv") < 0)) __PYX_ERR(0, 266, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setenv") < 0)) __PYX_ERR(0, 268, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -4367,17 +4348,17 @@ static PyObject *__pyx_pw_4ssh2_7channel_7Channel_37setenv(PyObject *__pyx_v_sel } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("setenv", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 266, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("setenv", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 268, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.channel.Channel.setenv", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(((PyObject *)__pyx_v_varname) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "varname"); __PYX_ERR(0, 266, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "varname"); __PYX_ERR(0, 268, __pyx_L1_error) } if (unlikely(((PyObject *)__pyx_v_value) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "value"); __PYX_ERR(0, 266, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "value"); __PYX_ERR(0, 268, __pyx_L1_error) } __pyx_r = __pyx_pf_4ssh2_7channel_7Channel_36setenv(((struct __pyx_obj_4ssh2_7channel_Channel *)__pyx_v_self), __pyx_v_varname, __pyx_v_value); @@ -4399,7 +4380,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_36setenv(struct __pyx_obj_4ssh PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("setenv", 0); - /* "ssh2/channel.pyx":276 + /* "ssh2/channel.pyx":278 * :rtype: int""" * cdef int rc * cdef char *_varname = to_bytes(varname) # <<<<<<<<<<<<<< @@ -4408,7 +4389,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_36setenv(struct __pyx_obj_4ssh */ __pyx_v__varname = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_varname); - /* "ssh2/channel.pyx":277 + /* "ssh2/channel.pyx":279 * cdef int rc * cdef char *_varname = to_bytes(varname) * cdef char *_value = to_bytes(value) # <<<<<<<<<<<<<< @@ -4417,7 +4398,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_36setenv(struct __pyx_obj_4ssh */ __pyx_v__value = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_value); - /* "ssh2/channel.pyx":278 + /* "ssh2/channel.pyx":280 * cdef char *_varname = to_bytes(varname) * cdef char *_value = to_bytes(value) * with nogil: # <<<<<<<<<<<<<< @@ -4432,7 +4413,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_36setenv(struct __pyx_obj_4ssh #endif /*try:*/ { - /* "ssh2/channel.pyx":279 + /* "ssh2/channel.pyx":281 * cdef char *_value = to_bytes(value) * with nogil: * rc = c_ssh2.libssh2_channel_setenv( # <<<<<<<<<<<<<< @@ -4442,7 +4423,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_36setenv(struct __pyx_obj_4ssh __pyx_v_rc = libssh2_channel_setenv(__pyx_v_self->_channel, __pyx_v__varname, __pyx_v__value); } - /* "ssh2/channel.pyx":278 + /* "ssh2/channel.pyx":280 * cdef char *_varname = to_bytes(varname) * cdef char *_value = to_bytes(value) * with nogil: # <<<<<<<<<<<<<< @@ -4461,7 +4442,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_36setenv(struct __pyx_obj_4ssh } } - /* "ssh2/channel.pyx":281 + /* "ssh2/channel.pyx":283 * rc = c_ssh2.libssh2_channel_setenv( * self._channel, _varname, _value) * return rc # <<<<<<<<<<<<<< @@ -4469,13 +4450,13 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_36setenv(struct __pyx_obj_4ssh * def window_read_ex(self, unsigned long read_avail, */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 281, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/channel.pyx":266 + /* "ssh2/channel.pyx":268 * return rc, py_exitsignal, py_errmsg, py_langtag * * def setenv(self, varname not None, value not None): # <<<<<<<<<<<<<< @@ -4494,7 +4475,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_36setenv(struct __pyx_obj_4ssh return __pyx_r; } -/* "ssh2/channel.pyx":283 +/* "ssh2/channel.pyx":285 * return rc * * def window_read_ex(self, unsigned long read_avail, # <<<<<<<<<<<<<< @@ -4534,11 +4515,11 @@ static PyObject *__pyx_pw_4ssh2_7channel_7Channel_39window_read_ex(PyObject *__p case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_window_size_initial)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("window_read_ex", 1, 2, 2, 1); __PYX_ERR(0, 283, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("window_read_ex", 1, 2, 2, 1); __PYX_ERR(0, 285, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "window_read_ex") < 0)) __PYX_ERR(0, 283, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "window_read_ex") < 0)) __PYX_ERR(0, 285, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -4546,12 +4527,12 @@ static PyObject *__pyx_pw_4ssh2_7channel_7Channel_39window_read_ex(PyObject *__p values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } - __pyx_v_read_avail = __Pyx_PyInt_As_unsigned_long(values[0]); if (unlikely((__pyx_v_read_avail == (unsigned long)-1) && PyErr_Occurred())) __PYX_ERR(0, 283, __pyx_L3_error) - __pyx_v_window_size_initial = __Pyx_PyInt_As_unsigned_long(values[1]); if (unlikely((__pyx_v_window_size_initial == (unsigned long)-1) && PyErr_Occurred())) __PYX_ERR(0, 284, __pyx_L3_error) + __pyx_v_read_avail = __Pyx_PyInt_As_unsigned_long(values[0]); if (unlikely((__pyx_v_read_avail == (unsigned long)-1) && PyErr_Occurred())) __PYX_ERR(0, 285, __pyx_L3_error) + __pyx_v_window_size_initial = __Pyx_PyInt_As_unsigned_long(values[1]); if (unlikely((__pyx_v_window_size_initial == (unsigned long)-1) && PyErr_Occurred())) __PYX_ERR(0, 286, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("window_read_ex", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 283, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("window_read_ex", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 285, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.channel.Channel.window_read_ex", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -4571,7 +4552,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_38window_read_ex(struct __pyx_ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("window_read_ex", 0); - /* "ssh2/channel.pyx":286 + /* "ssh2/channel.pyx":288 * unsigned long window_size_initial): * cdef unsigned long rc * with nogil: # <<<<<<<<<<<<<< @@ -4586,7 +4567,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_38window_read_ex(struct __pyx_ #endif /*try:*/ { - /* "ssh2/channel.pyx":287 + /* "ssh2/channel.pyx":289 * cdef unsigned long rc * with nogil: * rc = c_ssh2.libssh2_channel_window_read_ex( # <<<<<<<<<<<<<< @@ -4596,7 +4577,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_38window_read_ex(struct __pyx_ __pyx_v_rc = libssh2_channel_window_read_ex(__pyx_v_self->_channel, (&__pyx_v_read_avail), (&__pyx_v_window_size_initial)); } - /* "ssh2/channel.pyx":286 + /* "ssh2/channel.pyx":288 * unsigned long window_size_initial): * cdef unsigned long rc * with nogil: # <<<<<<<<<<<<<< @@ -4615,7 +4596,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_38window_read_ex(struct __pyx_ } } - /* "ssh2/channel.pyx":289 + /* "ssh2/channel.pyx":291 * rc = c_ssh2.libssh2_channel_window_read_ex( * self._channel, &read_avail, &window_size_initial) * return rc # <<<<<<<<<<<<<< @@ -4623,13 +4604,13 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_38window_read_ex(struct __pyx_ * def window_read(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_unsigned_long(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 289, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_unsigned_long(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 291, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/channel.pyx":283 + /* "ssh2/channel.pyx":285 * return rc * * def window_read_ex(self, unsigned long read_avail, # <<<<<<<<<<<<<< @@ -4648,7 +4629,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_38window_read_ex(struct __pyx_ return __pyx_r; } -/* "ssh2/channel.pyx":291 +/* "ssh2/channel.pyx":293 * return rc * * def window_read(self): # <<<<<<<<<<<<<< @@ -4677,7 +4658,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_40window_read(struct __pyx_obj PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("window_read", 0); - /* "ssh2/channel.pyx":293 + /* "ssh2/channel.pyx":295 * def window_read(self): * cdef unsigned long rc * with nogil: # <<<<<<<<<<<<<< @@ -4692,7 +4673,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_40window_read(struct __pyx_obj #endif /*try:*/ { - /* "ssh2/channel.pyx":294 + /* "ssh2/channel.pyx":296 * cdef unsigned long rc * with nogil: * rc = c_ssh2.libssh2_channel_window_read(self._channel) # <<<<<<<<<<<<<< @@ -4702,7 +4683,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_40window_read(struct __pyx_obj __pyx_v_rc = libssh2_channel_window_read(__pyx_v_self->_channel); } - /* "ssh2/channel.pyx":293 + /* "ssh2/channel.pyx":295 * def window_read(self): * cdef unsigned long rc * with nogil: # <<<<<<<<<<<<<< @@ -4721,7 +4702,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_40window_read(struct __pyx_obj } } - /* "ssh2/channel.pyx":295 + /* "ssh2/channel.pyx":297 * with nogil: * rc = c_ssh2.libssh2_channel_window_read(self._channel) * return rc # <<<<<<<<<<<<<< @@ -4729,13 +4710,13 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_40window_read(struct __pyx_obj * def window_write_ex(self, unsigned long window_size_initial): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_unsigned_long(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 295, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_unsigned_long(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 297, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/channel.pyx":291 + /* "ssh2/channel.pyx":293 * return rc * * def window_read(self): # <<<<<<<<<<<<<< @@ -4754,7 +4735,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_40window_read(struct __pyx_obj return __pyx_r; } -/* "ssh2/channel.pyx":297 +/* "ssh2/channel.pyx":299 * return rc * * def window_write_ex(self, unsigned long window_size_initial): # <<<<<<<<<<<<<< @@ -4771,7 +4752,7 @@ static PyObject *__pyx_pw_4ssh2_7channel_7Channel_43window_write_ex(PyObject *__ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("window_write_ex (wrapper)", 0); assert(__pyx_arg_window_size_initial); { - __pyx_v_window_size_initial = __Pyx_PyInt_As_unsigned_long(__pyx_arg_window_size_initial); if (unlikely((__pyx_v_window_size_initial == (unsigned long)-1) && PyErr_Occurred())) __PYX_ERR(0, 297, __pyx_L3_error) + __pyx_v_window_size_initial = __Pyx_PyInt_As_unsigned_long(__pyx_arg_window_size_initial); if (unlikely((__pyx_v_window_size_initial == (unsigned long)-1) && PyErr_Occurred())) __PYX_ERR(0, 299, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -4793,7 +4774,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_42window_write_ex(struct __pyx PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("window_write_ex", 0); - /* "ssh2/channel.pyx":299 + /* "ssh2/channel.pyx":301 * def window_write_ex(self, unsigned long window_size_initial): * cdef unsigned long rc * with nogil: # <<<<<<<<<<<<<< @@ -4808,7 +4789,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_42window_write_ex(struct __pyx #endif /*try:*/ { - /* "ssh2/channel.pyx":300 + /* "ssh2/channel.pyx":302 * cdef unsigned long rc * with nogil: * rc = c_ssh2.libssh2_channel_window_write_ex( # <<<<<<<<<<<<<< @@ -4818,7 +4799,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_42window_write_ex(struct __pyx __pyx_v_rc = libssh2_channel_window_write_ex(__pyx_v_self->_channel, (&__pyx_v_window_size_initial)); } - /* "ssh2/channel.pyx":299 + /* "ssh2/channel.pyx":301 * def window_write_ex(self, unsigned long window_size_initial): * cdef unsigned long rc * with nogil: # <<<<<<<<<<<<<< @@ -4837,7 +4818,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_42window_write_ex(struct __pyx } } - /* "ssh2/channel.pyx":302 + /* "ssh2/channel.pyx":304 * rc = c_ssh2.libssh2_channel_window_write_ex( * self._channel, &window_size_initial) * return rc # <<<<<<<<<<<<<< @@ -4845,13 +4826,13 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_42window_write_ex(struct __pyx * def window_write(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_unsigned_long(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 302, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_unsigned_long(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/channel.pyx":297 + /* "ssh2/channel.pyx":299 * return rc * * def window_write_ex(self, unsigned long window_size_initial): # <<<<<<<<<<<<<< @@ -4870,7 +4851,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_42window_write_ex(struct __pyx return __pyx_r; } -/* "ssh2/channel.pyx":304 +/* "ssh2/channel.pyx":306 * return rc * * def window_write(self): # <<<<<<<<<<<<<< @@ -4899,7 +4880,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_44window_write(struct __pyx_ob PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("window_write", 0); - /* "ssh2/channel.pyx":306 + /* "ssh2/channel.pyx":308 * def window_write(self): * cdef unsigned long rc * with nogil: # <<<<<<<<<<<<<< @@ -4914,7 +4895,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_44window_write(struct __pyx_ob #endif /*try:*/ { - /* "ssh2/channel.pyx":307 + /* "ssh2/channel.pyx":309 * cdef unsigned long rc * with nogil: * rc = c_ssh2.libssh2_channel_window_write(self._channel) # <<<<<<<<<<<<<< @@ -4924,7 +4905,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_44window_write(struct __pyx_ob __pyx_v_rc = libssh2_channel_window_write(__pyx_v_self->_channel); } - /* "ssh2/channel.pyx":306 + /* "ssh2/channel.pyx":308 * def window_write(self): * cdef unsigned long rc * with nogil: # <<<<<<<<<<<<<< @@ -4943,7 +4924,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_44window_write(struct __pyx_ob } } - /* "ssh2/channel.pyx":308 + /* "ssh2/channel.pyx":310 * with nogil: * rc = c_ssh2.libssh2_channel_window_write(self._channel) * return rc # <<<<<<<<<<<<<< @@ -4951,13 +4932,13 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_44window_write(struct __pyx_ob * def receive_window_adjust(self, unsigned long adjustment, */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_unsigned_long(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 308, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_unsigned_long(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 310, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/channel.pyx":304 + /* "ssh2/channel.pyx":306 * return rc * * def window_write(self): # <<<<<<<<<<<<<< @@ -4976,7 +4957,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_44window_write(struct __pyx_ob return __pyx_r; } -/* "ssh2/channel.pyx":310 +/* "ssh2/channel.pyx":312 * return rc * * def receive_window_adjust(self, unsigned long adjustment, # <<<<<<<<<<<<<< @@ -5016,11 +4997,11 @@ static PyObject *__pyx_pw_4ssh2_7channel_7Channel_47receive_window_adjust(PyObje case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_force)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("receive_window_adjust", 1, 2, 2, 1); __PYX_ERR(0, 310, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("receive_window_adjust", 1, 2, 2, 1); __PYX_ERR(0, 312, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "receive_window_adjust") < 0)) __PYX_ERR(0, 310, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "receive_window_adjust") < 0)) __PYX_ERR(0, 312, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -5028,12 +5009,12 @@ static PyObject *__pyx_pw_4ssh2_7channel_7Channel_47receive_window_adjust(PyObje values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } - __pyx_v_adjustment = __Pyx_PyInt_As_unsigned_long(values[0]); if (unlikely((__pyx_v_adjustment == (unsigned long)-1) && PyErr_Occurred())) __PYX_ERR(0, 310, __pyx_L3_error) - __pyx_v_force = __Pyx_PyInt_As_unsigned_long(values[1]); if (unlikely((__pyx_v_force == (unsigned long)-1) && PyErr_Occurred())) __PYX_ERR(0, 311, __pyx_L3_error) + __pyx_v_adjustment = __Pyx_PyInt_As_unsigned_long(values[0]); if (unlikely((__pyx_v_adjustment == (unsigned long)-1) && PyErr_Occurred())) __PYX_ERR(0, 312, __pyx_L3_error) + __pyx_v_force = __Pyx_PyInt_As_unsigned_long(values[1]); if (unlikely((__pyx_v_force == (unsigned long)-1) && PyErr_Occurred())) __PYX_ERR(0, 313, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("receive_window_adjust", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 310, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("receive_window_adjust", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 312, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.channel.Channel.receive_window_adjust", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -5053,7 +5034,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_46receive_window_adjust(struct PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("receive_window_adjust", 0); - /* "ssh2/channel.pyx":313 + /* "ssh2/channel.pyx":315 * unsigned long force): * cdef unsigned long rc * with nogil: # <<<<<<<<<<<<<< @@ -5068,7 +5049,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_46receive_window_adjust(struct #endif /*try:*/ { - /* "ssh2/channel.pyx":314 + /* "ssh2/channel.pyx":316 * cdef unsigned long rc * with nogil: * rc = c_ssh2.libssh2_channel_receive_window_adjust( # <<<<<<<<<<<<<< @@ -5078,7 +5059,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_46receive_window_adjust(struct __pyx_v_rc = libssh2_channel_receive_window_adjust(__pyx_v_self->_channel, __pyx_v_adjustment, __pyx_v_force); } - /* "ssh2/channel.pyx":313 + /* "ssh2/channel.pyx":315 * unsigned long force): * cdef unsigned long rc * with nogil: # <<<<<<<<<<<<<< @@ -5097,7 +5078,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_46receive_window_adjust(struct } } - /* "ssh2/channel.pyx":316 + /* "ssh2/channel.pyx":318 * rc = c_ssh2.libssh2_channel_receive_window_adjust( * self._channel, adjustment, force) * return rc # <<<<<<<<<<<<<< @@ -5105,13 +5086,13 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_46receive_window_adjust(struct * def receive_window_adjust2(self, unsigned long adjustment, */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_unsigned_long(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 316, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_unsigned_long(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/channel.pyx":310 + /* "ssh2/channel.pyx":312 * return rc * * def receive_window_adjust(self, unsigned long adjustment, # <<<<<<<<<<<<<< @@ -5130,7 +5111,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_46receive_window_adjust(struct return __pyx_r; } -/* "ssh2/channel.pyx":318 +/* "ssh2/channel.pyx":320 * return rc * * def receive_window_adjust2(self, unsigned long adjustment, # <<<<<<<<<<<<<< @@ -5170,11 +5151,11 @@ static PyObject *__pyx_pw_4ssh2_7channel_7Channel_49receive_window_adjust2(PyObj case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_force)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("receive_window_adjust2", 1, 2, 2, 1); __PYX_ERR(0, 318, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("receive_window_adjust2", 1, 2, 2, 1); __PYX_ERR(0, 320, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "receive_window_adjust2") < 0)) __PYX_ERR(0, 318, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "receive_window_adjust2") < 0)) __PYX_ERR(0, 320, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -5182,12 +5163,12 @@ static PyObject *__pyx_pw_4ssh2_7channel_7Channel_49receive_window_adjust2(PyObj values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } - __pyx_v_adjustment = __Pyx_PyInt_As_unsigned_long(values[0]); if (unlikely((__pyx_v_adjustment == (unsigned long)-1) && PyErr_Occurred())) __PYX_ERR(0, 318, __pyx_L3_error) - __pyx_v_force = __Pyx_PyInt_As_unsigned_long(values[1]); if (unlikely((__pyx_v_force == (unsigned long)-1) && PyErr_Occurred())) __PYX_ERR(0, 319, __pyx_L3_error) + __pyx_v_adjustment = __Pyx_PyInt_As_unsigned_long(values[0]); if (unlikely((__pyx_v_adjustment == (unsigned long)-1) && PyErr_Occurred())) __PYX_ERR(0, 320, __pyx_L3_error) + __pyx_v_force = __Pyx_PyInt_As_unsigned_long(values[1]); if (unlikely((__pyx_v_force == (unsigned long)-1) && PyErr_Occurred())) __PYX_ERR(0, 321, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("receive_window_adjust2", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 318, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("receive_window_adjust2", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 320, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.channel.Channel.receive_window_adjust2", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -5208,7 +5189,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_48receive_window_adjust2(struc PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("receive_window_adjust2", 0); - /* "ssh2/channel.pyx":321 + /* "ssh2/channel.pyx":323 * unsigned long force): * cdef unsigned long rc * cdef unsigned int storewindow = 0 # <<<<<<<<<<<<<< @@ -5217,7 +5198,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_48receive_window_adjust2(struc */ __pyx_v_storewindow = 0; - /* "ssh2/channel.pyx":322 + /* "ssh2/channel.pyx":324 * cdef unsigned long rc * cdef unsigned int storewindow = 0 * with nogil: # <<<<<<<<<<<<<< @@ -5232,7 +5213,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_48receive_window_adjust2(struc #endif /*try:*/ { - /* "ssh2/channel.pyx":323 + /* "ssh2/channel.pyx":325 * cdef unsigned int storewindow = 0 * with nogil: * rc = c_ssh2.libssh2_channel_receive_window_adjust2( # <<<<<<<<<<<<<< @@ -5242,7 +5223,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_48receive_window_adjust2(struc __pyx_v_rc = libssh2_channel_receive_window_adjust2(__pyx_v_self->_channel, __pyx_v_adjustment, __pyx_v_force, (&__pyx_v_storewindow)); } - /* "ssh2/channel.pyx":322 + /* "ssh2/channel.pyx":324 * cdef unsigned long rc * cdef unsigned int storewindow = 0 * with nogil: # <<<<<<<<<<<<<< @@ -5261,7 +5242,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_48receive_window_adjust2(struc } } - /* "ssh2/channel.pyx":325 + /* "ssh2/channel.pyx":327 * rc = c_ssh2.libssh2_channel_receive_window_adjust2( * self._channel, adjustment, force, &storewindow) * return rc # <<<<<<<<<<<<<< @@ -5269,13 +5250,13 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_48receive_window_adjust2(struc * def write(self, buf not None): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_unsigned_long(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 325, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_unsigned_long(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 327, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/channel.pyx":318 + /* "ssh2/channel.pyx":320 * return rc * * def receive_window_adjust2(self, unsigned long adjustment, # <<<<<<<<<<<<<< @@ -5294,7 +5275,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_48receive_window_adjust2(struc return __pyx_r; } -/* "ssh2/channel.pyx":327 +/* "ssh2/channel.pyx":329 * return rc * * def write(self, buf not None): # <<<<<<<<<<<<<< @@ -5310,7 +5291,7 @@ static PyObject *__pyx_pw_4ssh2_7channel_7Channel_51write(PyObject *__pyx_v_self __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("write (wrapper)", 0); if (unlikely(((PyObject *)__pyx_v_buf) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "buf"); __PYX_ERR(0, 327, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "buf"); __PYX_ERR(0, 329, __pyx_L1_error) } __pyx_r = __pyx_pf_4ssh2_7channel_7Channel_50write(((struct __pyx_obj_4ssh2_7channel_Channel *)__pyx_v_self), ((PyObject *)__pyx_v_buf)); @@ -5333,7 +5314,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_50write(struct __pyx_obj_4ssh2 PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("write", 0); - /* "ssh2/channel.pyx":334 + /* "ssh2/channel.pyx":336 * * :rtype: int""" * cdef const char *_buf = to_bytes(buf) # <<<<<<<<<<<<<< @@ -5342,7 +5323,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_50write(struct __pyx_obj_4ssh2 */ __pyx_v__buf = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_buf); - /* "ssh2/channel.pyx":335 + /* "ssh2/channel.pyx":337 * :rtype: int""" * cdef const char *_buf = to_bytes(buf) * cdef size_t buflen = len(_buf) # <<<<<<<<<<<<<< @@ -5352,7 +5333,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_50write(struct __pyx_obj_4ssh2 __pyx_t_1 = strlen(__pyx_v__buf); __pyx_v_buflen = __pyx_t_1; - /* "ssh2/channel.pyx":337 + /* "ssh2/channel.pyx":339 * cdef size_t buflen = len(_buf) * cdef ssize_t rc * with nogil: # <<<<<<<<<<<<<< @@ -5367,7 +5348,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_50write(struct __pyx_obj_4ssh2 #endif /*try:*/ { - /* "ssh2/channel.pyx":338 + /* "ssh2/channel.pyx":340 * cdef ssize_t rc * with nogil: * rc = c_ssh2.libssh2_channel_write(self._channel, _buf, buflen) # <<<<<<<<<<<<<< @@ -5377,7 +5358,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_50write(struct __pyx_obj_4ssh2 __pyx_v_rc = libssh2_channel_write(__pyx_v_self->_channel, __pyx_v__buf, __pyx_v_buflen); } - /* "ssh2/channel.pyx":337 + /* "ssh2/channel.pyx":339 * cdef size_t buflen = len(_buf) * cdef ssize_t rc * with nogil: # <<<<<<<<<<<<<< @@ -5396,7 +5377,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_50write(struct __pyx_obj_4ssh2 } } - /* "ssh2/channel.pyx":339 + /* "ssh2/channel.pyx":341 * with nogil: * rc = c_ssh2.libssh2_channel_write(self._channel, _buf, buflen) * return rc # <<<<<<<<<<<<<< @@ -5404,13 +5385,13 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_50write(struct __pyx_obj_4ssh2 * def write_ex(self, int stream_id, buf not None): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_rc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 339, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_rc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "ssh2/channel.pyx":327 + /* "ssh2/channel.pyx":329 * return rc * * def write(self, buf not None): # <<<<<<<<<<<<<< @@ -5429,7 +5410,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_50write(struct __pyx_obj_4ssh2 return __pyx_r; } -/* "ssh2/channel.pyx":341 +/* "ssh2/channel.pyx":343 * return rc * * def write_ex(self, int stream_id, buf not None): # <<<<<<<<<<<<<< @@ -5469,11 +5450,11 @@ static PyObject *__pyx_pw_4ssh2_7channel_7Channel_53write_ex(PyObject *__pyx_v_s case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_buf)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("write_ex", 1, 2, 2, 1); __PYX_ERR(0, 341, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("write_ex", 1, 2, 2, 1); __PYX_ERR(0, 343, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "write_ex") < 0)) __PYX_ERR(0, 341, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "write_ex") < 0)) __PYX_ERR(0, 343, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -5481,19 +5462,19 @@ static PyObject *__pyx_pw_4ssh2_7channel_7Channel_53write_ex(PyObject *__pyx_v_s values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } - __pyx_v_stream_id = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_stream_id == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 341, __pyx_L3_error) + __pyx_v_stream_id = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_stream_id == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 343, __pyx_L3_error) __pyx_v_buf = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("write_ex", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 341, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("write_ex", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 343, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.channel.Channel.write_ex", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(((PyObject *)__pyx_v_buf) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "buf"); __PYX_ERR(0, 341, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "buf"); __PYX_ERR(0, 343, __pyx_L1_error) } __pyx_r = __pyx_pf_4ssh2_7channel_7Channel_52write_ex(((struct __pyx_obj_4ssh2_7channel_Channel *)__pyx_v_self), __pyx_v_stream_id, __pyx_v_buf); @@ -5516,7 +5497,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_52write_ex(struct __pyx_obj_4s PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("write_ex", 0); - /* "ssh2/channel.pyx":350 + /* "ssh2/channel.pyx":352 * * :rtype: int""" * cdef const char *_buf = to_bytes(buf) # <<<<<<<<<<<<<< @@ -5525,7 +5506,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_52write_ex(struct __pyx_obj_4s */ __pyx_v__buf = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_buf); - /* "ssh2/channel.pyx":351 + /* "ssh2/channel.pyx":353 * :rtype: int""" * cdef const char *_buf = to_bytes(buf) * cdef size_t buflen = len(_buf) # <<<<<<<<<<<<<< @@ -5535,7 +5516,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_52write_ex(struct __pyx_obj_4s __pyx_t_1 = strlen(__pyx_v__buf); __pyx_v_buflen = __pyx_t_1; - /* "ssh2/channel.pyx":353 + /* "ssh2/channel.pyx":355 * cdef size_t buflen = len(_buf) * cdef ssize_t rc * with nogil: # <<<<<<<<<<<<<< @@ -5550,7 +5531,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_52write_ex(struct __pyx_obj_4s #endif /*try:*/ { - /* "ssh2/channel.pyx":354 + /* "ssh2/channel.pyx":356 * cdef ssize_t rc * with nogil: * rc = c_ssh2.libssh2_channel_write_ex( # <<<<<<<<<<<<<< @@ -5560,7 +5541,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_52write_ex(struct __pyx_obj_4s __pyx_v_rc = libssh2_channel_write_ex(__pyx_v_self->_channel, __pyx_v_stream_id, __pyx_v__buf, __pyx_v_buflen); } - /* "ssh2/channel.pyx":353 + /* "ssh2/channel.pyx":355 * cdef size_t buflen = len(_buf) * cdef ssize_t rc * with nogil: # <<<<<<<<<<<<<< @@ -5579,7 +5560,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_52write_ex(struct __pyx_obj_4s } } - /* "ssh2/channel.pyx":356 + /* "ssh2/channel.pyx":358 * rc = c_ssh2.libssh2_channel_write_ex( * self._channel, stream_id, _buf, buflen) * return rc # <<<<<<<<<<<<<< @@ -5587,13 +5568,13 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_52write_ex(struct __pyx_obj_4s * def write_stderr(self, buf not None): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_rc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 356, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_rc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 358, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "ssh2/channel.pyx":341 + /* "ssh2/channel.pyx":343 * return rc * * def write_ex(self, int stream_id, buf not None): # <<<<<<<<<<<<<< @@ -5612,7 +5593,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_52write_ex(struct __pyx_obj_4s return __pyx_r; } -/* "ssh2/channel.pyx":358 +/* "ssh2/channel.pyx":360 * return rc * * def write_stderr(self, buf not None): # <<<<<<<<<<<<<< @@ -5628,7 +5609,7 @@ static PyObject *__pyx_pw_4ssh2_7channel_7Channel_55write_stderr(PyObject *__pyx __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("write_stderr (wrapper)", 0); if (unlikely(((PyObject *)__pyx_v_buf) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "buf"); __PYX_ERR(0, 358, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "buf"); __PYX_ERR(0, 360, __pyx_L1_error) } __pyx_r = __pyx_pf_4ssh2_7channel_7Channel_54write_stderr(((struct __pyx_obj_4ssh2_7channel_Channel *)__pyx_v_self), ((PyObject *)__pyx_v_buf)); @@ -5651,7 +5632,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_54write_stderr(struct __pyx_ob PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("write_stderr", 0); - /* "ssh2/channel.pyx":365 + /* "ssh2/channel.pyx":367 * * :rtype: int""" * cdef const char *_buf = to_bytes(buf) # <<<<<<<<<<<<<< @@ -5660,7 +5641,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_54write_stderr(struct __pyx_ob */ __pyx_v__buf = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_buf); - /* "ssh2/channel.pyx":366 + /* "ssh2/channel.pyx":368 * :rtype: int""" * cdef const char *_buf = to_bytes(buf) * cdef size_t buflen = len(_buf) # <<<<<<<<<<<<<< @@ -5670,7 +5651,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_54write_stderr(struct __pyx_ob __pyx_t_1 = strlen(__pyx_v__buf); __pyx_v_buflen = __pyx_t_1; - /* "ssh2/channel.pyx":368 + /* "ssh2/channel.pyx":370 * cdef size_t buflen = len(_buf) * cdef ssize_t rc * with nogil: # <<<<<<<<<<<<<< @@ -5685,7 +5666,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_54write_stderr(struct __pyx_ob #endif /*try:*/ { - /* "ssh2/channel.pyx":369 + /* "ssh2/channel.pyx":371 * cdef ssize_t rc * with nogil: * rc = c_ssh2.libssh2_channel_write_stderr( # <<<<<<<<<<<<<< @@ -5695,7 +5676,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_54write_stderr(struct __pyx_ob __pyx_v_rc = libssh2_channel_write_stderr(__pyx_v_self->_channel, __pyx_v__buf, __pyx_v_buflen); } - /* "ssh2/channel.pyx":368 + /* "ssh2/channel.pyx":370 * cdef size_t buflen = len(_buf) * cdef ssize_t rc * with nogil: # <<<<<<<<<<<<<< @@ -5714,7 +5695,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_54write_stderr(struct __pyx_ob } } - /* "ssh2/channel.pyx":371 + /* "ssh2/channel.pyx":373 * rc = c_ssh2.libssh2_channel_write_stderr( * self._channel, _buf, buflen) * return rc # <<<<<<<<<<<<<< @@ -5722,13 +5703,13 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_54write_stderr(struct __pyx_ob * def x11_req(self, int screen_number): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_rc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 371, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_rc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 373, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "ssh2/channel.pyx":358 + /* "ssh2/channel.pyx":360 * return rc * * def write_stderr(self, buf not None): # <<<<<<<<<<<<<< @@ -5747,7 +5728,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_54write_stderr(struct __pyx_ob return __pyx_r; } -/* "ssh2/channel.pyx":373 +/* "ssh2/channel.pyx":375 * return rc * * def x11_req(self, int screen_number): # <<<<<<<<<<<<<< @@ -5764,7 +5745,7 @@ static PyObject *__pyx_pw_4ssh2_7channel_7Channel_57x11_req(PyObject *__pyx_v_se __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("x11_req (wrapper)", 0); assert(__pyx_arg_screen_number); { - __pyx_v_screen_number = __Pyx_PyInt_As_int(__pyx_arg_screen_number); if (unlikely((__pyx_v_screen_number == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 373, __pyx_L3_error) + __pyx_v_screen_number = __Pyx_PyInt_As_int(__pyx_arg_screen_number); if (unlikely((__pyx_v_screen_number == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 375, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -5786,7 +5767,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_56x11_req(struct __pyx_obj_4ss PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("x11_req", 0); - /* "ssh2/channel.pyx":375 + /* "ssh2/channel.pyx":377 * def x11_req(self, int screen_number): * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -5801,7 +5782,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_56x11_req(struct __pyx_obj_4ss #endif /*try:*/ { - /* "ssh2/channel.pyx":376 + /* "ssh2/channel.pyx":378 * cdef int rc * with nogil: * rc = c_ssh2.libssh2_channel_x11_req( # <<<<<<<<<<<<<< @@ -5811,7 +5792,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_56x11_req(struct __pyx_obj_4ss __pyx_v_rc = libssh2_channel_x11_req(__pyx_v_self->_channel, __pyx_v_screen_number); } - /* "ssh2/channel.pyx":375 + /* "ssh2/channel.pyx":377 * def x11_req(self, int screen_number): * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -5830,7 +5811,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_56x11_req(struct __pyx_obj_4ss } } - /* "ssh2/channel.pyx":378 + /* "ssh2/channel.pyx":380 * rc = c_ssh2.libssh2_channel_x11_req( * self._channel, screen_number) * return rc # <<<<<<<<<<<<<< @@ -5838,13 +5819,13 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_56x11_req(struct __pyx_obj_4ss * def x11_req_ex(self, int single_connection, */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 378, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/channel.pyx":373 + /* "ssh2/channel.pyx":375 * return rc * * def x11_req(self, int screen_number): # <<<<<<<<<<<<<< @@ -5863,7 +5844,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_56x11_req(struct __pyx_obj_4ss return __pyx_r; } -/* "ssh2/channel.pyx":380 +/* "ssh2/channel.pyx":382 * return rc * * def x11_req_ex(self, int single_connection, # <<<<<<<<<<<<<< @@ -5909,23 +5890,23 @@ static PyObject *__pyx_pw_4ssh2_7channel_7Channel_59x11_req_ex(PyObject *__pyx_v case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_auth_proto)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("x11_req_ex", 1, 4, 4, 1); __PYX_ERR(0, 380, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("x11_req_ex", 1, 4, 4, 1); __PYX_ERR(0, 382, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_auth_cookie)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("x11_req_ex", 1, 4, 4, 2); __PYX_ERR(0, 380, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("x11_req_ex", 1, 4, 4, 2); __PYX_ERR(0, 382, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_screen_number)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("x11_req_ex", 1, 4, 4, 3); __PYX_ERR(0, 380, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("x11_req_ex", 1, 4, 4, 3); __PYX_ERR(0, 382, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "x11_req_ex") < 0)) __PYX_ERR(0, 380, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "x11_req_ex") < 0)) __PYX_ERR(0, 382, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; @@ -5935,14 +5916,14 @@ static PyObject *__pyx_pw_4ssh2_7channel_7Channel_59x11_req_ex(PyObject *__pyx_v values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); } - __pyx_v_single_connection = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_single_connection == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 380, __pyx_L3_error) - __pyx_v_auth_proto = __Pyx_PyObject_AsString(values[1]); if (unlikely((!__pyx_v_auth_proto) && PyErr_Occurred())) __PYX_ERR(0, 381, __pyx_L3_error) - __pyx_v_auth_cookie = __Pyx_PyObject_AsString(values[2]); if (unlikely((!__pyx_v_auth_cookie) && PyErr_Occurred())) __PYX_ERR(0, 382, __pyx_L3_error) - __pyx_v_screen_number = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_screen_number == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 383, __pyx_L3_error) + __pyx_v_single_connection = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_single_connection == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 382, __pyx_L3_error) + __pyx_v_auth_proto = __Pyx_PyObject_AsString(values[1]); if (unlikely((!__pyx_v_auth_proto) && PyErr_Occurred())) __PYX_ERR(0, 383, __pyx_L3_error) + __pyx_v_auth_cookie = __Pyx_PyObject_AsString(values[2]); if (unlikely((!__pyx_v_auth_cookie) && PyErr_Occurred())) __PYX_ERR(0, 384, __pyx_L3_error) + __pyx_v_screen_number = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_screen_number == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 385, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("x11_req_ex", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 380, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("x11_req_ex", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 382, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.channel.Channel.x11_req_ex", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -5962,7 +5943,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_58x11_req_ex(struct __pyx_obj_ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("x11_req_ex", 0); - /* "ssh2/channel.pyx":385 + /* "ssh2/channel.pyx":387 * int screen_number): * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -5977,7 +5958,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_58x11_req_ex(struct __pyx_obj_ #endif /*try:*/ { - /* "ssh2/channel.pyx":386 + /* "ssh2/channel.pyx":388 * cdef int rc * with nogil: * rc = c_ssh2.libssh2_channel_x11_req_ex( # <<<<<<<<<<<<<< @@ -5987,7 +5968,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_58x11_req_ex(struct __pyx_obj_ __pyx_v_rc = libssh2_channel_x11_req_ex(__pyx_v_self->_channel, __pyx_v_single_connection, __pyx_v_auth_proto, __pyx_v_auth_cookie, __pyx_v_screen_number); } - /* "ssh2/channel.pyx":385 + /* "ssh2/channel.pyx":387 * int screen_number): * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -6006,7 +5987,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_58x11_req_ex(struct __pyx_obj_ } } - /* "ssh2/channel.pyx":389 + /* "ssh2/channel.pyx":391 * self._channel, single_connection, * auth_proto, auth_cookie, screen_number) * return rc # <<<<<<<<<<<<<< @@ -6014,13 +5995,13 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_58x11_req_ex(struct __pyx_obj_ * def process_startup(self, request, message): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 389, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 391, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/channel.pyx":380 + /* "ssh2/channel.pyx":382 * return rc * * def x11_req_ex(self, int single_connection, # <<<<<<<<<<<<<< @@ -6039,7 +6020,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_58x11_req_ex(struct __pyx_obj_ return __pyx_r; } -/* "ssh2/channel.pyx":391 +/* "ssh2/channel.pyx":393 * return rc * * def process_startup(self, request, message): # <<<<<<<<<<<<<< @@ -6079,11 +6060,11 @@ static PyObject *__pyx_pw_4ssh2_7channel_7Channel_61process_startup(PyObject *__ case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_message)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("process_startup", 1, 2, 2, 1); __PYX_ERR(0, 391, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("process_startup", 1, 2, 2, 1); __PYX_ERR(0, 393, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "process_startup") < 0)) __PYX_ERR(0, 391, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "process_startup") < 0)) __PYX_ERR(0, 393, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -6096,7 +6077,7 @@ static PyObject *__pyx_pw_4ssh2_7channel_7Channel_61process_startup(PyObject *__ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("process_startup", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 391, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("process_startup", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 393, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.channel.Channel.process_startup", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -6121,7 +6102,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_60process_startup(struct __pyx PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("process_startup", 0); - /* "ssh2/channel.pyx":396 + /* "ssh2/channel.pyx":398 * Request is a supported SSH subsystem and clients would typically use * one of execute/shell/subsystem functions depending on request type.""" * cdef char *_request = to_bytes(request) # <<<<<<<<<<<<<< @@ -6130,7 +6111,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_60process_startup(struct __pyx */ __pyx_v__request = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_request); - /* "ssh2/channel.pyx":397 + /* "ssh2/channel.pyx":399 * one of execute/shell/subsystem functions depending on request type.""" * cdef char *_request = to_bytes(request) * cdef char *_message = to_bytes(message) # <<<<<<<<<<<<<< @@ -6139,7 +6120,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_60process_startup(struct __pyx */ __pyx_v__message = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_message); - /* "ssh2/channel.pyx":398 + /* "ssh2/channel.pyx":400 * cdef char *_request = to_bytes(request) * cdef char *_message = to_bytes(message) * cdef size_t r_len = len(_request) # <<<<<<<<<<<<<< @@ -6149,7 +6130,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_60process_startup(struct __pyx __pyx_t_1 = strlen(__pyx_v__request); __pyx_v_r_len = __pyx_t_1; - /* "ssh2/channel.pyx":399 + /* "ssh2/channel.pyx":401 * cdef char *_message = to_bytes(message) * cdef size_t r_len = len(_request) * cdef size_t m_len = len(_message) # <<<<<<<<<<<<<< @@ -6159,7 +6140,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_60process_startup(struct __pyx __pyx_t_1 = strlen(__pyx_v__message); __pyx_v_m_len = __pyx_t_1; - /* "ssh2/channel.pyx":401 + /* "ssh2/channel.pyx":403 * cdef size_t m_len = len(_message) * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -6174,7 +6155,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_60process_startup(struct __pyx #endif /*try:*/ { - /* "ssh2/channel.pyx":402 + /* "ssh2/channel.pyx":404 * cdef int rc * with nogil: * rc = c_ssh2.libssh2_channel_process_startup( # <<<<<<<<<<<<<< @@ -6184,7 +6165,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_60process_startup(struct __pyx __pyx_v_rc = libssh2_channel_process_startup(__pyx_v_self->_channel, __pyx_v__request, __pyx_v_r_len, __pyx_v__message, __pyx_v_m_len); } - /* "ssh2/channel.pyx":401 + /* "ssh2/channel.pyx":403 * cdef size_t m_len = len(_message) * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -6203,7 +6184,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_60process_startup(struct __pyx } } - /* "ssh2/channel.pyx":404 + /* "ssh2/channel.pyx":406 * rc = c_ssh2.libssh2_channel_process_startup( * self._channel, _request, r_len, _message, m_len) * return rc # <<<<<<<<<<<<<< @@ -6211,13 +6192,13 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_60process_startup(struct __pyx * def poll_channel_read(self, int extended): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 404, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 406, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "ssh2/channel.pyx":391 + /* "ssh2/channel.pyx":393 * return rc * * def process_startup(self, request, message): # <<<<<<<<<<<<<< @@ -6236,7 +6217,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_60process_startup(struct __pyx return __pyx_r; } -/* "ssh2/channel.pyx":406 +/* "ssh2/channel.pyx":408 * return rc * * def poll_channel_read(self, int extended): # <<<<<<<<<<<<<< @@ -6253,7 +6234,7 @@ static PyObject *__pyx_pw_4ssh2_7channel_7Channel_63poll_channel_read(PyObject * __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("poll_channel_read (wrapper)", 0); assert(__pyx_arg_extended); { - __pyx_v_extended = __Pyx_PyInt_As_int(__pyx_arg_extended); if (unlikely((__pyx_v_extended == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 406, __pyx_L3_error) + __pyx_v_extended = __Pyx_PyInt_As_int(__pyx_arg_extended); if (unlikely((__pyx_v_extended == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 408, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -6275,7 +6256,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_62poll_channel_read(struct __p PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("poll_channel_read", 0); - /* "ssh2/channel.pyx":409 + /* "ssh2/channel.pyx":411 * """Deprecated - use blockdirections and socket polling instead""" * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -6290,7 +6271,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_62poll_channel_read(struct __p #endif /*try:*/ { - /* "ssh2/channel.pyx":410 + /* "ssh2/channel.pyx":412 * cdef int rc * with nogil: * rc = c_ssh2.libssh2_poll_channel_read(self._channel, extended) # <<<<<<<<<<<<<< @@ -6300,7 +6281,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_62poll_channel_read(struct __p __pyx_v_rc = libssh2_poll_channel_read(__pyx_v_self->_channel, __pyx_v_extended); } - /* "ssh2/channel.pyx":409 + /* "ssh2/channel.pyx":411 * """Deprecated - use blockdirections and socket polling instead""" * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -6319,7 +6300,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_62poll_channel_read(struct __p } } - /* "ssh2/channel.pyx":411 + /* "ssh2/channel.pyx":413 * with nogil: * rc = c_ssh2.libssh2_poll_channel_read(self._channel, extended) * return rc # <<<<<<<<<<<<<< @@ -6327,13 +6308,13 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_62poll_channel_read(struct __p * def handle_extended_data(self, int ignore_mode): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 411, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 413, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/channel.pyx":406 + /* "ssh2/channel.pyx":408 * return rc * * def poll_channel_read(self, int extended): # <<<<<<<<<<<<<< @@ -6352,7 +6333,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_62poll_channel_read(struct __p return __pyx_r; } -/* "ssh2/channel.pyx":413 +/* "ssh2/channel.pyx":415 * return rc * * def handle_extended_data(self, int ignore_mode): # <<<<<<<<<<<<<< @@ -6369,7 +6350,7 @@ static PyObject *__pyx_pw_4ssh2_7channel_7Channel_65handle_extended_data(PyObjec __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("handle_extended_data (wrapper)", 0); assert(__pyx_arg_ignore_mode); { - __pyx_v_ignore_mode = __Pyx_PyInt_As_int(__pyx_arg_ignore_mode); if (unlikely((__pyx_v_ignore_mode == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 413, __pyx_L3_error) + __pyx_v_ignore_mode = __Pyx_PyInt_As_int(__pyx_arg_ignore_mode); if (unlikely((__pyx_v_ignore_mode == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 415, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -6389,7 +6370,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_64handle_extended_data(struct __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("handle_extended_data", 0); - /* "ssh2/channel.pyx":415 + /* "ssh2/channel.pyx":417 * def handle_extended_data(self, int ignore_mode): * """Deprecated, use handle_extended_data2""" * with nogil: # <<<<<<<<<<<<<< @@ -6404,7 +6385,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_64handle_extended_data(struct #endif /*try:*/ { - /* "ssh2/channel.pyx":416 + /* "ssh2/channel.pyx":418 * """Deprecated, use handle_extended_data2""" * with nogil: * c_ssh2.libssh2_channel_handle_extended_data( # <<<<<<<<<<<<<< @@ -6414,7 +6395,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_64handle_extended_data(struct libssh2_channel_handle_extended_data(__pyx_v_self->_channel, __pyx_v_ignore_mode); } - /* "ssh2/channel.pyx":415 + /* "ssh2/channel.pyx":417 * def handle_extended_data(self, int ignore_mode): * """Deprecated, use handle_extended_data2""" * with nogil: # <<<<<<<<<<<<<< @@ -6433,7 +6414,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_64handle_extended_data(struct } } - /* "ssh2/channel.pyx":413 + /* "ssh2/channel.pyx":415 * return rc * * def handle_extended_data(self, int ignore_mode): # <<<<<<<<<<<<<< @@ -6448,7 +6429,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_64handle_extended_data(struct return __pyx_r; } -/* "ssh2/channel.pyx":419 +/* "ssh2/channel.pyx":421 * self._channel, ignore_mode) * * def handle_extended_data2(self, int ignore_mode): # <<<<<<<<<<<<<< @@ -6465,7 +6446,7 @@ static PyObject *__pyx_pw_4ssh2_7channel_7Channel_67handle_extended_data2(PyObje __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("handle_extended_data2 (wrapper)", 0); assert(__pyx_arg_ignore_mode); { - __pyx_v_ignore_mode = __Pyx_PyInt_As_int(__pyx_arg_ignore_mode); if (unlikely((__pyx_v_ignore_mode == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 419, __pyx_L3_error) + __pyx_v_ignore_mode = __Pyx_PyInt_As_int(__pyx_arg_ignore_mode); if (unlikely((__pyx_v_ignore_mode == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 421, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -6487,7 +6468,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_66handle_extended_data2(struct PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("handle_extended_data2", 0); - /* "ssh2/channel.pyx":421 + /* "ssh2/channel.pyx":423 * def handle_extended_data2(self, int ignore_mode): * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -6502,7 +6483,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_66handle_extended_data2(struct #endif /*try:*/ { - /* "ssh2/channel.pyx":422 + /* "ssh2/channel.pyx":424 * cdef int rc * with nogil: * rc = c_ssh2.libssh2_channel_handle_extended_data2( # <<<<<<<<<<<<<< @@ -6512,7 +6493,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_66handle_extended_data2(struct __pyx_v_rc = libssh2_channel_handle_extended_data2(__pyx_v_self->_channel, __pyx_v_ignore_mode); } - /* "ssh2/channel.pyx":421 + /* "ssh2/channel.pyx":423 * def handle_extended_data2(self, int ignore_mode): * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -6531,7 +6512,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_66handle_extended_data2(struct } } - /* "ssh2/channel.pyx":424 + /* "ssh2/channel.pyx":426 * rc = c_ssh2.libssh2_channel_handle_extended_data2( * self._channel, ignore_mode) * return rc # <<<<<<<<<<<<<< @@ -6539,13 +6520,13 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_66handle_extended_data2(struct * def ignore_extended_data(self, int ignore_mode): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 424, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 426, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/channel.pyx":419 + /* "ssh2/channel.pyx":421 * self._channel, ignore_mode) * * def handle_extended_data2(self, int ignore_mode): # <<<<<<<<<<<<<< @@ -6564,7 +6545,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_66handle_extended_data2(struct return __pyx_r; } -/* "ssh2/channel.pyx":426 +/* "ssh2/channel.pyx":428 * return rc * * def ignore_extended_data(self, int ignore_mode): # <<<<<<<<<<<<<< @@ -6581,7 +6562,7 @@ static PyObject *__pyx_pw_4ssh2_7channel_7Channel_69ignore_extended_data(PyObjec __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("ignore_extended_data (wrapper)", 0); assert(__pyx_arg_ignore_mode); { - __pyx_v_ignore_mode = __Pyx_PyInt_As_int(__pyx_arg_ignore_mode); if (unlikely((__pyx_v_ignore_mode == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 426, __pyx_L3_error) + __pyx_v_ignore_mode = __Pyx_PyInt_As_int(__pyx_arg_ignore_mode); if (unlikely((__pyx_v_ignore_mode == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 428, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -6601,7 +6582,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_68ignore_extended_data(struct __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("ignore_extended_data", 0); - /* "ssh2/channel.pyx":428 + /* "ssh2/channel.pyx":430 * def ignore_extended_data(self, int ignore_mode): * """Deprecated, use handle_extended_data2""" * with nogil: # <<<<<<<<<<<<<< @@ -6616,7 +6597,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_68ignore_extended_data(struct #endif /*try:*/ { - /* "ssh2/channel.pyx":429 + /* "ssh2/channel.pyx":431 * """Deprecated, use handle_extended_data2""" * with nogil: * c_ssh2.libssh2_channel_handle_extended_data( # <<<<<<<<<<<<<< @@ -6625,7 +6606,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_68ignore_extended_data(struct libssh2_channel_handle_extended_data(__pyx_v_self->_channel, __pyx_v_ignore_mode); } - /* "ssh2/channel.pyx":428 + /* "ssh2/channel.pyx":430 * def ignore_extended_data(self, int ignore_mode): * """Deprecated, use handle_extended_data2""" * with nogil: # <<<<<<<<<<<<<< @@ -6644,7 +6625,7 @@ static PyObject *__pyx_pf_4ssh2_7channel_7Channel_68ignore_extended_data(struct } } - /* "ssh2/channel.pyx":426 + /* "ssh2/channel.pyx":428 * return rc * * def ignore_extended_data(self, int ignore_mode): # <<<<<<<<<<<<<< @@ -6979,7 +6960,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {0, 0, 0, 0, 0, 0, 0} }; static int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(0, 122, __pyx_L1_error) + __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(0, 124, __pyx_L1_error) __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error) return 0; __pyx_L1_error:; @@ -7110,10 +7091,10 @@ PyMODINIT_FUNC PyInit_channel(void) /*--- Function export code ---*/ if (__Pyx_ExportFunction("PyChannel", (void (*)(void))__pyx_f_4ssh2_7channel_PyChannel, "PyObject *(LIBSSH2_CHANNEL *, struct __pyx_obj_4ssh2_7session_Session *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Type init code ---*/ - if (PyType_Ready(&__pyx_type_4ssh2_7channel_Channel) < 0) __PYX_ERR(0, 34, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_4ssh2_7channel_Channel) < 0) __PYX_ERR(0, 36, __pyx_L1_error) __pyx_type_4ssh2_7channel_Channel.tp_print = 0; - if (PyObject_SetAttrString(__pyx_m, "Channel", (PyObject *)&__pyx_type_4ssh2_7channel_Channel) < 0) __PYX_ERR(0, 34, __pyx_L1_error) - if (__Pyx_setup_reduce((PyObject*)&__pyx_type_4ssh2_7channel_Channel) < 0) __PYX_ERR(0, 34, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "Channel", (PyObject *)&__pyx_type_4ssh2_7channel_Channel) < 0) __PYX_ERR(0, 36, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_4ssh2_7channel_Channel) < 0) __PYX_ERR(0, 36, __pyx_L1_error) __pyx_ptype_4ssh2_7channel_Channel = &__pyx_type_4ssh2_7channel_Channel; /*--- Type import code ---*/ __pyx_ptype_4ssh2_7session_Session = __Pyx_ImportType("ssh2.session", "Session", sizeof(struct __pyx_obj_4ssh2_7session_Session), 1); if (unlikely(!__pyx_ptype_4ssh2_7session_Session)) __PYX_ERR(2, 20, __pyx_L1_error) diff --git a/ssh2/channel.pyx b/ssh2/channel.pyx index 9d7c6655..5329c3c4 100644 --- a/ssh2/channel.pyx +++ b/ssh2/channel.pyx @@ -14,6 +14,8 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# cython: embedsignature=True, boundscheck=False, optimize.use_switch=True, wraparound=False + from libc.stdlib cimport malloc, free cimport c_ssh2 diff --git a/ssh2/error_codes.c b/ssh2/error_codes.c index 9dd66071..88e4e5f1 100644 --- a/ssh2/error_codes.c +++ b/ssh2/error_codes.c @@ -1,24 +1,5 @@ /* Generated by Cython 0.26 */ -/* BEGIN: Cython Metadata -{ - "distutils": { - "depends": [], - "extra_compile_args": [ - "-ggdb" - ], - "libraries": [ - "ssh2" - ], - "name": "ssh2.error_codes", - "sources": [ - "ssh2/error_codes.pyx" - ] - }, - "module_name": "ssh2.error_codes" -} -END: Cython Metadata */ - #define PY_SSIZE_T_CLEAN #include "Python.h" #ifndef Py_PYTHON_H @@ -1011,121 +992,121 @@ PyMODINIT_FUNC PyInit_error_codes(void) if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif - /* "ssh2/error_codes.pyx":21 + /* "ssh2/error_codes.pyx":23 * * * LIBSSH2_ERROR_NONE = error_codes._LIBSSH2_ERROR_NONE # <<<<<<<<<<<<<< * LIBSSH2_ERROR_NONE = error_codes._LIBSSH2_ERROR_NONE * LIBSSH2CHANNEL_EAGAIN = error_codes._LIBSSH2CHANNEL_EAGAIN */ - __pyx_t_1 = __Pyx_PyInt_From_int(LIBSSH2_ERROR_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 21, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(LIBSSH2_ERROR_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_ERROR_NONE, __pyx_t_1) < 0) __PYX_ERR(0, 21, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_ERROR_NONE, __pyx_t_1) < 0) __PYX_ERR(0, 23, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/error_codes.pyx":22 + /* "ssh2/error_codes.pyx":24 * * LIBSSH2_ERROR_NONE = error_codes._LIBSSH2_ERROR_NONE * LIBSSH2_ERROR_NONE = error_codes._LIBSSH2_ERROR_NONE # <<<<<<<<<<<<<< * LIBSSH2CHANNEL_EAGAIN = error_codes._LIBSSH2CHANNEL_EAGAIN * LIBSSH2_ERROR_EAGAIN = error_codes._LIBSSH2_ERROR_EAGAIN */ - __pyx_t_1 = __Pyx_PyInt_From_int(LIBSSH2_ERROR_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 22, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(LIBSSH2_ERROR_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_ERROR_NONE, __pyx_t_1) < 0) __PYX_ERR(0, 22, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_ERROR_NONE, __pyx_t_1) < 0) __PYX_ERR(0, 24, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/error_codes.pyx":23 + /* "ssh2/error_codes.pyx":25 * LIBSSH2_ERROR_NONE = error_codes._LIBSSH2_ERROR_NONE * LIBSSH2_ERROR_NONE = error_codes._LIBSSH2_ERROR_NONE * LIBSSH2CHANNEL_EAGAIN = error_codes._LIBSSH2CHANNEL_EAGAIN # <<<<<<<<<<<<<< * LIBSSH2_ERROR_EAGAIN = error_codes._LIBSSH2_ERROR_EAGAIN * LIBSSH2_ERROR_AUTHENTICATION_FAILED = error_codes._LIBSSH2_ERROR_AUTHENTICATION_FAILED */ - __pyx_t_1 = __Pyx_PyInt_From_int(LIBSSH2_ERROR_EAGAIN); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 23, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(LIBSSH2_ERROR_EAGAIN); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2CHANNEL_EAGAIN, __pyx_t_1) < 0) __PYX_ERR(0, 23, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2CHANNEL_EAGAIN, __pyx_t_1) < 0) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/error_codes.pyx":24 + /* "ssh2/error_codes.pyx":26 * LIBSSH2_ERROR_NONE = error_codes._LIBSSH2_ERROR_NONE * LIBSSH2CHANNEL_EAGAIN = error_codes._LIBSSH2CHANNEL_EAGAIN * LIBSSH2_ERROR_EAGAIN = error_codes._LIBSSH2_ERROR_EAGAIN # <<<<<<<<<<<<<< * LIBSSH2_ERROR_AUTHENTICATION_FAILED = error_codes._LIBSSH2_ERROR_AUTHENTICATION_FAILED * LIBSSH2_ERROR_SOCKET_RECV = error_codes._LIBSSH2_ERROR_SOCKET_RECV */ - __pyx_t_1 = __Pyx_PyInt_From_int(LIBSSH2_ERROR_EAGAIN); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 24, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(LIBSSH2_ERROR_EAGAIN); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_ERROR_EAGAIN, __pyx_t_1) < 0) __PYX_ERR(0, 24, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_ERROR_EAGAIN, __pyx_t_1) < 0) __PYX_ERR(0, 26, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/error_codes.pyx":25 + /* "ssh2/error_codes.pyx":27 * LIBSSH2CHANNEL_EAGAIN = error_codes._LIBSSH2CHANNEL_EAGAIN * LIBSSH2_ERROR_EAGAIN = error_codes._LIBSSH2_ERROR_EAGAIN * LIBSSH2_ERROR_AUTHENTICATION_FAILED = error_codes._LIBSSH2_ERROR_AUTHENTICATION_FAILED # <<<<<<<<<<<<<< * LIBSSH2_ERROR_SOCKET_RECV = error_codes._LIBSSH2_ERROR_SOCKET_RECV * LIBSSH2_SESSION_BLOCK_INBOUND = c_ssh2._LIBSSH2_SESSION_BLOCK_INBOUND */ - __pyx_t_1 = __Pyx_PyInt_From_int(LIBSSH2_ERROR_AUTHENTICATION_FAILED); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 25, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(LIBSSH2_ERROR_AUTHENTICATION_FAILED); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_ERROR_AUTHENTICATION_FAI, __pyx_t_1) < 0) __PYX_ERR(0, 25, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_ERROR_AUTHENTICATION_FAI, __pyx_t_1) < 0) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/error_codes.pyx":26 + /* "ssh2/error_codes.pyx":28 * LIBSSH2_ERROR_EAGAIN = error_codes._LIBSSH2_ERROR_EAGAIN * LIBSSH2_ERROR_AUTHENTICATION_FAILED = error_codes._LIBSSH2_ERROR_AUTHENTICATION_FAILED * LIBSSH2_ERROR_SOCKET_RECV = error_codes._LIBSSH2_ERROR_SOCKET_RECV # <<<<<<<<<<<<<< * LIBSSH2_SESSION_BLOCK_INBOUND = c_ssh2._LIBSSH2_SESSION_BLOCK_INBOUND * LIBSSH2_SESSION_BLOCK_OUTBOUND = c_ssh2._LIBSSH2_SESSION_BLOCK_OUTBOUND */ - __pyx_t_1 = __Pyx_PyInt_From_int(LIBSSH2_ERROR_SOCKET_RECV); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 26, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(LIBSSH2_ERROR_SOCKET_RECV); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_ERROR_SOCKET_RECV, __pyx_t_1) < 0) __PYX_ERR(0, 26, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_ERROR_SOCKET_RECV, __pyx_t_1) < 0) __PYX_ERR(0, 28, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/error_codes.pyx":27 + /* "ssh2/error_codes.pyx":29 * LIBSSH2_ERROR_AUTHENTICATION_FAILED = error_codes._LIBSSH2_ERROR_AUTHENTICATION_FAILED * LIBSSH2_ERROR_SOCKET_RECV = error_codes._LIBSSH2_ERROR_SOCKET_RECV * LIBSSH2_SESSION_BLOCK_INBOUND = c_ssh2._LIBSSH2_SESSION_BLOCK_INBOUND # <<<<<<<<<<<<<< * LIBSSH2_SESSION_BLOCK_OUTBOUND = c_ssh2._LIBSSH2_SESSION_BLOCK_OUTBOUND * # LIBSSH2_CHANNEL_FLUSH_EXTENDED_DATA = c_ssh2._LIBSSH2_CHANNEL_FLUSH_EXTENDED_DATA */ - __pyx_t_1 = __Pyx_PyInt_From_int(LIBSSH2_SESSION_BLOCK_INBOUND); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 27, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(LIBSSH2_SESSION_BLOCK_INBOUND); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_SESSION_BLOCK_INBOUND, __pyx_t_1) < 0) __PYX_ERR(0, 27, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_SESSION_BLOCK_INBOUND, __pyx_t_1) < 0) __PYX_ERR(0, 29, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/error_codes.pyx":28 + /* "ssh2/error_codes.pyx":30 * LIBSSH2_ERROR_SOCKET_RECV = error_codes._LIBSSH2_ERROR_SOCKET_RECV * LIBSSH2_SESSION_BLOCK_INBOUND = c_ssh2._LIBSSH2_SESSION_BLOCK_INBOUND * LIBSSH2_SESSION_BLOCK_OUTBOUND = c_ssh2._LIBSSH2_SESSION_BLOCK_OUTBOUND # <<<<<<<<<<<<<< * # LIBSSH2_CHANNEL_FLUSH_EXTENDED_DATA = c_ssh2._LIBSSH2_CHANNEL_FLUSH_EXTENDED_DATA * # LIBSSH2_CHANNEL_FLUSH_ALL = c_ssh2._LIBSSH2_CHANNEL_FLUSH_ALL */ - __pyx_t_1 = __Pyx_PyInt_From_int(LIBSSH2_SESSION_BLOCK_OUTBOUND); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 28, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(LIBSSH2_SESSION_BLOCK_OUTBOUND); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_SESSION_BLOCK_OUTBOUND, __pyx_t_1) < 0) __PYX_ERR(0, 28, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_SESSION_BLOCK_OUTBOUND, __pyx_t_1) < 0) __PYX_ERR(0, 30, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/error_codes.pyx":31 + /* "ssh2/error_codes.pyx":33 * # LIBSSH2_CHANNEL_FLUSH_EXTENDED_DATA = c_ssh2._LIBSSH2_CHANNEL_FLUSH_EXTENDED_DATA * # LIBSSH2_CHANNEL_FLUSH_ALL = c_ssh2._LIBSSH2_CHANNEL_FLUSH_ALL * LIBSSH2_ERROR_TIMEOUT = error_codes._LIBSSH2_ERROR_TIMEOUT # <<<<<<<<<<<<<< * LIBSSH2_ERROR_SOCKET_TIMEOUT = error_codes._LIBSSH2_ERROR_SOCKET_TIMEOUT */ - __pyx_t_1 = __Pyx_PyInt_From_int(LIBSSH2_ERROR_TIMEOUT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 31, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(LIBSSH2_ERROR_TIMEOUT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_ERROR_TIMEOUT, __pyx_t_1) < 0) __PYX_ERR(0, 31, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_ERROR_TIMEOUT, __pyx_t_1) < 0) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/error_codes.pyx":32 + /* "ssh2/error_codes.pyx":34 * # LIBSSH2_CHANNEL_FLUSH_ALL = c_ssh2._LIBSSH2_CHANNEL_FLUSH_ALL * LIBSSH2_ERROR_TIMEOUT = error_codes._LIBSSH2_ERROR_TIMEOUT * LIBSSH2_ERROR_SOCKET_TIMEOUT = error_codes._LIBSSH2_ERROR_SOCKET_TIMEOUT # <<<<<<<<<<<<<< */ - __pyx_t_1 = __Pyx_PyInt_From_int(LIBSSH2_ERROR_SOCKET_TIMEOUT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 32, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(LIBSSH2_ERROR_SOCKET_TIMEOUT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_ERROR_SOCKET_TIMEOUT, __pyx_t_1) < 0) __PYX_ERR(0, 32, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_ERROR_SOCKET_TIMEOUT, __pyx_t_1) < 0) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "ssh2/error_codes.pyx":1 diff --git a/ssh2/error_codes.pyx b/ssh2/error_codes.pyx index c2a55a18..45220a96 100644 --- a/ssh2/error_codes.pyx +++ b/ssh2/error_codes.pyx @@ -14,6 +14,8 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# cython: embedsignature=True, boundscheck=False, optimize.use_switch=True, wraparound=False + cimport error_codes cimport c_ssh2 diff --git a/ssh2/exceptions.c b/ssh2/exceptions.c index e4d10f88..24cd46ea 100644 --- a/ssh2/exceptions.c +++ b/ssh2/exceptions.c @@ -1,23 +1,5 @@ /* Generated by Cython 0.26 */ -/* BEGIN: Cython Metadata -{ - "distutils": { - "extra_compile_args": [ - "-ggdb" - ], - "libraries": [ - "ssh2" - ], - "name": "ssh2.exceptions", - "sources": [ - "ssh2/exceptions.pyx" - ] - }, - "module_name": "ssh2.exceptions" -} -END: Cython Metadata */ - #define PY_SSIZE_T_CLEAN #include "Python.h" #ifndef Py_PYTHON_H diff --git a/ssh2/fileinfo.c b/ssh2/fileinfo.c index 6ca7076b..e2f77804 100644 --- a/ssh2/fileinfo.c +++ b/ssh2/fileinfo.c @@ -1,24 +1,5 @@ /* Generated by Cython 0.26 */ -/* BEGIN: Cython Metadata -{ - "distutils": { - "depends": [], - "extra_compile_args": [ - "-ggdb" - ], - "libraries": [ - "ssh2" - ], - "name": "ssh2.fileinfo", - "sources": [ - "ssh2/fileinfo.pyx" - ] - }, - "module_name": "ssh2.fileinfo" -} -END: Cython Metadata */ - #define PY_SSIZE_T_CLEAN #include "Python.h" #ifndef Py_PYTHON_H @@ -698,24 +679,9 @@ static const char *__pyx_filename; static const char *__pyx_f[] = { "ssh2/fileinfo.pyx", - "stringsource", }; /*--- Type declarations ---*/ -struct __pyx_obj_4ssh2_8fileinfo_FileInfo; - -/* "ssh2/fileinfo.pxd":3 - * cimport c_ssh2 - * - * cdef class FileInfo: # <<<<<<<<<<<<<< - * """Representation of stat structure""" - * cdef c_ssh2.libssh2_struct_stat* _stat - */ -struct __pyx_obj_4ssh2_8fileinfo_FileInfo { - PyObject_HEAD - libssh2_struct_stat *_stat; -}; - /* --- Runtime support code (head) --- */ /* Refnanny.proto */ @@ -797,65 +763,6 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif -/* GetBuiltinName.proto */ -static PyObject *__Pyx_GetBuiltinName(PyObject *name); - -/* RaiseArgTupleInvalid.proto */ -static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, - Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); - -/* KeywordStringCheck.proto */ -static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed); - -/* NoFastGil.proto */ -#define __Pyx_PyGILState_Ensure PyGILState_Ensure -#define __Pyx_PyGILState_Release PyGILState_Release -#define __Pyx_FastGIL_Remember() -#define __Pyx_FastGIL_Forget() -#define __Pyx_FastGilFuncInit() - -/* ForceInitThreads.proto */ -#ifndef __PYX_FORCE_INIT_THREADS - #define __PYX_FORCE_INIT_THREADS 0 -#endif - -/* PyObjectCall.proto */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); -#else -#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) -#endif - -/* PyThreadStateGet.proto */ -#if CYTHON_FAST_THREAD_STATE -#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; -#define __Pyx_PyThreadState_assign __pyx_tstate = PyThreadState_GET(); -#else -#define __Pyx_PyThreadState_declare -#define __Pyx_PyThreadState_assign -#endif - -/* PyErrFetchRestore.proto */ -#if CYTHON_FAST_THREAD_STATE -#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) -#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) -#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) -#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) -static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); -static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); -#else -#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) -#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) -#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) -#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) -#endif - -/* RaiseException.proto */ -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); - -/* SetupReduce.proto */ -static int __Pyx_setup_reduce(PyObject* type_obj); - /* CLineInTraceback.proto */ static int __Pyx_CLineForTraceback(int c_line); @@ -878,36 +785,6 @@ static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); -/* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_ino_t(ino_t value); - -/* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_long(unsigned long value); - -/* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_nlink_t(nlink_t value); - -/* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uid_t(uid_t value); - -/* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_gid_t(gid_t value); - -/* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_dev_t(dev_t value); - -/* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint64_t(uint64_t value); - -/* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_blksize_t(blksize_t value); - -/* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_blkcnt_t(blkcnt_t value); - -/* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_time_t(time_t value); - /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); @@ -941,1819 +818,208 @@ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* Module declarations from 'libc.stdlib' */ /* Module declarations from 'ssh2.fileinfo' */ -static PyTypeObject *__pyx_ptype_4ssh2_8fileinfo_FileInfo = 0; #define __Pyx_MODULE_NAME "ssh2.fileinfo" int __pyx_module_is_main_ssh2__fileinfo = 0; /* Implementation of 'ssh2.fileinfo' */ -static PyObject *__pyx_builtin_MemoryError; -static PyObject *__pyx_builtin_TypeError; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_test[] = "__test__"; -static const char __pyx_k_TypeError[] = "TypeError"; -static const char __pyx_k_MemoryError[] = "MemoryError"; -static const char __pyx_k_reduce_cython[] = "__reduce_cython__"; -static const char __pyx_k_setstate_cython[] = "__setstate_cython__"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; -static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__"; -static PyObject *__pyx_n_s_MemoryError; -static PyObject *__pyx_n_s_TypeError; static PyObject *__pyx_n_s_cline_in_traceback; static PyObject *__pyx_n_s_main; -static PyObject *__pyx_kp_s_no_default___reduce___due_to_non; -static PyObject *__pyx_n_s_reduce_cython; -static PyObject *__pyx_n_s_setstate_cython; static PyObject *__pyx_n_s_test; -static int __pyx_pf_4ssh2_8fileinfo_8FileInfo___cinit__(struct __pyx_obj_4ssh2_8fileinfo_FileInfo *__pyx_v_self); /* proto */ -static void __pyx_pf_4ssh2_8fileinfo_8FileInfo_2__dealloc__(struct __pyx_obj_4ssh2_8fileinfo_FileInfo *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_4ssh2_8fileinfo_8FileInfo_6st_ino___get__(struct __pyx_obj_4ssh2_8fileinfo_FileInfo *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_4ssh2_8fileinfo_8FileInfo_7st_mode___get__(struct __pyx_obj_4ssh2_8fileinfo_FileInfo *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_4ssh2_8fileinfo_8FileInfo_8st_nlink___get__(struct __pyx_obj_4ssh2_8fileinfo_FileInfo *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_4ssh2_8fileinfo_8FileInfo_6st_uid___get__(struct __pyx_obj_4ssh2_8fileinfo_FileInfo *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_4ssh2_8fileinfo_8FileInfo_6st_gid___get__(struct __pyx_obj_4ssh2_8fileinfo_FileInfo *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_4ssh2_8fileinfo_8FileInfo_7st_rdev___get__(struct __pyx_obj_4ssh2_8fileinfo_FileInfo *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_4ssh2_8fileinfo_8FileInfo_7st_size___get__(struct __pyx_obj_4ssh2_8fileinfo_FileInfo *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_4ssh2_8fileinfo_8FileInfo_10st_blksize___get__(struct __pyx_obj_4ssh2_8fileinfo_FileInfo *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_4ssh2_8fileinfo_8FileInfo_9st_blocks___get__(struct __pyx_obj_4ssh2_8fileinfo_FileInfo *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_4ssh2_8fileinfo_8FileInfo_8st_atime___get__(struct __pyx_obj_4ssh2_8fileinfo_FileInfo *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_4ssh2_8fileinfo_8FileInfo_8st_mtime___get__(struct __pyx_obj_4ssh2_8fileinfo_FileInfo *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_4ssh2_8fileinfo_8FileInfo_8st_ctime___get__(struct __pyx_obj_4ssh2_8fileinfo_FileInfo *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_4ssh2_8fileinfo_8FileInfo_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_4ssh2_8fileinfo_FileInfo *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_4ssh2_8fileinfo_8FileInfo_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_4ssh2_8fileinfo_FileInfo *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ -static PyObject *__pyx_tp_new_4ssh2_8fileinfo_FileInfo(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tuple_; -static PyObject *__pyx_tuple__2; -/* "ssh2/fileinfo.pyx":25 - * """Representation of stat structure""" - * - * def __cinit__(self): # <<<<<<<<<<<<<< - * with nogil: - * self._stat = malloc( - */ +static PyMethodDef __pyx_methods[] = { + {0, 0, 0, 0} +}; -/* Python wrapper */ -static int __pyx_pw_4ssh2_8fileinfo_8FileInfo_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pw_4ssh2_8fileinfo_8FileInfo_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); - if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} - if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; - __pyx_r = __pyx_pf_4ssh2_8fileinfo_8FileInfo___cinit__(((struct __pyx_obj_4ssh2_8fileinfo_FileInfo *)__pyx_v_self)); +#if PY_MAJOR_VERSION >= 3 +static struct PyModuleDef __pyx_moduledef = { + #if PY_VERSION_HEX < 0x03020000 + { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, + #else + PyModuleDef_HEAD_INIT, + #endif + "fileinfo", + 0, /* m_doc */ + -1, /* m_size */ + __pyx_methods /* m_methods */, + NULL, /* m_reload */ + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ +}; +#endif - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} +}; +static int __Pyx_InitCachedBuiltins(void) { + return 0; } -static int __pyx_pf_4ssh2_8fileinfo_8FileInfo___cinit__(struct __pyx_obj_4ssh2_8fileinfo_FileInfo *__pyx_v_self) { - int __pyx_r; +static int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations - int __pyx_t_1; - __Pyx_RefNannySetupContext("__cinit__", 0); - - /* "ssh2/fileinfo.pyx":26 - * - * def __cinit__(self): - * with nogil: # <<<<<<<<<<<<<< - * self._stat = malloc( - * sizeof(c_ssh2.libssh2_struct_stat)) - */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - __Pyx_FastGIL_Remember(); - #endif - /*try:*/ { - - /* "ssh2/fileinfo.pyx":27 - * def __cinit__(self): - * with nogil: - * self._stat = malloc( # <<<<<<<<<<<<<< - * sizeof(c_ssh2.libssh2_struct_stat)) - * if self._stat is NULL: - */ - __pyx_v_self->_stat = ((libssh2_struct_stat *)malloc((sizeof(libssh2_struct_stat)))); - - /* "ssh2/fileinfo.pyx":29 - * self._stat = malloc( - * sizeof(c_ssh2.libssh2_struct_stat)) - * if self._stat is NULL: # <<<<<<<<<<<<<< - * with gil: - * raise MemoryError - */ - __pyx_t_1 = ((__pyx_v_self->_stat == NULL) != 0); - if (__pyx_t_1) { - - /* "ssh2/fileinfo.pyx":30 - * sizeof(c_ssh2.libssh2_struct_stat)) - * if self._stat is NULL: - * with gil: # <<<<<<<<<<<<<< - * raise MemoryError - * - */ - { - #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); - #endif - /*try:*/ { - - /* "ssh2/fileinfo.pyx":31 - * if self._stat is NULL: - * with gil: - * raise MemoryError # <<<<<<<<<<<<<< - * - * def __dealloc__(self): - */ - PyErr_NoMemory(); __PYX_ERR(0, 31, __pyx_L8_error) - } - - /* "ssh2/fileinfo.pyx":30 - * sizeof(c_ssh2.libssh2_struct_stat)) - * if self._stat is NULL: - * with gil: # <<<<<<<<<<<<<< - * raise MemoryError - * - */ - /*finally:*/ { - __pyx_L8_error: { - #ifdef WITH_THREAD - __Pyx_PyGILState_Release(__pyx_gilstate_save); - #endif - goto __pyx_L4_error; - } - } - } + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + __Pyx_RefNannyFinishContext(); + return 0; +} - /* "ssh2/fileinfo.pyx":29 - * self._stat = malloc( - * sizeof(c_ssh2.libssh2_struct_stat)) - * if self._stat is NULL: # <<<<<<<<<<<<<< - * with gil: - * raise MemoryError - */ - } - } +static int __Pyx_InitGlobals(void) { + if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + return 0; + __pyx_L1_error:; + return -1; +} - /* "ssh2/fileinfo.pyx":26 - * - * def __cinit__(self): - * with nogil: # <<<<<<<<<<<<<< - * self._stat = malloc( - * sizeof(c_ssh2.libssh2_struct_stat)) - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - __Pyx_FastGIL_Forget(); - Py_BLOCK_THREADS - #endif - goto __pyx_L5; - } - __pyx_L4_error: { - #ifdef WITH_THREAD - __Pyx_FastGIL_Forget(); - Py_BLOCK_THREADS - #endif - goto __pyx_L1_error; - } - __pyx_L5:; - } +#if PY_MAJOR_VERSION < 3 +PyMODINIT_FUNC initfileinfo(void); /*proto*/ +PyMODINIT_FUNC initfileinfo(void) +#else +PyMODINIT_FUNC PyInit_fileinfo(void); /*proto*/ +PyMODINIT_FUNC PyInit_fileinfo(void) +#endif +{ + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannyDeclarations + #if CYTHON_REFNANNY + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); + if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); + } + #endif + __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_fileinfo(void)", 0); + if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pyx_CyFunction_USED + if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Coroutine_USED + if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_StopAsyncIteration_USED + if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + #ifdef WITH_THREAD /* Python build with threading support? */ + PyEval_InitThreads(); + #endif + #endif + /*--- Module creation code ---*/ + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4("fileinfo", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + #endif + if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_d); + __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) + #if CYTHON_COMPILING_IN_PYPY + Py_INCREF(__pyx_b); + #endif + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + /*--- Initialize various global constants etc. ---*/ + if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + if (__pyx_module_is_main_ssh2__fileinfo) { + if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) + if (!PyDict_GetItemString(modules, "ssh2.fileinfo")) { + if (unlikely(PyDict_SetItemString(modules, "ssh2.fileinfo", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error) + } + } + #endif + /*--- Builtin init code ---*/ + if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Constants init code ---*/ + if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Global init code ---*/ + /*--- Variable export code ---*/ + /*--- Function export code ---*/ + /*--- Type init code ---*/ + /*--- Type import code ---*/ + /*--- Variable import code ---*/ + /*--- Function import code ---*/ + /*--- Execution code ---*/ + #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) + if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif - /* "ssh2/fileinfo.pyx":25 - * """Representation of stat structure""" + /* "ssh2/fileinfo.pyx":1 + * # This file is part of ssh2-python. # <<<<<<<<<<<<<< + * # Copyright (C) 2017 Panos Kittenis * - * def __cinit__(self): # <<<<<<<<<<<<<< - * with nogil: - * self._stat = malloc( */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /*--- Wrapped vars code ---*/ - /* function exit code */ - __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; - __Pyx_AddTraceback("ssh2.fileinfo.FileInfo.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; + __Pyx_XDECREF(__pyx_t_1); + if (__pyx_m) { + if (__pyx_d) { + __Pyx_AddTraceback("init ssh2.fileinfo", 0, __pyx_lineno, __pyx_filename); + } + Py_DECREF(__pyx_m); __pyx_m = 0; + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init ssh2.fileinfo"); + } __pyx_L0:; __Pyx_RefNannyFinishContext(); - return __pyx_r; + #if PY_MAJOR_VERSION < 3 + return; + #else + return __pyx_m; + #endif } -/* "ssh2/fileinfo.pyx":33 - * raise MemoryError - * - * def __dealloc__(self): # <<<<<<<<<<<<<< - * free(self._stat) - * - */ - -/* Python wrapper */ -static void __pyx_pw_4ssh2_8fileinfo_8FileInfo_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ -static void __pyx_pw_4ssh2_8fileinfo_8FileInfo_3__dealloc__(PyObject *__pyx_v_self) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); - __pyx_pf_4ssh2_8fileinfo_8FileInfo_2__dealloc__(((struct __pyx_obj_4ssh2_8fileinfo_FileInfo *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); -} - -static void __pyx_pf_4ssh2_8fileinfo_8FileInfo_2__dealloc__(struct __pyx_obj_4ssh2_8fileinfo_FileInfo *__pyx_v_self) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__dealloc__", 0); - - /* "ssh2/fileinfo.pyx":34 - * - * def __dealloc__(self): - * free(self._stat) # <<<<<<<<<<<<<< - * - * @property - */ - free(__pyx_v_self->_stat); - - /* "ssh2/fileinfo.pyx":33 - * raise MemoryError - * - * def __dealloc__(self): # <<<<<<<<<<<<<< - * free(self._stat) - * - */ - - /* function exit code */ - __Pyx_RefNannyFinishContext(); -} - -/* "ssh2/fileinfo.pyx":37 - * - * @property - * def st_ino(self): # <<<<<<<<<<<<<< - * return self._stat.st_ino - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4ssh2_8fileinfo_8FileInfo_6st_ino_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_4ssh2_8fileinfo_8FileInfo_6st_ino_1__get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_4ssh2_8fileinfo_8FileInfo_6st_ino___get__(((struct __pyx_obj_4ssh2_8fileinfo_FileInfo *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4ssh2_8fileinfo_8FileInfo_6st_ino___get__(struct __pyx_obj_4ssh2_8fileinfo_FileInfo *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("__get__", 0); - - /* "ssh2/fileinfo.pyx":38 - * @property - * def st_ino(self): - * return self._stat.st_ino # <<<<<<<<<<<<<< - * - * @property - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_ino_t(__pyx_v_self->_stat->st_ino); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 38, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "ssh2/fileinfo.pyx":37 - * - * @property - * def st_ino(self): # <<<<<<<<<<<<<< - * return self._stat.st_ino - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("ssh2.fileinfo.FileInfo.st_ino.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "ssh2/fileinfo.pyx":41 - * - * @property - * def st_mode(self): # <<<<<<<<<<<<<< - * return self._stat.st_mode - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4ssh2_8fileinfo_8FileInfo_7st_mode_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_4ssh2_8fileinfo_8FileInfo_7st_mode_1__get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_4ssh2_8fileinfo_8FileInfo_7st_mode___get__(((struct __pyx_obj_4ssh2_8fileinfo_FileInfo *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4ssh2_8fileinfo_8FileInfo_7st_mode___get__(struct __pyx_obj_4ssh2_8fileinfo_FileInfo *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("__get__", 0); - - /* "ssh2/fileinfo.pyx":42 - * @property - * def st_mode(self): - * return self._stat.st_mode # <<<<<<<<<<<<<< - * - * @property - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_unsigned_long(__pyx_v_self->_stat->st_mode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 42, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "ssh2/fileinfo.pyx":41 - * - * @property - * def st_mode(self): # <<<<<<<<<<<<<< - * return self._stat.st_mode - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("ssh2.fileinfo.FileInfo.st_mode.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "ssh2/fileinfo.pyx":45 - * - * @property - * def st_nlink(self): # <<<<<<<<<<<<<< - * return self._stat.st_nlink - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4ssh2_8fileinfo_8FileInfo_8st_nlink_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_4ssh2_8fileinfo_8FileInfo_8st_nlink_1__get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_4ssh2_8fileinfo_8FileInfo_8st_nlink___get__(((struct __pyx_obj_4ssh2_8fileinfo_FileInfo *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4ssh2_8fileinfo_8FileInfo_8st_nlink___get__(struct __pyx_obj_4ssh2_8fileinfo_FileInfo *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("__get__", 0); - - /* "ssh2/fileinfo.pyx":46 - * @property - * def st_nlink(self): - * return self._stat.st_nlink # <<<<<<<<<<<<<< - * - * @property - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_nlink_t(__pyx_v_self->_stat->st_nlink); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 46, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "ssh2/fileinfo.pyx":45 - * - * @property - * def st_nlink(self): # <<<<<<<<<<<<<< - * return self._stat.st_nlink - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("ssh2.fileinfo.FileInfo.st_nlink.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "ssh2/fileinfo.pyx":49 - * - * @property - * def st_uid(self): # <<<<<<<<<<<<<< - * return self._stat.st_uid - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4ssh2_8fileinfo_8FileInfo_6st_uid_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_4ssh2_8fileinfo_8FileInfo_6st_uid_1__get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_4ssh2_8fileinfo_8FileInfo_6st_uid___get__(((struct __pyx_obj_4ssh2_8fileinfo_FileInfo *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4ssh2_8fileinfo_8FileInfo_6st_uid___get__(struct __pyx_obj_4ssh2_8fileinfo_FileInfo *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("__get__", 0); - - /* "ssh2/fileinfo.pyx":50 - * @property - * def st_uid(self): - * return self._stat.st_uid # <<<<<<<<<<<<<< - * - * @property - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_uid_t(__pyx_v_self->_stat->st_uid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 50, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "ssh2/fileinfo.pyx":49 - * - * @property - * def st_uid(self): # <<<<<<<<<<<<<< - * return self._stat.st_uid - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("ssh2.fileinfo.FileInfo.st_uid.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "ssh2/fileinfo.pyx":53 - * - * @property - * def st_gid(self): # <<<<<<<<<<<<<< - * return self._stat.st_gid - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4ssh2_8fileinfo_8FileInfo_6st_gid_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_4ssh2_8fileinfo_8FileInfo_6st_gid_1__get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_4ssh2_8fileinfo_8FileInfo_6st_gid___get__(((struct __pyx_obj_4ssh2_8fileinfo_FileInfo *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4ssh2_8fileinfo_8FileInfo_6st_gid___get__(struct __pyx_obj_4ssh2_8fileinfo_FileInfo *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("__get__", 0); - - /* "ssh2/fileinfo.pyx":54 - * @property - * def st_gid(self): - * return self._stat.st_gid # <<<<<<<<<<<<<< - * - * @property - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_gid_t(__pyx_v_self->_stat->st_gid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 54, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "ssh2/fileinfo.pyx":53 - * - * @property - * def st_gid(self): # <<<<<<<<<<<<<< - * return self._stat.st_gid - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("ssh2.fileinfo.FileInfo.st_gid.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "ssh2/fileinfo.pyx":57 - * - * @property - * def st_rdev(self): # <<<<<<<<<<<<<< - * return self._stat.st_rdev - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4ssh2_8fileinfo_8FileInfo_7st_rdev_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_4ssh2_8fileinfo_8FileInfo_7st_rdev_1__get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_4ssh2_8fileinfo_8FileInfo_7st_rdev___get__(((struct __pyx_obj_4ssh2_8fileinfo_FileInfo *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4ssh2_8fileinfo_8FileInfo_7st_rdev___get__(struct __pyx_obj_4ssh2_8fileinfo_FileInfo *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("__get__", 0); - - /* "ssh2/fileinfo.pyx":58 - * @property - * def st_rdev(self): - * return self._stat.st_rdev # <<<<<<<<<<<<<< - * - * @property - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_dev_t(__pyx_v_self->_stat->st_rdev); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 58, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "ssh2/fileinfo.pyx":57 - * - * @property - * def st_rdev(self): # <<<<<<<<<<<<<< - * return self._stat.st_rdev - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("ssh2.fileinfo.FileInfo.st_rdev.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "ssh2/fileinfo.pyx":61 - * - * @property - * def st_size(self): # <<<<<<<<<<<<<< - * return self._stat.st_size - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4ssh2_8fileinfo_8FileInfo_7st_size_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_4ssh2_8fileinfo_8FileInfo_7st_size_1__get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_4ssh2_8fileinfo_8FileInfo_7st_size___get__(((struct __pyx_obj_4ssh2_8fileinfo_FileInfo *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4ssh2_8fileinfo_8FileInfo_7st_size___get__(struct __pyx_obj_4ssh2_8fileinfo_FileInfo *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("__get__", 0); - - /* "ssh2/fileinfo.pyx":62 - * @property - * def st_size(self): - * return self._stat.st_size # <<<<<<<<<<<<<< - * - * @property - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_uint64_t(__pyx_v_self->_stat->st_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 62, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "ssh2/fileinfo.pyx":61 - * - * @property - * def st_size(self): # <<<<<<<<<<<<<< - * return self._stat.st_size - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("ssh2.fileinfo.FileInfo.st_size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "ssh2/fileinfo.pyx":65 - * - * @property - * def st_blksize(self): # <<<<<<<<<<<<<< - * return self._stat.st_blksize - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4ssh2_8fileinfo_8FileInfo_10st_blksize_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_4ssh2_8fileinfo_8FileInfo_10st_blksize_1__get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_4ssh2_8fileinfo_8FileInfo_10st_blksize___get__(((struct __pyx_obj_4ssh2_8fileinfo_FileInfo *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4ssh2_8fileinfo_8FileInfo_10st_blksize___get__(struct __pyx_obj_4ssh2_8fileinfo_FileInfo *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("__get__", 0); - - /* "ssh2/fileinfo.pyx":66 - * @property - * def st_blksize(self): - * return self._stat.st_blksize # <<<<<<<<<<<<<< - * - * @property - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_blksize_t(__pyx_v_self->_stat->st_blksize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 66, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "ssh2/fileinfo.pyx":65 - * - * @property - * def st_blksize(self): # <<<<<<<<<<<<<< - * return self._stat.st_blksize - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("ssh2.fileinfo.FileInfo.st_blksize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "ssh2/fileinfo.pyx":69 - * - * @property - * def st_blocks(self): # <<<<<<<<<<<<<< - * return self._stat.st_blocks - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4ssh2_8fileinfo_8FileInfo_9st_blocks_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_4ssh2_8fileinfo_8FileInfo_9st_blocks_1__get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_4ssh2_8fileinfo_8FileInfo_9st_blocks___get__(((struct __pyx_obj_4ssh2_8fileinfo_FileInfo *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4ssh2_8fileinfo_8FileInfo_9st_blocks___get__(struct __pyx_obj_4ssh2_8fileinfo_FileInfo *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("__get__", 0); - - /* "ssh2/fileinfo.pyx":70 - * @property - * def st_blocks(self): - * return self._stat.st_blocks # <<<<<<<<<<<<<< - * - * @property - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_blkcnt_t(__pyx_v_self->_stat->st_blocks); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 70, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "ssh2/fileinfo.pyx":69 - * - * @property - * def st_blocks(self): # <<<<<<<<<<<<<< - * return self._stat.st_blocks - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("ssh2.fileinfo.FileInfo.st_blocks.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "ssh2/fileinfo.pyx":73 - * - * @property - * def st_atime(self): # <<<<<<<<<<<<<< - * return self._stat.st_atime - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4ssh2_8fileinfo_8FileInfo_8st_atime_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_4ssh2_8fileinfo_8FileInfo_8st_atime_1__get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_4ssh2_8fileinfo_8FileInfo_8st_atime___get__(((struct __pyx_obj_4ssh2_8fileinfo_FileInfo *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4ssh2_8fileinfo_8FileInfo_8st_atime___get__(struct __pyx_obj_4ssh2_8fileinfo_FileInfo *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("__get__", 0); - - /* "ssh2/fileinfo.pyx":74 - * @property - * def st_atime(self): - * return self._stat.st_atime # <<<<<<<<<<<<<< - * - * @property - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_time_t(__pyx_v_self->_stat->st_atime); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 74, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "ssh2/fileinfo.pyx":73 - * - * @property - * def st_atime(self): # <<<<<<<<<<<<<< - * return self._stat.st_atime - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("ssh2.fileinfo.FileInfo.st_atime.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "ssh2/fileinfo.pyx":77 - * - * @property - * def st_mtime(self): # <<<<<<<<<<<<<< - * return self._stat.st_mtime - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4ssh2_8fileinfo_8FileInfo_8st_mtime_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_4ssh2_8fileinfo_8FileInfo_8st_mtime_1__get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_4ssh2_8fileinfo_8FileInfo_8st_mtime___get__(((struct __pyx_obj_4ssh2_8fileinfo_FileInfo *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4ssh2_8fileinfo_8FileInfo_8st_mtime___get__(struct __pyx_obj_4ssh2_8fileinfo_FileInfo *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("__get__", 0); - - /* "ssh2/fileinfo.pyx":78 - * @property - * def st_mtime(self): - * return self._stat.st_mtime # <<<<<<<<<<<<<< - * - * @property - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_time_t(__pyx_v_self->_stat->st_mtime); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 78, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "ssh2/fileinfo.pyx":77 - * - * @property - * def st_mtime(self): # <<<<<<<<<<<<<< - * return self._stat.st_mtime - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("ssh2.fileinfo.FileInfo.st_mtime.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "ssh2/fileinfo.pyx":81 - * - * @property - * def st_ctime(self): # <<<<<<<<<<<<<< - * return self._stat.st_ctime - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4ssh2_8fileinfo_8FileInfo_8st_ctime_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_4ssh2_8fileinfo_8FileInfo_8st_ctime_1__get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_4ssh2_8fileinfo_8FileInfo_8st_ctime___get__(((struct __pyx_obj_4ssh2_8fileinfo_FileInfo *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4ssh2_8fileinfo_8FileInfo_8st_ctime___get__(struct __pyx_obj_4ssh2_8fileinfo_FileInfo *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("__get__", 0); - - /* "ssh2/fileinfo.pyx":82 - * @property - * def st_ctime(self): - * return self._stat.st_ctime # <<<<<<<<<<<<<< - * - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_time_t(__pyx_v_self->_stat->st_ctime); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 82, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "ssh2/fileinfo.pyx":81 - * - * @property - * def st_ctime(self): # <<<<<<<<<<<<<< - * return self._stat.st_ctime - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("ssh2.fileinfo.FileInfo.st_ctime.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "(tree fragment)":1 - * def __reduce_cython__(self): # <<<<<<<<<<<<<< - * raise TypeError("no default __reduce__ due to non-trivial __cinit__") - * def __setstate_cython__(self, __pyx_state): - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4ssh2_8fileinfo_8FileInfo_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static char __pyx_doc_4ssh2_8fileinfo_8FileInfo_4__reduce_cython__[] = "FileInfo.__reduce_cython__(self)"; -static PyObject *__pyx_pw_4ssh2_8fileinfo_8FileInfo_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); - __pyx_r = __pyx_pf_4ssh2_8fileinfo_8FileInfo_4__reduce_cython__(((struct __pyx_obj_4ssh2_8fileinfo_FileInfo *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4ssh2_8fileinfo_8FileInfo_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_4ssh2_8fileinfo_FileInfo *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("__reduce_cython__", 0); - - /* "(tree fragment)":2 - * def __reduce_cython__(self): - * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< - * def __setstate_cython__(self, __pyx_state): - * raise TypeError("no default __reduce__ due to non-trivial __cinit__") - */ - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_Raise(__pyx_t_1, 0, 0, 0); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(1, 2, __pyx_L1_error) - - /* "(tree fragment)":1 - * def __reduce_cython__(self): # <<<<<<<<<<<<<< - * raise TypeError("no default __reduce__ due to non-trivial __cinit__") - * def __setstate_cython__(self, __pyx_state): - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("ssh2.fileinfo.FileInfo.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "(tree fragment)":3 - * def __reduce_cython__(self): - * raise TypeError("no default __reduce__ due to non-trivial __cinit__") - * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< - * raise TypeError("no default __reduce__ due to non-trivial __cinit__") - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4ssh2_8fileinfo_8FileInfo_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ -static char __pyx_doc_4ssh2_8fileinfo_8FileInfo_6__setstate_cython__[] = "FileInfo.__setstate_cython__(self, __pyx_state)"; -static PyObject *__pyx_pw_4ssh2_8fileinfo_8FileInfo_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); - __pyx_r = __pyx_pf_4ssh2_8fileinfo_8FileInfo_6__setstate_cython__(((struct __pyx_obj_4ssh2_8fileinfo_FileInfo *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4ssh2_8fileinfo_8FileInfo_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_4ssh2_8fileinfo_FileInfo *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("__setstate_cython__", 0); - - /* "(tree fragment)":4 - * raise TypeError("no default __reduce__ due to non-trivial __cinit__") - * def __setstate_cython__(self, __pyx_state): - * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< - */ - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_Raise(__pyx_t_1, 0, 0, 0); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(1, 4, __pyx_L1_error) - - /* "(tree fragment)":3 - * def __reduce_cython__(self): - * raise TypeError("no default __reduce__ due to non-trivial __cinit__") - * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< - * raise TypeError("no default __reduce__ due to non-trivial __cinit__") - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("ssh2.fileinfo.FileInfo.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_tp_new_4ssh2_8fileinfo_FileInfo(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { - PyObject *o; - if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { - o = (*t->tp_alloc)(t, 0); - } else { - o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); - } - if (unlikely(!o)) return 0; - if (unlikely(__pyx_pw_4ssh2_8fileinfo_8FileInfo_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; - return o; - bad: - Py_DECREF(o); o = 0; - return NULL; -} - -static void __pyx_tp_dealloc_4ssh2_8fileinfo_FileInfo(PyObject *o) { - #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { - if (PyObject_CallFinalizerFromDealloc(o)) return; - } - #endif - { - PyObject *etype, *eval, *etb; - PyErr_Fetch(&etype, &eval, &etb); - ++Py_REFCNT(o); - __pyx_pw_4ssh2_8fileinfo_8FileInfo_3__dealloc__(o); - --Py_REFCNT(o); - PyErr_Restore(etype, eval, etb); - } - (*Py_TYPE(o)->tp_free)(o); -} - -static PyObject *__pyx_getprop_4ssh2_8fileinfo_8FileInfo_st_ino(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_4ssh2_8fileinfo_8FileInfo_6st_ino_1__get__(o); -} - -static PyObject *__pyx_getprop_4ssh2_8fileinfo_8FileInfo_st_mode(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_4ssh2_8fileinfo_8FileInfo_7st_mode_1__get__(o); -} - -static PyObject *__pyx_getprop_4ssh2_8fileinfo_8FileInfo_st_nlink(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_4ssh2_8fileinfo_8FileInfo_8st_nlink_1__get__(o); -} - -static PyObject *__pyx_getprop_4ssh2_8fileinfo_8FileInfo_st_uid(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_4ssh2_8fileinfo_8FileInfo_6st_uid_1__get__(o); -} - -static PyObject *__pyx_getprop_4ssh2_8fileinfo_8FileInfo_st_gid(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_4ssh2_8fileinfo_8FileInfo_6st_gid_1__get__(o); -} - -static PyObject *__pyx_getprop_4ssh2_8fileinfo_8FileInfo_st_rdev(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_4ssh2_8fileinfo_8FileInfo_7st_rdev_1__get__(o); -} - -static PyObject *__pyx_getprop_4ssh2_8fileinfo_8FileInfo_st_size(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_4ssh2_8fileinfo_8FileInfo_7st_size_1__get__(o); -} - -static PyObject *__pyx_getprop_4ssh2_8fileinfo_8FileInfo_st_blksize(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_4ssh2_8fileinfo_8FileInfo_10st_blksize_1__get__(o); -} - -static PyObject *__pyx_getprop_4ssh2_8fileinfo_8FileInfo_st_blocks(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_4ssh2_8fileinfo_8FileInfo_9st_blocks_1__get__(o); -} - -static PyObject *__pyx_getprop_4ssh2_8fileinfo_8FileInfo_st_atime(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_4ssh2_8fileinfo_8FileInfo_8st_atime_1__get__(o); -} - -static PyObject *__pyx_getprop_4ssh2_8fileinfo_8FileInfo_st_mtime(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_4ssh2_8fileinfo_8FileInfo_8st_mtime_1__get__(o); -} - -static PyObject *__pyx_getprop_4ssh2_8fileinfo_8FileInfo_st_ctime(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_4ssh2_8fileinfo_8FileInfo_8st_ctime_1__get__(o); -} - -static PyMethodDef __pyx_methods_4ssh2_8fileinfo_FileInfo[] = { - {"__reduce_cython__", (PyCFunction)__pyx_pw_4ssh2_8fileinfo_8FileInfo_5__reduce_cython__, METH_NOARGS, __pyx_doc_4ssh2_8fileinfo_8FileInfo_4__reduce_cython__}, - {"__setstate_cython__", (PyCFunction)__pyx_pw_4ssh2_8fileinfo_8FileInfo_7__setstate_cython__, METH_O, __pyx_doc_4ssh2_8fileinfo_8FileInfo_6__setstate_cython__}, - {0, 0, 0, 0} -}; - -static struct PyGetSetDef __pyx_getsets_4ssh2_8fileinfo_FileInfo[] = { - {(char *)"st_ino", __pyx_getprop_4ssh2_8fileinfo_8FileInfo_st_ino, 0, (char *)0, 0}, - {(char *)"st_mode", __pyx_getprop_4ssh2_8fileinfo_8FileInfo_st_mode, 0, (char *)0, 0}, - {(char *)"st_nlink", __pyx_getprop_4ssh2_8fileinfo_8FileInfo_st_nlink, 0, (char *)0, 0}, - {(char *)"st_uid", __pyx_getprop_4ssh2_8fileinfo_8FileInfo_st_uid, 0, (char *)0, 0}, - {(char *)"st_gid", __pyx_getprop_4ssh2_8fileinfo_8FileInfo_st_gid, 0, (char *)0, 0}, - {(char *)"st_rdev", __pyx_getprop_4ssh2_8fileinfo_8FileInfo_st_rdev, 0, (char *)0, 0}, - {(char *)"st_size", __pyx_getprop_4ssh2_8fileinfo_8FileInfo_st_size, 0, (char *)0, 0}, - {(char *)"st_blksize", __pyx_getprop_4ssh2_8fileinfo_8FileInfo_st_blksize, 0, (char *)0, 0}, - {(char *)"st_blocks", __pyx_getprop_4ssh2_8fileinfo_8FileInfo_st_blocks, 0, (char *)0, 0}, - {(char *)"st_atime", __pyx_getprop_4ssh2_8fileinfo_8FileInfo_st_atime, 0, (char *)0, 0}, - {(char *)"st_mtime", __pyx_getprop_4ssh2_8fileinfo_8FileInfo_st_mtime, 0, (char *)0, 0}, - {(char *)"st_ctime", __pyx_getprop_4ssh2_8fileinfo_8FileInfo_st_ctime, 0, (char *)0, 0}, - {0, 0, 0, 0, 0} -}; - -static PyTypeObject __pyx_type_4ssh2_8fileinfo_FileInfo = { - PyVarObject_HEAD_INIT(0, 0) - "ssh2.fileinfo.FileInfo", /*tp_name*/ - sizeof(struct __pyx_obj_4ssh2_8fileinfo_FileInfo), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_4ssh2_8fileinfo_FileInfo, /*tp_dealloc*/ - 0, /*tp_print*/ - 0, /*tp_getattr*/ - 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 - 0, /*tp_as_async*/ - #endif - 0, /*tp_repr*/ - 0, /*tp_as_number*/ - 0, /*tp_as_sequence*/ - 0, /*tp_as_mapping*/ - 0, /*tp_hash*/ - 0, /*tp_call*/ - 0, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ - 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ - "Representation of stat structure", /*tp_doc*/ - 0, /*tp_traverse*/ - 0, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - __pyx_methods_4ssh2_8fileinfo_FileInfo, /*tp_methods*/ - 0, /*tp_members*/ - __pyx_getsets_4ssh2_8fileinfo_FileInfo, /*tp_getset*/ - 0, /*tp_base*/ - 0, /*tp_dict*/ - 0, /*tp_descr_get*/ - 0, /*tp_descr_set*/ - 0, /*tp_dictoffset*/ - 0, /*tp_init*/ - 0, /*tp_alloc*/ - __pyx_tp_new_4ssh2_8fileinfo_FileInfo, /*tp_new*/ - 0, /*tp_free*/ - 0, /*tp_is_gc*/ - 0, /*tp_bases*/ - 0, /*tp_mro*/ - 0, /*tp_cache*/ - 0, /*tp_subclasses*/ - 0, /*tp_weaklist*/ - 0, /*tp_del*/ - 0, /*tp_version_tag*/ - #if PY_VERSION_HEX >= 0x030400a1 - 0, /*tp_finalize*/ - #endif -}; - -static PyMethodDef __pyx_methods[] = { - {0, 0, 0, 0} -}; - -#if PY_MAJOR_VERSION >= 3 -static struct PyModuleDef __pyx_moduledef = { - #if PY_VERSION_HEX < 0x03020000 - { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, - #else - PyModuleDef_HEAD_INIT, - #endif - "fileinfo", - 0, /* m_doc */ - -1, /* m_size */ - __pyx_methods /* m_methods */, - NULL, /* m_reload */ - NULL, /* m_traverse */ - NULL, /* m_clear */ - NULL /* m_free */ -}; -#endif - -static __Pyx_StringTabEntry __pyx_string_tab[] = { - {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1}, - {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, - {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, - {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, - {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0}, - {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1}, - {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1}, - {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, - {0, 0, 0, 0, 0, 0, 0} -}; -static int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(0, 31, __pyx_L1_error) - __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error) - return 0; - __pyx_L1_error:; - return -1; -} - -static int __Pyx_InitCachedConstants(void) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - - /* "(tree fragment)":2 - * def __reduce_cython__(self): - * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< - * def __setstate_cython__(self, __pyx_state): - * raise TypeError("no default __reduce__ due to non-trivial __cinit__") - */ - __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple_)) __PYX_ERR(1, 2, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple_); - __Pyx_GIVEREF(__pyx_tuple_); - - /* "(tree fragment)":4 - * raise TypeError("no default __reduce__ due to non-trivial __cinit__") - * def __setstate_cython__(self, __pyx_state): - * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< - */ - __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 4, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__2); - __Pyx_GIVEREF(__pyx_tuple__2); - __Pyx_RefNannyFinishContext(); - return 0; - __pyx_L1_error:; - __Pyx_RefNannyFinishContext(); - return -1; -} - -static int __Pyx_InitGlobals(void) { - if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - return 0; - __pyx_L1_error:; - return -1; -} - -#if PY_MAJOR_VERSION < 3 -PyMODINIT_FUNC initfileinfo(void); /*proto*/ -PyMODINIT_FUNC initfileinfo(void) -#else -PyMODINIT_FUNC PyInit_fileinfo(void); /*proto*/ -PyMODINIT_FUNC PyInit_fileinfo(void) -#endif -{ - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannyDeclarations - #if CYTHON_REFNANNY - __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); - if (!__Pyx_RefNanny) { - PyErr_Clear(); - __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); - if (!__Pyx_RefNanny) - Py_FatalError("failed to import 'refnanny' module"); - } - #endif - __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_fileinfo(void)", 0); - if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) - #ifdef __Pyx_CyFunction_USED - if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_FusedFunction_USED - if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_Coroutine_USED - if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_Generator_USED - if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_StopAsyncIteration_USED - if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - /*--- Library function declarations ---*/ - /*--- Threads initialization code ---*/ - #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS - #ifdef WITH_THREAD /* Python build with threading support? */ - PyEval_InitThreads(); - #endif - #endif - /*--- Module creation code ---*/ - #if PY_MAJOR_VERSION < 3 - __pyx_m = Py_InitModule4("fileinfo", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); - #else - __pyx_m = PyModule_Create(&__pyx_moduledef); - #endif - if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) - Py_INCREF(__pyx_d); - __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) - #if CYTHON_COMPILING_IN_PYPY - Py_INCREF(__pyx_b); - #endif - if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - /*--- Initialize various global constants etc. ---*/ - if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) - if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - if (__pyx_module_is_main_ssh2__fileinfo) { - if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - } - #if PY_MAJOR_VERSION >= 3 - { - PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) - if (!PyDict_GetItemString(modules, "ssh2.fileinfo")) { - if (unlikely(PyDict_SetItemString(modules, "ssh2.fileinfo", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error) - } - } - #endif - /*--- Builtin init code ---*/ - if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - /*--- Constants init code ---*/ - if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - /*--- Global init code ---*/ - /*--- Variable export code ---*/ - /*--- Function export code ---*/ - /*--- Type init code ---*/ - if (PyType_Ready(&__pyx_type_4ssh2_8fileinfo_FileInfo) < 0) __PYX_ERR(0, 22, __pyx_L1_error) - __pyx_type_4ssh2_8fileinfo_FileInfo.tp_print = 0; - if (PyObject_SetAttrString(__pyx_m, "FileInfo", (PyObject *)&__pyx_type_4ssh2_8fileinfo_FileInfo) < 0) __PYX_ERR(0, 22, __pyx_L1_error) - if (__Pyx_setup_reduce((PyObject*)&__pyx_type_4ssh2_8fileinfo_FileInfo) < 0) __PYX_ERR(0, 22, __pyx_L1_error) - __pyx_ptype_4ssh2_8fileinfo_FileInfo = &__pyx_type_4ssh2_8fileinfo_FileInfo; - /*--- Type import code ---*/ - /*--- Variable import code ---*/ - /*--- Function import code ---*/ - /*--- Execution code ---*/ - #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) - if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - - /* "ssh2/fileinfo.pyx":1 - * # This file is part of ssh2-python. # <<<<<<<<<<<<<< - * # Copyright (C) 2017 Panos Kittenis - * - */ - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /*--- Wrapped vars code ---*/ - - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - if (__pyx_m) { - if (__pyx_d) { - __Pyx_AddTraceback("init ssh2.fileinfo", 0, __pyx_lineno, __pyx_filename); - } - Py_DECREF(__pyx_m); __pyx_m = 0; - } else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_ImportError, "init ssh2.fileinfo"); - } - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - #if PY_MAJOR_VERSION < 3 - return; - #else - return __pyx_m; - #endif -} - -/* --- Runtime support code --- */ -/* Refnanny */ -#if CYTHON_REFNANNY -static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { - PyObject *m = NULL, *p = NULL; - void *r = NULL; - m = PyImport_ImportModule((char *)modname); - if (!m) goto end; - p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); - if (!p) goto end; - r = PyLong_AsVoidPtr(p); -end: - Py_XDECREF(p); - Py_XDECREF(m); - return (__Pyx_RefNannyAPIStruct *)r; -} -#endif - -/* GetBuiltinName */ -static PyObject *__Pyx_GetBuiltinName(PyObject *name) { - PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); - if (unlikely(!result)) { - PyErr_Format(PyExc_NameError, -#if PY_MAJOR_VERSION >= 3 - "name '%U' is not defined", name); -#else - "name '%.200s' is not defined", PyString_AS_STRING(name)); -#endif - } - return result; -} - -/* RaiseArgTupleInvalid */ -static void __Pyx_RaiseArgtupleInvalid( - const char* func_name, - int exact, - Py_ssize_t num_min, - Py_ssize_t num_max, - Py_ssize_t num_found) -{ - Py_ssize_t num_expected; - const char *more_or_less; - if (num_found < num_min) { - num_expected = num_min; - more_or_less = "at least"; - } else { - num_expected = num_max; - more_or_less = "at most"; - } - if (exact) { - more_or_less = "exactly"; - } - PyErr_Format(PyExc_TypeError, - "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", - func_name, more_or_less, num_expected, - (num_expected == 1) ? "" : "s", num_found); -} - -/* KeywordStringCheck */ -static CYTHON_INLINE int __Pyx_CheckKeywordStrings( - PyObject *kwdict, - const char* function_name, - int kw_allowed) -{ - PyObject* key = 0; - Py_ssize_t pos = 0; -#if CYTHON_COMPILING_IN_PYPY - if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0)) - goto invalid_keyword; - return 1; -#else - while (PyDict_Next(kwdict, &pos, &key, 0)) { - #if PY_MAJOR_VERSION < 3 - if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) - #endif - if (unlikely(!PyUnicode_Check(key))) - goto invalid_keyword_type; - } - if ((!kw_allowed) && unlikely(key)) - goto invalid_keyword; - return 1; -invalid_keyword_type: - PyErr_Format(PyExc_TypeError, - "%.200s() keywords must be strings", function_name); - return 0; -#endif -invalid_keyword: - PyErr_Format(PyExc_TypeError, - #if PY_MAJOR_VERSION < 3 - "%.200s() got an unexpected keyword argument '%.200s'", - function_name, PyString_AsString(key)); - #else - "%s() got an unexpected keyword argument '%U'", - function_name, key); - #endif - return 0; -} - -/* PyObjectCall */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { - PyObject *result; - ternaryfunc call = func->ob_type->tp_call; - if (unlikely(!call)) - return PyObject_Call(func, arg, kw); - if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) - return NULL; - result = (*call)(func, arg, kw); - Py_LeaveRecursiveCall(); - if (unlikely(!result) && unlikely(!PyErr_Occurred())) { - PyErr_SetString( - PyExc_SystemError, - "NULL result without error in PyObject_Call"); - } - return result; -} -#endif - -/* PyErrFetchRestore */ -#if CYTHON_FAST_THREAD_STATE -static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { - PyObject *tmp_type, *tmp_value, *tmp_tb; - tmp_type = tstate->curexc_type; - tmp_value = tstate->curexc_value; - tmp_tb = tstate->curexc_traceback; - tstate->curexc_type = type; - tstate->curexc_value = value; - tstate->curexc_traceback = tb; - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); -} -static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { - *type = tstate->curexc_type; - *value = tstate->curexc_value; - *tb = tstate->curexc_traceback; - tstate->curexc_type = 0; - tstate->curexc_value = 0; - tstate->curexc_traceback = 0; -} -#endif - -/* RaiseException */ -#if PY_MAJOR_VERSION < 3 -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, - CYTHON_UNUSED PyObject *cause) { - __Pyx_PyThreadState_declare - Py_XINCREF(type); - if (!value || value == Py_None) - value = NULL; - else - Py_INCREF(value); - if (!tb || tb == Py_None) - tb = NULL; - else { - Py_INCREF(tb); - if (!PyTraceBack_Check(tb)) { - PyErr_SetString(PyExc_TypeError, - "raise: arg 3 must be a traceback or None"); - goto raise_error; - } - } - if (PyType_Check(type)) { -#if CYTHON_COMPILING_IN_PYPY - if (!value) { - Py_INCREF(Py_None); - value = Py_None; - } -#endif - PyErr_NormalizeException(&type, &value, &tb); - } else { - if (value) { - PyErr_SetString(PyExc_TypeError, - "instance exception may not have a separate value"); - goto raise_error; - } - value = type; - type = (PyObject*) Py_TYPE(type); - Py_INCREF(type); - if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { - PyErr_SetString(PyExc_TypeError, - "raise: exception class must be a subclass of BaseException"); - goto raise_error; - } - } - __Pyx_PyThreadState_assign - __Pyx_ErrRestore(type, value, tb); - return; -raise_error: - Py_XDECREF(value); - Py_XDECREF(type); - Py_XDECREF(tb); - return; -} -#else -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { - PyObject* owned_instance = NULL; - if (tb == Py_None) { - tb = 0; - } else if (tb && !PyTraceBack_Check(tb)) { - PyErr_SetString(PyExc_TypeError, - "raise: arg 3 must be a traceback or None"); - goto bad; - } - if (value == Py_None) - value = 0; - if (PyExceptionInstance_Check(type)) { - if (value) { - PyErr_SetString(PyExc_TypeError, - "instance exception may not have a separate value"); - goto bad; - } - value = type; - type = (PyObject*) Py_TYPE(value); - } else if (PyExceptionClass_Check(type)) { - PyObject *instance_class = NULL; - if (value && PyExceptionInstance_Check(value)) { - instance_class = (PyObject*) Py_TYPE(value); - if (instance_class != type) { - int is_subclass = PyObject_IsSubclass(instance_class, type); - if (!is_subclass) { - instance_class = NULL; - } else if (unlikely(is_subclass == -1)) { - goto bad; - } else { - type = instance_class; - } - } - } - if (!instance_class) { - PyObject *args; - if (!value) - args = PyTuple_New(0); - else if (PyTuple_Check(value)) { - Py_INCREF(value); - args = value; - } else - args = PyTuple_Pack(1, value); - if (!args) - goto bad; - owned_instance = PyObject_Call(type, args, NULL); - Py_DECREF(args); - if (!owned_instance) - goto bad; - value = owned_instance; - if (!PyExceptionInstance_Check(value)) { - PyErr_Format(PyExc_TypeError, - "calling %R should have returned an instance of " - "BaseException, not %R", - type, Py_TYPE(value)); - goto bad; - } - } - } else { - PyErr_SetString(PyExc_TypeError, - "raise: exception class must be a subclass of BaseException"); - goto bad; - } -#if PY_VERSION_HEX >= 0x03030000 - if (cause) { -#else - if (cause && cause != Py_None) { -#endif - PyObject *fixed_cause; - if (cause == Py_None) { - fixed_cause = NULL; - } else if (PyExceptionClass_Check(cause)) { - fixed_cause = PyObject_CallObject(cause, NULL); - if (fixed_cause == NULL) - goto bad; - } else if (PyExceptionInstance_Check(cause)) { - fixed_cause = cause; - Py_INCREF(fixed_cause); - } else { - PyErr_SetString(PyExc_TypeError, - "exception causes must derive from " - "BaseException"); - goto bad; - } - PyException_SetCause(value, fixed_cause); - } - PyErr_SetObject(type, value); - if (tb) { -#if CYTHON_COMPILING_IN_PYPY - PyObject *tmp_type, *tmp_value, *tmp_tb; - PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); - Py_INCREF(tb); - PyErr_Restore(tmp_type, tmp_value, tb); - Py_XDECREF(tmp_tb); -#else - PyThreadState *tstate = PyThreadState_GET(); - PyObject* tmp_tb = tstate->curexc_traceback; - if (tb != tmp_tb) { - Py_INCREF(tb); - tstate->curexc_traceback = tb; - Py_XDECREF(tmp_tb); - } -#endif - } -bad: - Py_XDECREF(owned_instance); - return; -} -#endif - -/* SetupReduce */ - #define __Pyx_setup_reduce_GET_ATTR_OR_BAD(res, obj, name) res = PyObject_GetAttrString(obj, name); if (res == NULL) goto BAD; -static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) { - int ret; - PyObject *name_attr; - name_attr = PyObject_GetAttrString(meth, "__name__"); - if (name_attr) { - ret = PyObject_RichCompareBool(name_attr, name, Py_EQ); - } else { - ret = -1; - } - if (ret < 0) { - PyErr_Clear(); - ret = 0; - } - Py_XDECREF(name_attr); - return ret; -} -static int __Pyx_setup_reduce(PyObject* type_obj) { - int ret = 0; - PyObject* builtin_object = NULL; - static PyObject *object_reduce = NULL; - static PyObject *object_reduce_ex = NULL; - PyObject *reduce = NULL; - PyObject *reduce_ex = NULL; - PyObject *reduce_cython = NULL; - PyObject *setstate = NULL; - PyObject *setstate_cython = NULL; - if (PyObject_HasAttrString(type_obj, "__getstate__")) goto GOOD; - if (object_reduce_ex == NULL) { - __Pyx_setup_reduce_GET_ATTR_OR_BAD(builtin_object, __pyx_b, "object"); - __Pyx_setup_reduce_GET_ATTR_OR_BAD(object_reduce, builtin_object, "__reduce__"); - __Pyx_setup_reduce_GET_ATTR_OR_BAD(object_reduce_ex, builtin_object, "__reduce_ex__"); - } - __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce_ex, type_obj, "__reduce_ex__"); - if (reduce_ex == object_reduce_ex) { - __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce, type_obj, "__reduce__"); - if (object_reduce == reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) { - __Pyx_setup_reduce_GET_ATTR_OR_BAD(reduce_cython, type_obj, "__reduce_cython__"); - ret = PyDict_SetItemString(((PyTypeObject*)type_obj)->tp_dict, "__reduce__", reduce_cython); if (ret < 0) goto BAD; - ret = PyDict_DelItemString(((PyTypeObject*)type_obj)->tp_dict, "__reduce_cython__"); if (ret < 0) goto BAD; - setstate = PyObject_GetAttrString(type_obj, "__setstate__"); - if (!setstate) PyErr_Clear(); - if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) { - __Pyx_setup_reduce_GET_ATTR_OR_BAD(setstate_cython, type_obj, "__setstate_cython__"); - ret = PyDict_SetItemString(((PyTypeObject*)type_obj)->tp_dict, "__setstate__", setstate_cython); if (ret < 0) goto BAD; - ret = PyDict_DelItemString(((PyTypeObject*)type_obj)->tp_dict, "__setstate_cython__"); if (ret < 0) goto BAD; - } - PyType_Modified((PyTypeObject*)type_obj); - } - } - goto GOOD; -BAD: - if (!PyErr_Occurred()) PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name); - ret = -1; -GOOD: - Py_XDECREF(builtin_object); - Py_XDECREF(reduce); - Py_XDECREF(reduce_ex); - Py_XDECREF(reduce_cython); - Py_XDECREF(setstate); - Py_XDECREF(setstate_cython); - return ret; +/* --- Runtime support code --- */ +/* Refnanny */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule((char *)modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; } +#endif /* CLineInTraceback */ - static int __Pyx_CLineForTraceback(int c_line) { +static int __Pyx_CLineForTraceback(int c_line) { #ifdef CYTHON_CLINE_IN_TRACEBACK return ((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0; #else @@ -2787,7 +1053,7 @@ static int __Pyx_setup_reduce(PyObject* type_obj) { } /* CodeObjectCache */ - static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; @@ -2867,7 +1133,7 @@ static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { } /* AddTraceback */ - #include "compile.h" +#include "compile.h" #include "frameobject.h" #include "traceback.h" static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( @@ -2951,317 +1217,7 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, } /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_ino_t(ino_t value) { - const ino_t neg_one = (ino_t) -1, const_zero = (ino_t) 0; - const int is_unsigned = neg_one > const_zero; - if (is_unsigned) { - if (sizeof(ino_t) < sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(ino_t) <= sizeof(unsigned long)) { - return PyLong_FromUnsignedLong((unsigned long) value); -#ifdef HAVE_LONG_LONG - } else if (sizeof(ino_t) <= sizeof(unsigned PY_LONG_LONG)) { - return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); -#endif - } - } else { - if (sizeof(ino_t) <= sizeof(long)) { - return PyInt_FromLong((long) value); -#ifdef HAVE_LONG_LONG - } else if (sizeof(ino_t) <= sizeof(PY_LONG_LONG)) { - return PyLong_FromLongLong((PY_LONG_LONG) value); -#endif - } - } - { - int one = 1; int little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&value; - return _PyLong_FromByteArray(bytes, sizeof(ino_t), - little, !is_unsigned); - } -} - -/* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_long(unsigned long value) { - const unsigned long neg_one = (unsigned long) -1, const_zero = (unsigned long) 0; - const int is_unsigned = neg_one > const_zero; - if (is_unsigned) { - if (sizeof(unsigned long) < sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(unsigned long) <= sizeof(unsigned long)) { - return PyLong_FromUnsignedLong((unsigned long) value); -#ifdef HAVE_LONG_LONG - } else if (sizeof(unsigned long) <= sizeof(unsigned PY_LONG_LONG)) { - return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); -#endif - } - } else { - if (sizeof(unsigned long) <= sizeof(long)) { - return PyInt_FromLong((long) value); -#ifdef HAVE_LONG_LONG - } else if (sizeof(unsigned long) <= sizeof(PY_LONG_LONG)) { - return PyLong_FromLongLong((PY_LONG_LONG) value); -#endif - } - } - { - int one = 1; int little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&value; - return _PyLong_FromByteArray(bytes, sizeof(unsigned long), - little, !is_unsigned); - } -} - -/* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_nlink_t(nlink_t value) { - const nlink_t neg_one = (nlink_t) -1, const_zero = (nlink_t) 0; - const int is_unsigned = neg_one > const_zero; - if (is_unsigned) { - if (sizeof(nlink_t) < sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(nlink_t) <= sizeof(unsigned long)) { - return PyLong_FromUnsignedLong((unsigned long) value); -#ifdef HAVE_LONG_LONG - } else if (sizeof(nlink_t) <= sizeof(unsigned PY_LONG_LONG)) { - return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); -#endif - } - } else { - if (sizeof(nlink_t) <= sizeof(long)) { - return PyInt_FromLong((long) value); -#ifdef HAVE_LONG_LONG - } else if (sizeof(nlink_t) <= sizeof(PY_LONG_LONG)) { - return PyLong_FromLongLong((PY_LONG_LONG) value); -#endif - } - } - { - int one = 1; int little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&value; - return _PyLong_FromByteArray(bytes, sizeof(nlink_t), - little, !is_unsigned); - } -} - -/* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uid_t(uid_t value) { - const uid_t neg_one = (uid_t) -1, const_zero = (uid_t) 0; - const int is_unsigned = neg_one > const_zero; - if (is_unsigned) { - if (sizeof(uid_t) < sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(uid_t) <= sizeof(unsigned long)) { - return PyLong_FromUnsignedLong((unsigned long) value); -#ifdef HAVE_LONG_LONG - } else if (sizeof(uid_t) <= sizeof(unsigned PY_LONG_LONG)) { - return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); -#endif - } - } else { - if (sizeof(uid_t) <= sizeof(long)) { - return PyInt_FromLong((long) value); -#ifdef HAVE_LONG_LONG - } else if (sizeof(uid_t) <= sizeof(PY_LONG_LONG)) { - return PyLong_FromLongLong((PY_LONG_LONG) value); -#endif - } - } - { - int one = 1; int little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&value; - return _PyLong_FromByteArray(bytes, sizeof(uid_t), - little, !is_unsigned); - } -} - -/* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_gid_t(gid_t value) { - const gid_t neg_one = (gid_t) -1, const_zero = (gid_t) 0; - const int is_unsigned = neg_one > const_zero; - if (is_unsigned) { - if (sizeof(gid_t) < sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(gid_t) <= sizeof(unsigned long)) { - return PyLong_FromUnsignedLong((unsigned long) value); -#ifdef HAVE_LONG_LONG - } else if (sizeof(gid_t) <= sizeof(unsigned PY_LONG_LONG)) { - return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); -#endif - } - } else { - if (sizeof(gid_t) <= sizeof(long)) { - return PyInt_FromLong((long) value); -#ifdef HAVE_LONG_LONG - } else if (sizeof(gid_t) <= sizeof(PY_LONG_LONG)) { - return PyLong_FromLongLong((PY_LONG_LONG) value); -#endif - } - } - { - int one = 1; int little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&value; - return _PyLong_FromByteArray(bytes, sizeof(gid_t), - little, !is_unsigned); - } -} - -/* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_dev_t(dev_t value) { - const dev_t neg_one = (dev_t) -1, const_zero = (dev_t) 0; - const int is_unsigned = neg_one > const_zero; - if (is_unsigned) { - if (sizeof(dev_t) < sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(dev_t) <= sizeof(unsigned long)) { - return PyLong_FromUnsignedLong((unsigned long) value); -#ifdef HAVE_LONG_LONG - } else if (sizeof(dev_t) <= sizeof(unsigned PY_LONG_LONG)) { - return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); -#endif - } - } else { - if (sizeof(dev_t) <= sizeof(long)) { - return PyInt_FromLong((long) value); -#ifdef HAVE_LONG_LONG - } else if (sizeof(dev_t) <= sizeof(PY_LONG_LONG)) { - return PyLong_FromLongLong((PY_LONG_LONG) value); -#endif - } - } - { - int one = 1; int little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&value; - return _PyLong_FromByteArray(bytes, sizeof(dev_t), - little, !is_unsigned); - } -} - -/* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint64_t(uint64_t value) { - const uint64_t neg_one = (uint64_t) -1, const_zero = (uint64_t) 0; - const int is_unsigned = neg_one > const_zero; - if (is_unsigned) { - if (sizeof(uint64_t) < sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(uint64_t) <= sizeof(unsigned long)) { - return PyLong_FromUnsignedLong((unsigned long) value); -#ifdef HAVE_LONG_LONG - } else if (sizeof(uint64_t) <= sizeof(unsigned PY_LONG_LONG)) { - return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); -#endif - } - } else { - if (sizeof(uint64_t) <= sizeof(long)) { - return PyInt_FromLong((long) value); -#ifdef HAVE_LONG_LONG - } else if (sizeof(uint64_t) <= sizeof(PY_LONG_LONG)) { - return PyLong_FromLongLong((PY_LONG_LONG) value); -#endif - } - } - { - int one = 1; int little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&value; - return _PyLong_FromByteArray(bytes, sizeof(uint64_t), - little, !is_unsigned); - } -} - -/* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_blksize_t(blksize_t value) { - const blksize_t neg_one = (blksize_t) -1, const_zero = (blksize_t) 0; - const int is_unsigned = neg_one > const_zero; - if (is_unsigned) { - if (sizeof(blksize_t) < sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(blksize_t) <= sizeof(unsigned long)) { - return PyLong_FromUnsignedLong((unsigned long) value); -#ifdef HAVE_LONG_LONG - } else if (sizeof(blksize_t) <= sizeof(unsigned PY_LONG_LONG)) { - return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); -#endif - } - } else { - if (sizeof(blksize_t) <= sizeof(long)) { - return PyInt_FromLong((long) value); -#ifdef HAVE_LONG_LONG - } else if (sizeof(blksize_t) <= sizeof(PY_LONG_LONG)) { - return PyLong_FromLongLong((PY_LONG_LONG) value); -#endif - } - } - { - int one = 1; int little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&value; - return _PyLong_FromByteArray(bytes, sizeof(blksize_t), - little, !is_unsigned); - } -} - -/* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_blkcnt_t(blkcnt_t value) { - const blkcnt_t neg_one = (blkcnt_t) -1, const_zero = (blkcnt_t) 0; - const int is_unsigned = neg_one > const_zero; - if (is_unsigned) { - if (sizeof(blkcnt_t) < sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(blkcnt_t) <= sizeof(unsigned long)) { - return PyLong_FromUnsignedLong((unsigned long) value); -#ifdef HAVE_LONG_LONG - } else if (sizeof(blkcnt_t) <= sizeof(unsigned PY_LONG_LONG)) { - return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); -#endif - } - } else { - if (sizeof(blkcnt_t) <= sizeof(long)) { - return PyInt_FromLong((long) value); -#ifdef HAVE_LONG_LONG - } else if (sizeof(blkcnt_t) <= sizeof(PY_LONG_LONG)) { - return PyLong_FromLongLong((PY_LONG_LONG) value); -#endif - } - } - { - int one = 1; int little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&value; - return _PyLong_FromByteArray(bytes, sizeof(blkcnt_t), - little, !is_unsigned); - } -} - -/* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_time_t(time_t value) { - const time_t neg_one = (time_t) -1, const_zero = (time_t) 0; - const int is_unsigned = neg_one > const_zero; - if (is_unsigned) { - if (sizeof(time_t) < sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(time_t) <= sizeof(unsigned long)) { - return PyLong_FromUnsignedLong((unsigned long) value); -#ifdef HAVE_LONG_LONG - } else if (sizeof(time_t) <= sizeof(unsigned PY_LONG_LONG)) { - return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); -#endif - } - } else { - if (sizeof(time_t) <= sizeof(long)) { - return PyInt_FromLong((long) value); -#ifdef HAVE_LONG_LONG - } else if (sizeof(time_t) <= sizeof(PY_LONG_LONG)) { - return PyLong_FromLongLong((PY_LONG_LONG) value); -#endif - } - } - { - int one = 1; int little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&value; - return _PyLong_FromByteArray(bytes, sizeof(time_t), - little, !is_unsigned); - } -} - -/* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { @@ -3292,7 +1248,7 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, } /* CIntFromPyVerify */ - #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ +#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) @@ -3314,7 +1270,7 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, } /* CIntFromPy */ - static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 @@ -3503,7 +1459,7 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, } /* CIntFromPy */ - static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { const int neg_one = (int) -1, const_zero = (int) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 @@ -3692,7 +1648,7 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, } /* CheckBinaryVersion */ - static int __Pyx_check_binary_version(void) { +static int __Pyx_check_binary_version(void) { char ctversion[4], rtversion[4]; PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); @@ -3708,7 +1664,7 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, } /* InitStrings */ - static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION < 3 if (t->is_unicode) { diff --git a/ssh2/fileinfo.pxd b/ssh2/fileinfo.pxd index 2b604181..da960127 100644 --- a/ssh2/fileinfo.pxd +++ b/ssh2/fileinfo.pxd @@ -1,5 +1,6 @@ cimport c_ssh2 -cdef class FileInfo: - """Representation of stat structure""" - cdef c_ssh2.libssh2_struct_stat* _stat +IF EMBEDDED_LIB: + cdef class FileInfo: + """Representation of stat structure""" + cdef c_ssh2.libssh2_struct_stat* _stat diff --git a/ssh2/fileinfo.pyx b/ssh2/fileinfo.pyx index 3aa65fde..eb324fe0 100644 --- a/ssh2/fileinfo.pyx +++ b/ssh2/fileinfo.pyx @@ -14,70 +14,71 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# cython: embedsignature=True, boundscheck=False, optimize.use_switch=True, wraparound=False + from libc.stdlib cimport malloc, free cimport c_ssh2 +IF EMBEDDED_LIB: + cdef class FileInfo: + """Representation of stat structure""" -cdef class FileInfo: - """Representation of stat structure""" - - def __cinit__(self): - with nogil: - self._stat = malloc( - sizeof(c_ssh2.libssh2_struct_stat)) - if self._stat is NULL: - with gil: - raise MemoryError - - def __dealloc__(self): - free(self._stat) + def __cinit__(self): + with nogil: + self._stat = malloc( + sizeof(c_ssh2.libssh2_struct_stat)) + if self._stat is NULL: + with gil: + raise MemoryError - @property - def st_ino(self): - return self._stat.st_ino + def __dealloc__(self): + free(self._stat) - @property - def st_mode(self): - return self._stat.st_mode + @property + def st_ino(self): + return self._stat.st_ino - @property - def st_nlink(self): - return self._stat.st_nlink + @property + def st_mode(self): + return self._stat.st_mode - @property - def st_uid(self): - return self._stat.st_uid + @property + def st_nlink(self): + return self._stat.st_nlink - @property - def st_gid(self): - return self._stat.st_gid + @property + def st_uid(self): + return self._stat.st_uid - @property - def st_rdev(self): - return self._stat.st_rdev + @property + def st_gid(self): + return self._stat.st_gid - @property - def st_size(self): - return self._stat.st_size + @property + def st_rdev(self): + return self._stat.st_rdev - @property - def st_blksize(self): - return self._stat.st_blksize + @property + def st_size(self): + return self._stat.st_size - @property - def st_blocks(self): - return self._stat.st_blocks + @property + def st_blksize(self): + return self._stat.st_blksize - @property - def st_atime(self): - return self._stat.st_atime + @property + def st_blocks(self): + return self._stat.st_blocks - @property - def st_mtime(self): - return self._stat.st_mtime + @property + def st_atime(self): + return self._stat.st_atime - @property - def st_ctime(self): - return self._stat.st_ctime + @property + def st_mtime(self): + return self._stat.st_mtime + @property + def st_ctime(self): + return self._stat.st_ctime diff --git a/ssh2/listener.c b/ssh2/listener.c index 2f359e83..df0593d6 100644 --- a/ssh2/listener.c +++ b/ssh2/listener.c @@ -1,24 +1,5 @@ /* Generated by Cython 0.26 */ -/* BEGIN: Cython Metadata -{ - "distutils": { - "depends": [], - "extra_compile_args": [ - "-ggdb" - ], - "libraries": [ - "ssh2" - ], - "name": "ssh2.listener", - "sources": [ - "ssh2/listener.pyx" - ] - }, - "module_name": "ssh2.listener" -} -END: Cython Metadata */ - #define PY_SSIZE_T_CLEAN #include "Python.h" #ifndef Py_PYTHON_H @@ -1028,7 +1009,7 @@ static PyObject *__pyx_tp_new_4ssh2_8listener_Listener(PyTypeObject *t, PyObject static PyObject *__pyx_tuple_; static PyObject *__pyx_tuple__2; -/* "ssh2/listener.pyx":22 +/* "ssh2/listener.pyx":24 * * * cdef object PyListener(c_ssh2.LIBSSH2_LISTENER *listener, Session session): # <<<<<<<<<<<<<< @@ -1044,25 +1025,25 @@ static PyObject *__pyx_f_4ssh2_8listener_PyListener(LIBSSH2_LISTENER *__pyx_v_li PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("PyListener", 0); - /* "ssh2/listener.pyx":23 + /* "ssh2/listener.pyx":25 * * cdef object PyListener(c_ssh2.LIBSSH2_LISTENER *listener, Session session): * cdef Listener _listener = Listener(session) # <<<<<<<<<<<<<< * _listener._listener = listener * return _listener */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 23, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_v_session)); __Pyx_GIVEREF(((PyObject *)__pyx_v_session)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_session)); - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4ssh2_8listener_Listener), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 23, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4ssh2_8listener_Listener), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v__listener = ((struct __pyx_obj_4ssh2_8listener_Listener *)__pyx_t_2); __pyx_t_2 = 0; - /* "ssh2/listener.pyx":24 + /* "ssh2/listener.pyx":26 * cdef object PyListener(c_ssh2.LIBSSH2_LISTENER *listener, Session session): * cdef Listener _listener = Listener(session) * _listener._listener = listener # <<<<<<<<<<<<<< @@ -1071,7 +1052,7 @@ static PyObject *__pyx_f_4ssh2_8listener_PyListener(LIBSSH2_LISTENER *__pyx_v_li */ __pyx_v__listener->_listener = __pyx_v_listener; - /* "ssh2/listener.pyx":25 + /* "ssh2/listener.pyx":27 * cdef Listener _listener = Listener(session) * _listener._listener = listener * return _listener # <<<<<<<<<<<<<< @@ -1083,7 +1064,7 @@ static PyObject *__pyx_f_4ssh2_8listener_PyListener(LIBSSH2_LISTENER *__pyx_v_li __pyx_r = ((PyObject *)__pyx_v__listener); goto __pyx_L0; - /* "ssh2/listener.pyx":22 + /* "ssh2/listener.pyx":24 * * * cdef object PyListener(c_ssh2.LIBSSH2_LISTENER *listener, Session session): # <<<<<<<<<<<<<< @@ -1104,7 +1085,7 @@ static PyObject *__pyx_f_4ssh2_8listener_PyListener(LIBSSH2_LISTENER *__pyx_v_li return __pyx_r; } -/* "ssh2/listener.pyx":30 +/* "ssh2/listener.pyx":32 * cdef class Listener: * * def __cinit__(self, session): # <<<<<<<<<<<<<< @@ -1138,7 +1119,7 @@ static int __pyx_pw_4ssh2_8listener_8Listener_1__cinit__(PyObject *__pyx_v_self, else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 30, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 32, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; @@ -1149,7 +1130,7 @@ static int __pyx_pw_4ssh2_8listener_8Listener_1__cinit__(PyObject *__pyx_v_self, } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 30, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 32, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.listener.Listener.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -1168,7 +1149,7 @@ static int __pyx_pf_4ssh2_8listener_8Listener___cinit__(struct __pyx_obj_4ssh2_8 PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "ssh2/listener.pyx":31 + /* "ssh2/listener.pyx":33 * * def __cinit__(self, session): * self._listener = NULL # <<<<<<<<<<<<<< @@ -1177,14 +1158,14 @@ static int __pyx_pf_4ssh2_8listener_8Listener___cinit__(struct __pyx_obj_4ssh2_8 */ __pyx_v_self->_listener = NULL; - /* "ssh2/listener.pyx":32 + /* "ssh2/listener.pyx":34 * def __cinit__(self, session): * self._listener = NULL * self._session = session # <<<<<<<<<<<<<< * * def forward_accept(self): */ - if (!(likely(((__pyx_v_session) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_session, __pyx_ptype_4ssh2_7session_Session))))) __PYX_ERR(1, 32, __pyx_L1_error) + if (!(likely(((__pyx_v_session) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_session, __pyx_ptype_4ssh2_7session_Session))))) __PYX_ERR(1, 34, __pyx_L1_error) __pyx_t_1 = __pyx_v_session; __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); @@ -1193,7 +1174,7 @@ static int __pyx_pf_4ssh2_8listener_8Listener___cinit__(struct __pyx_obj_4ssh2_8 __pyx_v_self->_session = ((struct __pyx_obj_4ssh2_7session_Session *)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/listener.pyx":30 + /* "ssh2/listener.pyx":32 * cdef class Listener: * * def __cinit__(self, session): # <<<<<<<<<<<<<< @@ -1213,7 +1194,7 @@ static int __pyx_pf_4ssh2_8listener_8Listener___cinit__(struct __pyx_obj_4ssh2_8 return __pyx_r; } -/* "ssh2/listener.pyx":34 +/* "ssh2/listener.pyx":36 * self._session = session * * def forward_accept(self): # <<<<<<<<<<<<<< @@ -1244,7 +1225,7 @@ static PyObject *__pyx_pf_4ssh2_8listener_8Listener_2forward_accept(struct __pyx PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("forward_accept", 0); - /* "ssh2/listener.pyx":36 + /* "ssh2/listener.pyx":38 * def forward_accept(self): * cdef c_ssh2.LIBSSH2_CHANNEL *channel * with nogil: # <<<<<<<<<<<<<< @@ -1259,7 +1240,7 @@ static PyObject *__pyx_pf_4ssh2_8listener_8Listener_2forward_accept(struct __pyx #endif /*try:*/ { - /* "ssh2/listener.pyx":37 + /* "ssh2/listener.pyx":39 * cdef c_ssh2.LIBSSH2_CHANNEL *channel * with nogil: * channel = c_ssh2.libssh2_channel_forward_accept( # <<<<<<<<<<<<<< @@ -1269,7 +1250,7 @@ static PyObject *__pyx_pf_4ssh2_8listener_8Listener_2forward_accept(struct __pyx __pyx_v_channel = libssh2_channel_forward_accept(__pyx_v_self->_listener); } - /* "ssh2/listener.pyx":36 + /* "ssh2/listener.pyx":38 * def forward_accept(self): * cdef c_ssh2.LIBSSH2_CHANNEL *channel * with nogil: # <<<<<<<<<<<<<< @@ -1288,7 +1269,7 @@ static PyObject *__pyx_pf_4ssh2_8listener_8Listener_2forward_accept(struct __pyx } } - /* "ssh2/listener.pyx":39 + /* "ssh2/listener.pyx":41 * channel = c_ssh2.libssh2_channel_forward_accept( * self._listener) * if channel is NULL: # <<<<<<<<<<<<<< @@ -1298,7 +1279,7 @@ static PyObject *__pyx_pf_4ssh2_8listener_8Listener_2forward_accept(struct __pyx __pyx_t_1 = ((__pyx_v_channel == NULL) != 0); if (__pyx_t_1) { - /* "ssh2/listener.pyx":40 + /* "ssh2/listener.pyx":42 * self._listener) * if channel is NULL: * return # <<<<<<<<<<<<<< @@ -1309,7 +1290,7 @@ static PyObject *__pyx_pf_4ssh2_8listener_8Listener_2forward_accept(struct __pyx __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "ssh2/listener.pyx":39 + /* "ssh2/listener.pyx":41 * channel = c_ssh2.libssh2_channel_forward_accept( * self._listener) * if channel is NULL: # <<<<<<<<<<<<<< @@ -1318,7 +1299,7 @@ static PyObject *__pyx_pf_4ssh2_8listener_8Listener_2forward_accept(struct __pyx */ } - /* "ssh2/listener.pyx":41 + /* "ssh2/listener.pyx":43 * if channel is NULL: * return * return PyChannel(channel, self._session) # <<<<<<<<<<<<<< @@ -1328,14 +1309,14 @@ static PyObject *__pyx_pf_4ssh2_8listener_8Listener_2forward_accept(struct __pyx __Pyx_XDECREF(__pyx_r); __pyx_t_2 = ((PyObject *)__pyx_v_self->_session); __Pyx_INCREF(__pyx_t_2); - __pyx_t_3 = __pyx_f_4ssh2_7channel_PyChannel(__pyx_v_channel, ((struct __pyx_obj_4ssh2_7session_Session *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 41, __pyx_L1_error) + __pyx_t_3 = __pyx_f_4ssh2_7channel_PyChannel(__pyx_v_channel, ((struct __pyx_obj_4ssh2_7session_Session *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - /* "ssh2/listener.pyx":34 + /* "ssh2/listener.pyx":36 * self._session = session * * def forward_accept(self): # <<<<<<<<<<<<<< @@ -1355,7 +1336,7 @@ static PyObject *__pyx_pf_4ssh2_8listener_8Listener_2forward_accept(struct __pyx return __pyx_r; } -/* "ssh2/listener.pyx":43 +/* "ssh2/listener.pyx":45 * return PyChannel(channel, self._session) * * def forward_cancel(self): # <<<<<<<<<<<<<< @@ -1384,7 +1365,7 @@ static PyObject *__pyx_pf_4ssh2_8listener_8Listener_4forward_cancel(struct __pyx PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("forward_cancel", 0); - /* "ssh2/listener.pyx":45 + /* "ssh2/listener.pyx":47 * def forward_cancel(self): * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -1399,7 +1380,7 @@ static PyObject *__pyx_pf_4ssh2_8listener_8Listener_4forward_cancel(struct __pyx #endif /*try:*/ { - /* "ssh2/listener.pyx":46 + /* "ssh2/listener.pyx":48 * cdef int rc * with nogil: * rc = c_ssh2.libssh2_channel_forward_cancel( # <<<<<<<<<<<<<< @@ -1409,7 +1390,7 @@ static PyObject *__pyx_pf_4ssh2_8listener_8Listener_4forward_cancel(struct __pyx __pyx_v_rc = libssh2_channel_forward_cancel(__pyx_v_self->_listener); } - /* "ssh2/listener.pyx":45 + /* "ssh2/listener.pyx":47 * def forward_cancel(self): * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -1428,19 +1409,19 @@ static PyObject *__pyx_pf_4ssh2_8listener_8Listener_4forward_cancel(struct __pyx } } - /* "ssh2/listener.pyx":48 + /* "ssh2/listener.pyx":50 * rc = c_ssh2.libssh2_channel_forward_cancel( * self._listener) * return rc # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 48, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/listener.pyx":43 + /* "ssh2/listener.pyx":45 * return PyChannel(channel, self._session) * * def forward_cancel(self): # <<<<<<<<<<<<<< @@ -1846,10 +1827,10 @@ PyMODINIT_FUNC PyInit_listener(void) /*--- Function export code ---*/ if (__Pyx_ExportFunction("PyListener", (void (*)(void))__pyx_f_4ssh2_8listener_PyListener, "PyObject *(LIBSSH2_LISTENER *, struct __pyx_obj_4ssh2_7session_Session *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error) /*--- Type init code ---*/ - if (PyType_Ready(&__pyx_type_4ssh2_8listener_Listener) < 0) __PYX_ERR(1, 28, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_4ssh2_8listener_Listener) < 0) __PYX_ERR(1, 30, __pyx_L1_error) __pyx_type_4ssh2_8listener_Listener.tp_print = 0; - if (PyObject_SetAttrString(__pyx_m, "Listener", (PyObject *)&__pyx_type_4ssh2_8listener_Listener) < 0) __PYX_ERR(1, 28, __pyx_L1_error) - if (__Pyx_setup_reduce((PyObject*)&__pyx_type_4ssh2_8listener_Listener) < 0) __PYX_ERR(1, 28, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "Listener", (PyObject *)&__pyx_type_4ssh2_8listener_Listener) < 0) __PYX_ERR(1, 30, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_4ssh2_8listener_Listener) < 0) __PYX_ERR(1, 30, __pyx_L1_error) __pyx_ptype_4ssh2_8listener_Listener = &__pyx_type_4ssh2_8listener_Listener; /*--- Type import code ---*/ __pyx_ptype_4ssh2_7session_Session = __Pyx_ImportType("ssh2.session", "Session", sizeof(struct __pyx_obj_4ssh2_7session_Session), 1); if (unlikely(!__pyx_ptype_4ssh2_7session_Session)) __PYX_ERR(2, 20, __pyx_L1_error) diff --git a/ssh2/listener.pyx b/ssh2/listener.pyx index 26adc6a3..861072a7 100644 --- a/ssh2/listener.pyx +++ b/ssh2/listener.pyx @@ -14,6 +14,8 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# cython: embedsignature=True, boundscheck=False, optimize.use_switch=True, wraparound=False + cimport c_ssh2 from session cimport Session from channel cimport PyChannel diff --git a/ssh2/pkey.c b/ssh2/pkey.c index 86c70517..4581239e 100644 --- a/ssh2/pkey.c +++ b/ssh2/pkey.c @@ -1,24 +1,5 @@ /* Generated by Cython 0.26 */ -/* BEGIN: Cython Metadata -{ - "distutils": { - "depends": [], - "extra_compile_args": [ - "-ggdb" - ], - "libraries": [ - "ssh2" - ], - "name": "ssh2.pkey", - "sources": [ - "ssh2/pkey.pyx" - ] - }, - "module_name": "ssh2.pkey" -} -END: Cython Metadata */ - #define PY_SSIZE_T_CLEAN #include "Python.h" #ifndef Py_PYTHON_H @@ -929,7 +910,7 @@ static PyObject *__pyx_tp_new_4ssh2_4pkey_PublicKey(PyTypeObject *t, PyObject *a static PyObject *__pyx_tuple_; static PyObject *__pyx_tuple__2; -/* "ssh2/pkey.pyx":20 +/* "ssh2/pkey.pyx":22 * * * cdef object PyPublicKey(c_ssh2.libssh2_agent_publickey *pkey): # <<<<<<<<<<<<<< @@ -944,19 +925,19 @@ static PyObject *__pyx_f_4ssh2_4pkey_PyPublicKey(struct libssh2_agent_publickey PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyPublicKey", 0); - /* "ssh2/pkey.pyx":21 + /* "ssh2/pkey.pyx":23 * * cdef object PyPublicKey(c_ssh2.libssh2_agent_publickey *pkey): * cdef PublicKey _pkey = PublicKey() # <<<<<<<<<<<<<< * _pkey._pkey = pkey * return _pkey */ - __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4ssh2_4pkey_PublicKey), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 21, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4ssh2_4pkey_PublicKey), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v__pkey = ((struct __pyx_obj_4ssh2_4pkey_PublicKey *)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/pkey.pyx":22 + /* "ssh2/pkey.pyx":24 * cdef object PyPublicKey(c_ssh2.libssh2_agent_publickey *pkey): * cdef PublicKey _pkey = PublicKey() * _pkey._pkey = pkey # <<<<<<<<<<<<<< @@ -965,7 +946,7 @@ static PyObject *__pyx_f_4ssh2_4pkey_PyPublicKey(struct libssh2_agent_publickey */ __pyx_v__pkey->_pkey = __pyx_v_pkey; - /* "ssh2/pkey.pyx":23 + /* "ssh2/pkey.pyx":25 * cdef PublicKey _pkey = PublicKey() * _pkey._pkey = pkey * return _pkey # <<<<<<<<<<<<<< @@ -977,7 +958,7 @@ static PyObject *__pyx_f_4ssh2_4pkey_PyPublicKey(struct libssh2_agent_publickey __pyx_r = ((PyObject *)__pyx_v__pkey); goto __pyx_L0; - /* "ssh2/pkey.pyx":20 + /* "ssh2/pkey.pyx":22 * * * cdef object PyPublicKey(c_ssh2.libssh2_agent_publickey *pkey): # <<<<<<<<<<<<<< @@ -997,7 +978,7 @@ static PyObject *__pyx_f_4ssh2_4pkey_PyPublicKey(struct libssh2_agent_publickey return __pyx_r; } -/* "ssh2/pkey.pyx":31 +/* "ssh2/pkey.pyx":33 * Can be used for authentication via :py:func:`ssh2.agent.Agent.userauth`""" * * def __cinit__(self): # <<<<<<<<<<<<<< @@ -1026,7 +1007,7 @@ static int __pyx_pf_4ssh2_4pkey_9PublicKey___cinit__(struct __pyx_obj_4ssh2_4pke __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); - /* "ssh2/pkey.pyx":32 + /* "ssh2/pkey.pyx":34 * * def __cinit__(self): * self._pkey = NULL # <<<<<<<<<<<<<< @@ -1035,7 +1016,7 @@ static int __pyx_pf_4ssh2_4pkey_9PublicKey___cinit__(struct __pyx_obj_4ssh2_4pke */ __pyx_v_self->_pkey = NULL; - /* "ssh2/pkey.pyx":31 + /* "ssh2/pkey.pyx":33 * Can be used for authentication via :py:func:`ssh2.agent.Agent.userauth`""" * * def __cinit__(self): # <<<<<<<<<<<<<< @@ -1049,7 +1030,7 @@ static int __pyx_pf_4ssh2_4pkey_9PublicKey___cinit__(struct __pyx_obj_4ssh2_4pke return __pyx_r; } -/* "ssh2/pkey.pyx":35 +/* "ssh2/pkey.pyx":37 * * @property * def blob(self): # <<<<<<<<<<<<<< @@ -1077,7 +1058,7 @@ static PyObject *__pyx_pf_4ssh2_4pkey_9PublicKey_4blob___get__(struct __pyx_obj_ PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("__get__", 0); - /* "ssh2/pkey.pyx":40 + /* "ssh2/pkey.pyx":42 * :rtype: bytes * """ * if self._pkey is NULL: # <<<<<<<<<<<<<< @@ -1087,7 +1068,7 @@ static PyObject *__pyx_pf_4ssh2_4pkey_9PublicKey_4blob___get__(struct __pyx_obj_ __pyx_t_1 = ((__pyx_v_self->_pkey == NULL) != 0); if (__pyx_t_1) { - /* "ssh2/pkey.pyx":41 + /* "ssh2/pkey.pyx":43 * """ * if self._pkey is NULL: * return # <<<<<<<<<<<<<< @@ -1098,7 +1079,7 @@ static PyObject *__pyx_pf_4ssh2_4pkey_9PublicKey_4blob___get__(struct __pyx_obj_ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "ssh2/pkey.pyx":40 + /* "ssh2/pkey.pyx":42 * :rtype: bytes * """ * if self._pkey is NULL: # <<<<<<<<<<<<<< @@ -1107,7 +1088,7 @@ static PyObject *__pyx_pf_4ssh2_4pkey_9PublicKey_4blob___get__(struct __pyx_obj_ */ } - /* "ssh2/pkey.pyx":42 + /* "ssh2/pkey.pyx":44 * if self._pkey is NULL: * return * return self._pkey.blob[:self._pkey.blob_len] # <<<<<<<<<<<<<< @@ -1115,13 +1096,13 @@ static PyObject *__pyx_pf_4ssh2_4pkey_9PublicKey_4blob___get__(struct __pyx_obj_ * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyBytes_FromStringAndSize(((const char*)__pyx_v_self->_pkey->blob) + 0, __pyx_v_self->_pkey->blob_len - 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 42, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_FromStringAndSize(((const char*)__pyx_v_self->_pkey->blob) + 0, __pyx_v_self->_pkey->blob_len - 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "ssh2/pkey.pyx":35 + /* "ssh2/pkey.pyx":37 * * @property * def blob(self): # <<<<<<<<<<<<<< @@ -1140,7 +1121,7 @@ static PyObject *__pyx_pf_4ssh2_4pkey_9PublicKey_4blob___get__(struct __pyx_obj_ return __pyx_r; } -/* "ssh2/pkey.pyx":45 +/* "ssh2/pkey.pyx":47 * * @property * def magic(self): # <<<<<<<<<<<<<< @@ -1168,7 +1149,7 @@ static PyObject *__pyx_pf_4ssh2_4pkey_9PublicKey_5magic___get__(struct __pyx_obj PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("__get__", 0); - /* "ssh2/pkey.pyx":50 + /* "ssh2/pkey.pyx":52 * :rtype: int * """ * if self._pkey is NULL: # <<<<<<<<<<<<<< @@ -1178,7 +1159,7 @@ static PyObject *__pyx_pf_4ssh2_4pkey_9PublicKey_5magic___get__(struct __pyx_obj __pyx_t_1 = ((__pyx_v_self->_pkey == NULL) != 0); if (__pyx_t_1) { - /* "ssh2/pkey.pyx":51 + /* "ssh2/pkey.pyx":53 * """ * if self._pkey is NULL: * return # <<<<<<<<<<<<<< @@ -1189,7 +1170,7 @@ static PyObject *__pyx_pf_4ssh2_4pkey_9PublicKey_5magic___get__(struct __pyx_obj __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "ssh2/pkey.pyx":50 + /* "ssh2/pkey.pyx":52 * :rtype: int * """ * if self._pkey is NULL: # <<<<<<<<<<<<<< @@ -1198,7 +1179,7 @@ static PyObject *__pyx_pf_4ssh2_4pkey_9PublicKey_5magic___get__(struct __pyx_obj */ } - /* "ssh2/pkey.pyx":52 + /* "ssh2/pkey.pyx":54 * if self._pkey is NULL: * return * return self._pkey.magic # <<<<<<<<<<<<<< @@ -1206,13 +1187,13 @@ static PyObject *__pyx_pf_4ssh2_4pkey_9PublicKey_5magic___get__(struct __pyx_obj * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_v_self->_pkey->magic); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 52, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_v_self->_pkey->magic); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "ssh2/pkey.pyx":45 + /* "ssh2/pkey.pyx":47 * * @property * def magic(self): # <<<<<<<<<<<<<< @@ -1231,7 +1212,7 @@ static PyObject *__pyx_pf_4ssh2_4pkey_9PublicKey_5magic___get__(struct __pyx_obj return __pyx_r; } -/* "ssh2/pkey.pyx":55 +/* "ssh2/pkey.pyx":57 * * @property * def blob_len(self): # <<<<<<<<<<<<<< @@ -1259,7 +1240,7 @@ static PyObject *__pyx_pf_4ssh2_4pkey_9PublicKey_8blob_len___get__(struct __pyx_ PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("__get__", 0); - /* "ssh2/pkey.pyx":60 + /* "ssh2/pkey.pyx":62 * :rtype: int * """ * if self._pkey is NULL: # <<<<<<<<<<<<<< @@ -1269,7 +1250,7 @@ static PyObject *__pyx_pf_4ssh2_4pkey_9PublicKey_8blob_len___get__(struct __pyx_ __pyx_t_1 = ((__pyx_v_self->_pkey == NULL) != 0); if (__pyx_t_1) { - /* "ssh2/pkey.pyx":61 + /* "ssh2/pkey.pyx":63 * """ * if self._pkey is NULL: * return # <<<<<<<<<<<<<< @@ -1280,7 +1261,7 @@ static PyObject *__pyx_pf_4ssh2_4pkey_9PublicKey_8blob_len___get__(struct __pyx_ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "ssh2/pkey.pyx":60 + /* "ssh2/pkey.pyx":62 * :rtype: int * """ * if self._pkey is NULL: # <<<<<<<<<<<<<< @@ -1289,7 +1270,7 @@ static PyObject *__pyx_pf_4ssh2_4pkey_9PublicKey_8blob_len___get__(struct __pyx_ */ } - /* "ssh2/pkey.pyx":62 + /* "ssh2/pkey.pyx":64 * if self._pkey is NULL: * return * return self._pkey.blob_len # <<<<<<<<<<<<<< @@ -1297,13 +1278,13 @@ static PyObject *__pyx_pf_4ssh2_4pkey_9PublicKey_8blob_len___get__(struct __pyx_ * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_self->_pkey->blob_len); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 62, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_self->_pkey->blob_len); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "ssh2/pkey.pyx":55 + /* "ssh2/pkey.pyx":57 * * @property * def blob_len(self): # <<<<<<<<<<<<<< @@ -1322,7 +1303,7 @@ static PyObject *__pyx_pf_4ssh2_4pkey_9PublicKey_8blob_len___get__(struct __pyx_ return __pyx_r; } -/* "ssh2/pkey.pyx":65 +/* "ssh2/pkey.pyx":67 * * @property * def comment(self): # <<<<<<<<<<<<<< @@ -1350,7 +1331,7 @@ static PyObject *__pyx_pf_4ssh2_4pkey_9PublicKey_7comment___get__(struct __pyx_o PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("__get__", 0); - /* "ssh2/pkey.pyx":70 + /* "ssh2/pkey.pyx":72 * :rtype: bytes * """ * if self._pkey is NULL: # <<<<<<<<<<<<<< @@ -1360,7 +1341,7 @@ static PyObject *__pyx_pf_4ssh2_4pkey_9PublicKey_7comment___get__(struct __pyx_o __pyx_t_1 = ((__pyx_v_self->_pkey == NULL) != 0); if (__pyx_t_1) { - /* "ssh2/pkey.pyx":71 + /* "ssh2/pkey.pyx":73 * """ * if self._pkey is NULL: * return # <<<<<<<<<<<<<< @@ -1370,7 +1351,7 @@ static PyObject *__pyx_pf_4ssh2_4pkey_9PublicKey_7comment___get__(struct __pyx_o __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "ssh2/pkey.pyx":70 + /* "ssh2/pkey.pyx":72 * :rtype: bytes * """ * if self._pkey is NULL: # <<<<<<<<<<<<<< @@ -1379,19 +1360,19 @@ static PyObject *__pyx_pf_4ssh2_4pkey_9PublicKey_7comment___get__(struct __pyx_o */ } - /* "ssh2/pkey.pyx":72 + /* "ssh2/pkey.pyx":74 * if self._pkey is NULL: * return * return self._pkey.comment # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_self->_pkey->comment); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 72, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_self->_pkey->comment); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "ssh2/pkey.pyx":65 + /* "ssh2/pkey.pyx":67 * * @property * def comment(self): # <<<<<<<<<<<<<< @@ -1792,10 +1773,10 @@ PyMODINIT_FUNC PyInit_pkey(void) /*--- Function export code ---*/ if (__Pyx_ExportFunction("PyPublicKey", (void (*)(void))__pyx_f_4ssh2_4pkey_PyPublicKey, "PyObject *(struct libssh2_agent_publickey *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error) /*--- Type init code ---*/ - if (PyType_Ready(&__pyx_type_4ssh2_4pkey_PublicKey) < 0) __PYX_ERR(1, 26, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_4ssh2_4pkey_PublicKey) < 0) __PYX_ERR(1, 28, __pyx_L1_error) __pyx_type_4ssh2_4pkey_PublicKey.tp_print = 0; - if (PyObject_SetAttrString(__pyx_m, "PublicKey", (PyObject *)&__pyx_type_4ssh2_4pkey_PublicKey) < 0) __PYX_ERR(1, 26, __pyx_L1_error) - if (__Pyx_setup_reduce((PyObject*)&__pyx_type_4ssh2_4pkey_PublicKey) < 0) __PYX_ERR(1, 26, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "PublicKey", (PyObject *)&__pyx_type_4ssh2_4pkey_PublicKey) < 0) __PYX_ERR(1, 28, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_4ssh2_4pkey_PublicKey) < 0) __PYX_ERR(1, 28, __pyx_L1_error) __pyx_ptype_4ssh2_4pkey_PublicKey = &__pyx_type_4ssh2_4pkey_PublicKey; /*--- Type import code ---*/ /*--- Variable import code ---*/ diff --git a/ssh2/pkey.pyx b/ssh2/pkey.pyx index b4f6aab3..388364f2 100644 --- a/ssh2/pkey.pyx +++ b/ssh2/pkey.pyx @@ -14,6 +14,8 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# cython: embedsignature=True, boundscheck=False, optimize.use_switch=True, wraparound=False + cimport c_ssh2 diff --git a/ssh2/session.c b/ssh2/session.c index e9e065ad..6c519cc4 100644 --- a/ssh2/session.c +++ b/ssh2/session.c @@ -1,24 +1,5 @@ /* Generated by Cython 0.26 */ -/* BEGIN: Cython Metadata -{ - "distutils": { - "depends": [], - "extra_compile_args": [ - "-ggdb" - ], - "libraries": [ - "ssh2" - ], - "name": "ssh2.session", - "sources": [ - "ssh2/session.pyx" - ] - }, - "module_name": "ssh2.session" -} -END: Cython Metadata */ - #define PY_SSIZE_T_CLEAN #include "Python.h" #ifndef Py_PYTHON_H @@ -946,7 +927,7 @@ struct __pyx_obj_4ssh2_7session_Session { -/* "ssh2/session.pyx":34 +/* "ssh2/session.pyx":37 * * * cdef class Session: # <<<<<<<<<<<<<< @@ -1443,7 +1424,7 @@ static PyObject *__pyx_tuple__4; static PyObject *__pyx_tuple__6; static PyObject *__pyx_tuple__7; -/* "ssh2/session.pyx":38 +/* "ssh2/session.pyx":41 * """LibSSH2 Session class providing session functions""" * * def __cinit__(self): # <<<<<<<<<<<<<< @@ -1473,7 +1454,7 @@ static int __pyx_pf_4ssh2_7session_7Session___cinit__(struct __pyx_obj_4ssh2_7se int __pyx_t_1; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "ssh2/session.pyx":39 + /* "ssh2/session.pyx":42 * * def __cinit__(self): * with nogil: # <<<<<<<<<<<<<< @@ -1488,7 +1469,7 @@ static int __pyx_pf_4ssh2_7session_7Session___cinit__(struct __pyx_obj_4ssh2_7se #endif /*try:*/ { - /* "ssh2/session.pyx":40 + /* "ssh2/session.pyx":43 * def __cinit__(self): * with nogil: * self._session = c_ssh2.libssh2_session_init() # <<<<<<<<<<<<<< @@ -1497,7 +1478,7 @@ static int __pyx_pf_4ssh2_7session_7Session___cinit__(struct __pyx_obj_4ssh2_7se */ __pyx_v_self->_session = libssh2_session_init(); - /* "ssh2/session.pyx":41 + /* "ssh2/session.pyx":44 * with nogil: * self._session = c_ssh2.libssh2_session_init() * if self._session is NULL: # <<<<<<<<<<<<<< @@ -1507,7 +1488,7 @@ static int __pyx_pf_4ssh2_7session_7Session___cinit__(struct __pyx_obj_4ssh2_7se __pyx_t_1 = ((__pyx_v_self->_session == NULL) != 0); if (__pyx_t_1) { - /* "ssh2/session.pyx":42 + /* "ssh2/session.pyx":45 * self._session = c_ssh2.libssh2_session_init() * if self._session is NULL: * with gil: # <<<<<<<<<<<<<< @@ -1520,17 +1501,17 @@ static int __pyx_pf_4ssh2_7session_7Session___cinit__(struct __pyx_obj_4ssh2_7se #endif /*try:*/ { - /* "ssh2/session.pyx":43 + /* "ssh2/session.pyx":46 * if self._session is NULL: * with gil: * raise MemoryError # <<<<<<<<<<<<<< * * def __dealloc__(self): */ - PyErr_NoMemory(); __PYX_ERR(0, 43, __pyx_L8_error) + PyErr_NoMemory(); __PYX_ERR(0, 46, __pyx_L8_error) } - /* "ssh2/session.pyx":42 + /* "ssh2/session.pyx":45 * self._session = c_ssh2.libssh2_session_init() * if self._session is NULL: * with gil: # <<<<<<<<<<<<<< @@ -1547,7 +1528,7 @@ static int __pyx_pf_4ssh2_7session_7Session___cinit__(struct __pyx_obj_4ssh2_7se } } - /* "ssh2/session.pyx":41 + /* "ssh2/session.pyx":44 * with nogil: * self._session = c_ssh2.libssh2_session_init() * if self._session is NULL: # <<<<<<<<<<<<<< @@ -1557,7 +1538,7 @@ static int __pyx_pf_4ssh2_7session_7Session___cinit__(struct __pyx_obj_4ssh2_7se } } - /* "ssh2/session.pyx":39 + /* "ssh2/session.pyx":42 * * def __cinit__(self): * with nogil: # <<<<<<<<<<<<<< @@ -1583,7 +1564,7 @@ static int __pyx_pf_4ssh2_7session_7Session___cinit__(struct __pyx_obj_4ssh2_7se } } - /* "ssh2/session.pyx":38 + /* "ssh2/session.pyx":41 * """LibSSH2 Session class providing session functions""" * * def __cinit__(self): # <<<<<<<<<<<<<< @@ -1602,7 +1583,7 @@ static int __pyx_pf_4ssh2_7session_7Session___cinit__(struct __pyx_obj_4ssh2_7se return __pyx_r; } -/* "ssh2/session.pyx":45 +/* "ssh2/session.pyx":48 * raise MemoryError * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -1625,7 +1606,7 @@ static void __pyx_pf_4ssh2_7session_7Session_2__dealloc__(struct __pyx_obj_4ssh2 __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "ssh2/session.pyx":46 + /* "ssh2/session.pyx":49 * * def __dealloc__(self): * with nogil: # <<<<<<<<<<<<<< @@ -1640,7 +1621,7 @@ static void __pyx_pf_4ssh2_7session_7Session_2__dealloc__(struct __pyx_obj_4ssh2 #endif /*try:*/ { - /* "ssh2/session.pyx":47 + /* "ssh2/session.pyx":50 * def __dealloc__(self): * with nogil: * c_ssh2.libssh2_session_disconnect( # <<<<<<<<<<<<<< @@ -1649,7 +1630,7 @@ static void __pyx_pf_4ssh2_7session_7Session_2__dealloc__(struct __pyx_obj_4ssh2 */ libssh2_session_disconnect(__pyx_v_self->_session, ((char const *)"end")); - /* "ssh2/session.pyx":49 + /* "ssh2/session.pyx":52 * c_ssh2.libssh2_session_disconnect( * self._session, "end") * c_ssh2.libssh2_session_free(self._session) # <<<<<<<<<<<<<< @@ -1659,7 +1640,7 @@ static void __pyx_pf_4ssh2_7session_7Session_2__dealloc__(struct __pyx_obj_4ssh2 libssh2_session_free(__pyx_v_self->_session); } - /* "ssh2/session.pyx":46 + /* "ssh2/session.pyx":49 * * def __dealloc__(self): * with nogil: # <<<<<<<<<<<<<< @@ -1678,7 +1659,7 @@ static void __pyx_pf_4ssh2_7session_7Session_2__dealloc__(struct __pyx_obj_4ssh2 } } - /* "ssh2/session.pyx":45 + /* "ssh2/session.pyx":48 * raise MemoryError * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -1690,7 +1671,7 @@ static void __pyx_pf_4ssh2_7session_7Session_2__dealloc__(struct __pyx_obj_4ssh2 __Pyx_RefNannyFinishContext(); } -/* "ssh2/session.pyx":51 +/* "ssh2/session.pyx":54 * c_ssh2.libssh2_session_free(self._session) * * def disconnect(self): # <<<<<<<<<<<<<< @@ -1717,7 +1698,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_4disconnect(struct __pyx_obj_4 __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("disconnect", 0); - /* "ssh2/session.pyx":52 + /* "ssh2/session.pyx":55 * * def disconnect(self): * with nogil: # <<<<<<<<<<<<<< @@ -1732,7 +1713,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_4disconnect(struct __pyx_obj_4 #endif /*try:*/ { - /* "ssh2/session.pyx":53 + /* "ssh2/session.pyx":56 * def disconnect(self): * with nogil: * c_ssh2.libssh2_session_disconnect(self._session, "end") # <<<<<<<<<<<<<< @@ -1742,7 +1723,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_4disconnect(struct __pyx_obj_4 libssh2_session_disconnect(__pyx_v_self->_session, ((char const *)"end")); } - /* "ssh2/session.pyx":52 + /* "ssh2/session.pyx":55 * * def disconnect(self): * with nogil: # <<<<<<<<<<<<<< @@ -1761,7 +1742,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_4disconnect(struct __pyx_obj_4 } } - /* "ssh2/session.pyx":51 + /* "ssh2/session.pyx":54 * c_ssh2.libssh2_session_free(self._session) * * def disconnect(self): # <<<<<<<<<<<<<< @@ -1776,7 +1757,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_4disconnect(struct __pyx_obj_4 return __pyx_r; } -/* "ssh2/session.pyx":55 +/* "ssh2/session.pyx":58 * c_ssh2.libssh2_session_disconnect(self._session, "end") * * def handshake(self, sock not None): # <<<<<<<<<<<<<< @@ -1792,7 +1773,7 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_7handshake(PyObject *__pyx_v_s __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("handshake (wrapper)", 0); if (unlikely(((PyObject *)__pyx_v_sock) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "sock"); __PYX_ERR(0, 55, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "sock"); __PYX_ERR(0, 58, __pyx_L1_error) } __pyx_r = __pyx_pf_4ssh2_7session_7Session_6handshake(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), ((PyObject *)__pyx_v_sock)); @@ -1817,17 +1798,17 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_6handshake(struct __pyx_obj_4s PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("handshake", 0); - /* "ssh2/session.pyx":56 + /* "ssh2/session.pyx":59 * * def handshake(self, sock not None): * cdef int _sock = PyObject_AsFileDescriptor(sock) # <<<<<<<<<<<<<< * cdef int rc * with nogil: */ - __pyx_t_1 = PyObject_AsFileDescriptor(__pyx_v_sock); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 56, __pyx_L1_error) + __pyx_t_1 = PyObject_AsFileDescriptor(__pyx_v_sock); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 59, __pyx_L1_error) __pyx_v__sock = __pyx_t_1; - /* "ssh2/session.pyx":58 + /* "ssh2/session.pyx":61 * cdef int _sock = PyObject_AsFileDescriptor(sock) * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -1842,7 +1823,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_6handshake(struct __pyx_obj_4s #endif /*try:*/ { - /* "ssh2/session.pyx":59 + /* "ssh2/session.pyx":62 * cdef int rc * with nogil: * rc = c_ssh2.libssh2_session_handshake(self._session, _sock) # <<<<<<<<<<<<<< @@ -1851,7 +1832,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_6handshake(struct __pyx_obj_4s */ __pyx_v_rc = libssh2_session_handshake(__pyx_v_self->_session, __pyx_v__sock); - /* "ssh2/session.pyx":60 + /* "ssh2/session.pyx":63 * with nogil: * rc = c_ssh2.libssh2_session_handshake(self._session, _sock) * if rc != 0 and rc != c_ssh2._LIBSSH2_ERROR_EAGAIN: # <<<<<<<<<<<<<< @@ -1869,7 +1850,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_6handshake(struct __pyx_obj_4s __pyx_L7_bool_binop_done:; if (__pyx_t_2) { - /* "ssh2/session.pyx":61 + /* "ssh2/session.pyx":64 * rc = c_ssh2.libssh2_session_handshake(self._session, _sock) * if rc != 0 and rc != c_ssh2._LIBSSH2_ERROR_EAGAIN: * with gil: # <<<<<<<<<<<<<< @@ -1882,24 +1863,24 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_6handshake(struct __pyx_obj_4s #endif /*try:*/ { - /* "ssh2/session.pyx":64 + /* "ssh2/session.pyx":67 * raise SessionHandshakeError( * "SSH session handshake failed with error code %s", * rc) # <<<<<<<<<<<<<< * return rc * */ - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 64, __pyx_L10_error) + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 67, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_4); - /* "ssh2/session.pyx":62 + /* "ssh2/session.pyx":65 * if rc != 0 and rc != c_ssh2._LIBSSH2_ERROR_EAGAIN: * with gil: * raise SessionHandshakeError( # <<<<<<<<<<<<<< * "SSH session handshake failed with error code %s", * rc) */ - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 62, __pyx_L10_error) + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 65, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_kp_s_SSH_session_handshake_failed_wit); __Pyx_GIVEREF(__pyx_kp_s_SSH_session_handshake_failed_wit); @@ -1907,15 +1888,15 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_6handshake(struct __pyx_obj_4s __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4ssh2_10exceptions_SessionHandshakeError), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 62, __pyx_L10_error) + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4ssh2_10exceptions_SessionHandshakeError), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 65, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(0, 62, __pyx_L10_error) + __PYX_ERR(0, 65, __pyx_L10_error) } - /* "ssh2/session.pyx":61 + /* "ssh2/session.pyx":64 * rc = c_ssh2.libssh2_session_handshake(self._session, _sock) * if rc != 0 and rc != c_ssh2._LIBSSH2_ERROR_EAGAIN: * with gil: # <<<<<<<<<<<<<< @@ -1932,7 +1913,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_6handshake(struct __pyx_obj_4s } } - /* "ssh2/session.pyx":60 + /* "ssh2/session.pyx":63 * with nogil: * rc = c_ssh2.libssh2_session_handshake(self._session, _sock) * if rc != 0 and rc != c_ssh2._LIBSSH2_ERROR_EAGAIN: # <<<<<<<<<<<<<< @@ -1942,7 +1923,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_6handshake(struct __pyx_obj_4s } } - /* "ssh2/session.pyx":58 + /* "ssh2/session.pyx":61 * cdef int _sock = PyObject_AsFileDescriptor(sock) * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -1968,7 +1949,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_6handshake(struct __pyx_obj_4s } } - /* "ssh2/session.pyx":65 + /* "ssh2/session.pyx":68 * "SSH session handshake failed with error code %s", * rc) * return rc # <<<<<<<<<<<<<< @@ -1976,13 +1957,13 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_6handshake(struct __pyx_obj_4s * def startup(self, sock): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 65, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":55 + /* "ssh2/session.pyx":58 * c_ssh2.libssh2_session_disconnect(self._session, "end") * * def handshake(self, sock not None): # <<<<<<<<<<<<<< @@ -2002,7 +1983,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_6handshake(struct __pyx_obj_4s return __pyx_r; } -/* "ssh2/session.pyx":67 +/* "ssh2/session.pyx":70 * return rc * * def startup(self, sock): # <<<<<<<<<<<<<< @@ -2036,17 +2017,17 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_8startup(struct __pyx_obj_4ssh PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("startup", 0); - /* "ssh2/session.pyx":69 + /* "ssh2/session.pyx":72 * def startup(self, sock): * """Deprecated - use self.handshake""" * cdef int _sock = PyObject_AsFileDescriptor(sock) # <<<<<<<<<<<<<< * cdef int rc * with nogil: */ - __pyx_t_1 = PyObject_AsFileDescriptor(__pyx_v_sock); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 69, __pyx_L1_error) + __pyx_t_1 = PyObject_AsFileDescriptor(__pyx_v_sock); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 72, __pyx_L1_error) __pyx_v__sock = __pyx_t_1; - /* "ssh2/session.pyx":71 + /* "ssh2/session.pyx":74 * cdef int _sock = PyObject_AsFileDescriptor(sock) * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -2061,7 +2042,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_8startup(struct __pyx_obj_4ssh #endif /*try:*/ { - /* "ssh2/session.pyx":72 + /* "ssh2/session.pyx":75 * cdef int rc * with nogil: * rc = c_ssh2.libssh2_session_startup(self._session, _sock) # <<<<<<<<<<<<<< @@ -2070,7 +2051,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_8startup(struct __pyx_obj_4ssh */ __pyx_v_rc = libssh2_session_startup(__pyx_v_self->_session, __pyx_v__sock); - /* "ssh2/session.pyx":73 + /* "ssh2/session.pyx":76 * with nogil: * rc = c_ssh2.libssh2_session_startup(self._session, _sock) * if rc != 0 and rc != c_ssh2._LIBSSH2_ERROR_EAGAIN: # <<<<<<<<<<<<<< @@ -2088,7 +2069,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_8startup(struct __pyx_obj_4ssh __pyx_L7_bool_binop_done:; if (__pyx_t_2) { - /* "ssh2/session.pyx":74 + /* "ssh2/session.pyx":77 * rc = c_ssh2.libssh2_session_startup(self._session, _sock) * if rc != 0 and rc != c_ssh2._LIBSSH2_ERROR_EAGAIN: * with gil: # <<<<<<<<<<<<<< @@ -2101,24 +2082,24 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_8startup(struct __pyx_obj_4ssh #endif /*try:*/ { - /* "ssh2/session.pyx":77 + /* "ssh2/session.pyx":80 * raise SessionStartupError( * "SSH session startup failed with error code %s", * rc) # <<<<<<<<<<<<<< * return rc * */ - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 77, __pyx_L10_error) + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 80, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_4); - /* "ssh2/session.pyx":75 + /* "ssh2/session.pyx":78 * if rc != 0 and rc != c_ssh2._LIBSSH2_ERROR_EAGAIN: * with gil: * raise SessionStartupError( # <<<<<<<<<<<<<< * "SSH session startup failed with error code %s", * rc) */ - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 75, __pyx_L10_error) + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 78, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_kp_s_SSH_session_startup_failed_with); __Pyx_GIVEREF(__pyx_kp_s_SSH_session_startup_failed_with); @@ -2126,15 +2107,15 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_8startup(struct __pyx_obj_4ssh __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4ssh2_10exceptions_SessionStartupError), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 75, __pyx_L10_error) + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4ssh2_10exceptions_SessionStartupError), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 78, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(0, 75, __pyx_L10_error) + __PYX_ERR(0, 78, __pyx_L10_error) } - /* "ssh2/session.pyx":74 + /* "ssh2/session.pyx":77 * rc = c_ssh2.libssh2_session_startup(self._session, _sock) * if rc != 0 and rc != c_ssh2._LIBSSH2_ERROR_EAGAIN: * with gil: # <<<<<<<<<<<<<< @@ -2151,7 +2132,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_8startup(struct __pyx_obj_4ssh } } - /* "ssh2/session.pyx":73 + /* "ssh2/session.pyx":76 * with nogil: * rc = c_ssh2.libssh2_session_startup(self._session, _sock) * if rc != 0 and rc != c_ssh2._LIBSSH2_ERROR_EAGAIN: # <<<<<<<<<<<<<< @@ -2161,7 +2142,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_8startup(struct __pyx_obj_4ssh } } - /* "ssh2/session.pyx":71 + /* "ssh2/session.pyx":74 * cdef int _sock = PyObject_AsFileDescriptor(sock) * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -2187,7 +2168,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_8startup(struct __pyx_obj_4ssh } } - /* "ssh2/session.pyx":78 + /* "ssh2/session.pyx":81 * "SSH session startup failed with error code %s", * rc) * return rc # <<<<<<<<<<<<<< @@ -2195,13 +2176,13 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_8startup(struct __pyx_obj_4ssh * def set_blocking(self, bint blocking): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 78, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":67 + /* "ssh2/session.pyx":70 * return rc * * def startup(self, sock): # <<<<<<<<<<<<<< @@ -2221,7 +2202,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_8startup(struct __pyx_obj_4ssh return __pyx_r; } -/* "ssh2/session.pyx":80 +/* "ssh2/session.pyx":83 * return rc * * def set_blocking(self, bint blocking): # <<<<<<<<<<<<<< @@ -2238,7 +2219,7 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_11set_blocking(PyObject *__pyx __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_blocking (wrapper)", 0); assert(__pyx_arg_blocking); { - __pyx_v_blocking = __Pyx_PyObject_IsTrue(__pyx_arg_blocking); if (unlikely((__pyx_v_blocking == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 80, __pyx_L3_error) + __pyx_v_blocking = __Pyx_PyObject_IsTrue(__pyx_arg_blocking); if (unlikely((__pyx_v_blocking == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 83, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -2258,7 +2239,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_10set_blocking(struct __pyx_ob __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_blocking", 0); - /* "ssh2/session.pyx":86 + /* "ssh2/session.pyx":89 * Session default is blocking unless set otherwise. * :type blocking: bool""" * with nogil: # <<<<<<<<<<<<<< @@ -2273,7 +2254,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_10set_blocking(struct __pyx_ob #endif /*try:*/ { - /* "ssh2/session.pyx":87 + /* "ssh2/session.pyx":90 * :type blocking: bool""" * with nogil: * c_ssh2.libssh2_session_set_blocking( # <<<<<<<<<<<<<< @@ -2283,7 +2264,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_10set_blocking(struct __pyx_ob libssh2_session_set_blocking(__pyx_v_self->_session, __pyx_v_blocking); } - /* "ssh2/session.pyx":86 + /* "ssh2/session.pyx":89 * Session default is blocking unless set otherwise. * :type blocking: bool""" * with nogil: # <<<<<<<<<<<<<< @@ -2302,7 +2283,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_10set_blocking(struct __pyx_ob } } - /* "ssh2/session.pyx":80 + /* "ssh2/session.pyx":83 * return rc * * def set_blocking(self, bint blocking): # <<<<<<<<<<<<<< @@ -2317,7 +2298,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_10set_blocking(struct __pyx_ob return __pyx_r; } -/* "ssh2/session.pyx":90 +/* "ssh2/session.pyx":93 * self._session, blocking) * * def get_blocking(self): # <<<<<<<<<<<<<< @@ -2347,7 +2328,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_12get_blocking(struct __pyx_ob int __pyx_t_2; __Pyx_RefNannySetupContext("get_blocking", 0); - /* "ssh2/session.pyx":95 + /* "ssh2/session.pyx":98 * :rtype: bool""" * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -2362,7 +2343,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_12get_blocking(struct __pyx_ob #endif /*try:*/ { - /* "ssh2/session.pyx":96 + /* "ssh2/session.pyx":99 * cdef int rc * with nogil: * rc = c_ssh2.libssh2_session_get_blocking(self._session) # <<<<<<<<<<<<<< @@ -2372,7 +2353,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_12get_blocking(struct __pyx_ob __pyx_v_rc = libssh2_session_get_blocking(__pyx_v_self->_session); } - /* "ssh2/session.pyx":95 + /* "ssh2/session.pyx":98 * :rtype: bool""" * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -2391,7 +2372,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_12get_blocking(struct __pyx_ob } } - /* "ssh2/session.pyx":97 + /* "ssh2/session.pyx":100 * with nogil: * rc = c_ssh2.libssh2_session_get_blocking(self._session) * return bool(rc) # <<<<<<<<<<<<<< @@ -2399,17 +2380,17 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_12get_blocking(struct __pyx_ob * def set_timeout(self, long timeout): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 97, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 100, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":90 + /* "ssh2/session.pyx":93 * self._session, blocking) * * def get_blocking(self): # <<<<<<<<<<<<<< @@ -2428,7 +2409,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_12get_blocking(struct __pyx_ob return __pyx_r; } -/* "ssh2/session.pyx":99 +/* "ssh2/session.pyx":102 * return bool(rc) * * def set_timeout(self, long timeout): # <<<<<<<<<<<<<< @@ -2445,7 +2426,7 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_15set_timeout(PyObject *__pyx_ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_timeout (wrapper)", 0); assert(__pyx_arg_timeout); { - __pyx_v_timeout = __Pyx_PyInt_As_long(__pyx_arg_timeout); if (unlikely((__pyx_v_timeout == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 99, __pyx_L3_error) + __pyx_v_timeout = __Pyx_PyInt_As_long(__pyx_arg_timeout); if (unlikely((__pyx_v_timeout == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 102, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -2465,7 +2446,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_14set_timeout(struct __pyx_obj __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_timeout", 0); - /* "ssh2/session.pyx":107 + /* "ssh2/session.pyx":110 * for blocking functions. * :param timeout: Milliseconds to wait before timeout.""" * with nogil: # <<<<<<<<<<<<<< @@ -2480,7 +2461,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_14set_timeout(struct __pyx_obj #endif /*try:*/ { - /* "ssh2/session.pyx":108 + /* "ssh2/session.pyx":111 * :param timeout: Milliseconds to wait before timeout.""" * with nogil: * c_ssh2.libssh2_session_set_timeout(self._session, timeout) # <<<<<<<<<<<<<< @@ -2490,7 +2471,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_14set_timeout(struct __pyx_obj libssh2_session_set_timeout(__pyx_v_self->_session, __pyx_v_timeout); } - /* "ssh2/session.pyx":107 + /* "ssh2/session.pyx":110 * for blocking functions. * :param timeout: Milliseconds to wait before timeout.""" * with nogil: # <<<<<<<<<<<<<< @@ -2509,7 +2490,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_14set_timeout(struct __pyx_obj } } - /* "ssh2/session.pyx":99 + /* "ssh2/session.pyx":102 * return bool(rc) * * def set_timeout(self, long timeout): # <<<<<<<<<<<<<< @@ -2524,7 +2505,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_14set_timeout(struct __pyx_obj return __pyx_r; } -/* "ssh2/session.pyx":110 +/* "ssh2/session.pyx":113 * c_ssh2.libssh2_session_set_timeout(self._session, timeout) * * def get_timeout(self): # <<<<<<<<<<<<<< @@ -2553,7 +2534,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_16get_timeout(struct __pyx_obj PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("get_timeout", 0); - /* "ssh2/session.pyx":113 + /* "ssh2/session.pyx":116 * """Get current session timeout setting""" * cdef long timeout * with nogil: # <<<<<<<<<<<<<< @@ -2568,7 +2549,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_16get_timeout(struct __pyx_obj #endif /*try:*/ { - /* "ssh2/session.pyx":114 + /* "ssh2/session.pyx":117 * cdef long timeout * with nogil: * timeout = c_ssh2.libssh2_session_get_timeout(self._session) # <<<<<<<<<<<<<< @@ -2578,7 +2559,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_16get_timeout(struct __pyx_obj __pyx_v_timeout = libssh2_session_get_timeout(__pyx_v_self->_session); } - /* "ssh2/session.pyx":113 + /* "ssh2/session.pyx":116 * """Get current session timeout setting""" * cdef long timeout * with nogil: # <<<<<<<<<<<<<< @@ -2597,7 +2578,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_16get_timeout(struct __pyx_obj } } - /* "ssh2/session.pyx":115 + /* "ssh2/session.pyx":118 * with nogil: * timeout = c_ssh2.libssh2_session_get_timeout(self._session) * return timeout # <<<<<<<<<<<<<< @@ -2605,13 +2586,13 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_16get_timeout(struct __pyx_obj * def userauth_authenticated(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_timeout); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 115, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_timeout); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":110 + /* "ssh2/session.pyx":113 * c_ssh2.libssh2_session_set_timeout(self._session, timeout) * * def get_timeout(self): # <<<<<<<<<<<<<< @@ -2630,7 +2611,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_16get_timeout(struct __pyx_obj return __pyx_r; } -/* "ssh2/session.pyx":117 +/* "ssh2/session.pyx":120 * return timeout * * def userauth_authenticated(self): # <<<<<<<<<<<<<< @@ -2660,7 +2641,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_18userauth_authenticated(struc PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("userauth_authenticated", 0); - /* "ssh2/session.pyx":122 + /* "ssh2/session.pyx":125 * :rtype: bool""" * cdef bint rc * with nogil: # <<<<<<<<<<<<<< @@ -2675,7 +2656,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_18userauth_authenticated(struc #endif /*try:*/ { - /* "ssh2/session.pyx":123 + /* "ssh2/session.pyx":126 * cdef bint rc * with nogil: * rc = c_ssh2.libssh2_userauth_authenticated(self._session) # <<<<<<<<<<<<<< @@ -2685,7 +2666,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_18userauth_authenticated(struc __pyx_v_rc = libssh2_userauth_authenticated(__pyx_v_self->_session); } - /* "ssh2/session.pyx":122 + /* "ssh2/session.pyx":125 * :rtype: bool""" * cdef bint rc * with nogil: # <<<<<<<<<<<<<< @@ -2704,7 +2685,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_18userauth_authenticated(struc } } - /* "ssh2/session.pyx":124 + /* "ssh2/session.pyx":127 * with nogil: * rc = c_ssh2.libssh2_userauth_authenticated(self._session) * return bool(rc) # <<<<<<<<<<<<<< @@ -2713,13 +2694,13 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_18userauth_authenticated(struc */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_v_rc; - __pyx_t_2 = __Pyx_PyBool_FromLong((!(!__pyx_t_1))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 124, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBool_FromLong((!(!__pyx_t_1))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":117 + /* "ssh2/session.pyx":120 * return timeout * * def userauth_authenticated(self): # <<<<<<<<<<<<<< @@ -2738,7 +2719,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_18userauth_authenticated(struc return __pyx_r; } -/* "ssh2/session.pyx":126 +/* "ssh2/session.pyx":129 * return bool(rc) * * def userauth_list(self, username not None): # <<<<<<<<<<<<<< @@ -2754,7 +2735,7 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_21userauth_list(PyObject *__py __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("userauth_list (wrapper)", 0); if (unlikely(((PyObject *)__pyx_v_username) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "username"); __PYX_ERR(0, 126, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "username"); __PYX_ERR(0, 129, __pyx_L1_error) } __pyx_r = __pyx_pf_4ssh2_7session_7Session_20userauth_list(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), ((PyObject *)__pyx_v_username)); @@ -2780,7 +2761,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_20userauth_list(struct __pyx_o PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("userauth_list", 0); - /* "ssh2/session.pyx":130 + /* "ssh2/session.pyx":133 * * :rtype: list""" * cdef char *_username = to_bytes(username) # <<<<<<<<<<<<<< @@ -2789,7 +2770,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_20userauth_list(struct __pyx_o */ __pyx_v__username = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_username); - /* "ssh2/session.pyx":131 + /* "ssh2/session.pyx":134 * :rtype: list""" * cdef char *_username = to_bytes(username) * cdef size_t username_len = len(_username) # <<<<<<<<<<<<<< @@ -2799,7 +2780,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_20userauth_list(struct __pyx_o __pyx_t_1 = strlen(__pyx_v__username); __pyx_v_username_len = __pyx_t_1; - /* "ssh2/session.pyx":134 + /* "ssh2/session.pyx":137 * cdef char *_auth * cdef str auth * with nogil: # <<<<<<<<<<<<<< @@ -2814,7 +2795,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_20userauth_list(struct __pyx_o #endif /*try:*/ { - /* "ssh2/session.pyx":135 + /* "ssh2/session.pyx":138 * cdef str auth * with nogil: * _auth = c_ssh2.libssh2_userauth_list( # <<<<<<<<<<<<<< @@ -2824,7 +2805,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_20userauth_list(struct __pyx_o __pyx_v__auth = libssh2_userauth_list(__pyx_v_self->_session, __pyx_v__username, __pyx_v_username_len); } - /* "ssh2/session.pyx":134 + /* "ssh2/session.pyx":137 * cdef char *_auth * cdef str auth * with nogil: # <<<<<<<<<<<<<< @@ -2843,7 +2824,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_20userauth_list(struct __pyx_o } } - /* "ssh2/session.pyx":137 + /* "ssh2/session.pyx":140 * _auth = c_ssh2.libssh2_userauth_list( * self._session, _username, username_len) * if _auth is NULL: # <<<<<<<<<<<<<< @@ -2853,7 +2834,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_20userauth_list(struct __pyx_o __pyx_t_2 = ((__pyx_v__auth == NULL) != 0); if (__pyx_t_2) { - /* "ssh2/session.pyx":138 + /* "ssh2/session.pyx":141 * self._session, _username, username_len) * if _auth is NULL: * return # <<<<<<<<<<<<<< @@ -2864,7 +2845,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_20userauth_list(struct __pyx_o __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "ssh2/session.pyx":137 + /* "ssh2/session.pyx":140 * _auth = c_ssh2.libssh2_userauth_list( * self._session, _username, username_len) * if _auth is NULL: # <<<<<<<<<<<<<< @@ -2873,20 +2854,20 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_20userauth_list(struct __pyx_o */ } - /* "ssh2/session.pyx":139 + /* "ssh2/session.pyx":142 * if _auth is NULL: * return * auth = to_str(_auth) # <<<<<<<<<<<<<< * return auth.split(',') * */ - __pyx_t_3 = __pyx_f_4ssh2_5utils_to_str(__pyx_v__auth); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 139, __pyx_L1_error) + __pyx_t_3 = __pyx_f_4ssh2_5utils_to_str(__pyx_v__auth); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (!(likely(PyString_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(0, 139, __pyx_L1_error) + if (!(likely(PyString_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(0, 142, __pyx_L1_error) __pyx_v_auth = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; - /* "ssh2/session.pyx":140 + /* "ssh2/session.pyx":143 * return * auth = to_str(_auth) * return auth.split(',') # <<<<<<<<<<<<<< @@ -2894,16 +2875,16 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_20userauth_list(struct __pyx_o * def userauth_publickey_fromfile(self, username not None, */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_auth, __pyx_n_s_split); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 140, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_auth, __pyx_n_s_split); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 140, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":126 + /* "ssh2/session.pyx":129 * return bool(rc) * * def userauth_list(self, username not None): # <<<<<<<<<<<<<< @@ -2924,7 +2905,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_20userauth_list(struct __pyx_o return __pyx_r; } -/* "ssh2/session.pyx":142 +/* "ssh2/session.pyx":145 * return auth.split(',') * * def userauth_publickey_fromfile(self, username not None, # <<<<<<<<<<<<<< @@ -2970,23 +2951,23 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_23userauth_publickey_fromfile( case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_publickey)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("userauth_publickey_fromfile", 1, 4, 4, 1); __PYX_ERR(0, 142, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("userauth_publickey_fromfile", 1, 4, 4, 1); __PYX_ERR(0, 145, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_privatekey)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("userauth_publickey_fromfile", 1, 4, 4, 2); __PYX_ERR(0, 142, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("userauth_publickey_fromfile", 1, 4, 4, 2); __PYX_ERR(0, 145, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_passphrase)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("userauth_publickey_fromfile", 1, 4, 4, 3); __PYX_ERR(0, 142, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("userauth_publickey_fromfile", 1, 4, 4, 3); __PYX_ERR(0, 145, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "userauth_publickey_fromfile") < 0)) __PYX_ERR(0, 142, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "userauth_publickey_fromfile") < 0)) __PYX_ERR(0, 145, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; @@ -3003,23 +2984,23 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_23userauth_publickey_fromfile( } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("userauth_publickey_fromfile", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 142, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("userauth_publickey_fromfile", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 145, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.session.Session.userauth_publickey_fromfile", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(((PyObject *)__pyx_v_username) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "username"); __PYX_ERR(0, 142, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "username"); __PYX_ERR(0, 145, __pyx_L1_error) } if (unlikely(((PyObject *)__pyx_v_publickey) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "publickey"); __PYX_ERR(0, 143, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "publickey"); __PYX_ERR(0, 146, __pyx_L1_error) } if (unlikely(((PyObject *)__pyx_v_privatekey) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "privatekey"); __PYX_ERR(0, 144, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "privatekey"); __PYX_ERR(0, 147, __pyx_L1_error) } if (unlikely(((PyObject *)__pyx_v_passphrase) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "passphrase"); __PYX_ERR(0, 145, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "passphrase"); __PYX_ERR(0, 148, __pyx_L1_error) } __pyx_r = __pyx_pf_4ssh2_7session_7Session_22userauth_publickey_fromfile(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), __pyx_v_username, __pyx_v_publickey, __pyx_v_privatekey, __pyx_v_passphrase); @@ -3043,7 +3024,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_22userauth_publickey_fromfile( PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("userauth_publickey_fromfile", 0); - /* "ssh2/session.pyx":150 + /* "ssh2/session.pyx":153 * :rtype: int""" * cdef int rc * cdef char *_username = to_bytes(username) # <<<<<<<<<<<<<< @@ -3052,7 +3033,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_22userauth_publickey_fromfile( */ __pyx_v__username = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_username); - /* "ssh2/session.pyx":151 + /* "ssh2/session.pyx":154 * cdef int rc * cdef char *_username = to_bytes(username) * cdef char *_publickey = to_bytes(publickey) # <<<<<<<<<<<<<< @@ -3061,7 +3042,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_22userauth_publickey_fromfile( */ __pyx_v__publickey = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_publickey); - /* "ssh2/session.pyx":152 + /* "ssh2/session.pyx":155 * cdef char *_username = to_bytes(username) * cdef char *_publickey = to_bytes(publickey) * cdef char *_privatekey = to_bytes(privatekey) # <<<<<<<<<<<<<< @@ -3070,7 +3051,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_22userauth_publickey_fromfile( */ __pyx_v__privatekey = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_privatekey); - /* "ssh2/session.pyx":153 + /* "ssh2/session.pyx":156 * cdef char *_publickey = to_bytes(publickey) * cdef char *_privatekey = to_bytes(privatekey) * cdef char *_passphrase = to_bytes(passphrase) # <<<<<<<<<<<<<< @@ -3079,7 +3060,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_22userauth_publickey_fromfile( */ __pyx_v__passphrase = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_passphrase); - /* "ssh2/session.pyx":154 + /* "ssh2/session.pyx":157 * cdef char *_privatekey = to_bytes(privatekey) * cdef char *_passphrase = to_bytes(passphrase) * with nogil: # <<<<<<<<<<<<<< @@ -3094,7 +3075,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_22userauth_publickey_fromfile( #endif /*try:*/ { - /* "ssh2/session.pyx":155 + /* "ssh2/session.pyx":158 * cdef char *_passphrase = to_bytes(passphrase) * with nogil: * rc = c_ssh2.libssh2_userauth_publickey_fromfile( # <<<<<<<<<<<<<< @@ -3104,7 +3085,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_22userauth_publickey_fromfile( __pyx_v_rc = libssh2_userauth_publickey_fromfile(__pyx_v_self->_session, __pyx_v__username, __pyx_v__publickey, __pyx_v__privatekey, __pyx_v__passphrase); } - /* "ssh2/session.pyx":154 + /* "ssh2/session.pyx":157 * cdef char *_privatekey = to_bytes(privatekey) * cdef char *_passphrase = to_bytes(passphrase) * with nogil: # <<<<<<<<<<<<<< @@ -3123,7 +3104,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_22userauth_publickey_fromfile( } } - /* "ssh2/session.pyx":157 + /* "ssh2/session.pyx":160 * rc = c_ssh2.libssh2_userauth_publickey_fromfile( * self._session, _username, _publickey, _privatekey, _passphrase) * return rc # <<<<<<<<<<<<<< @@ -3131,13 +3112,13 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_22userauth_publickey_fromfile( * def userauth_publickey(self, username not None, */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 157, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":142 + /* "ssh2/session.pyx":145 * return auth.split(',') * * def userauth_publickey_fromfile(self, username not None, # <<<<<<<<<<<<<< @@ -3156,7 +3137,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_22userauth_publickey_fromfile( return __pyx_r; } -/* "ssh2/session.pyx":159 +/* "ssh2/session.pyx":162 * return rc * * def userauth_publickey(self, username not None, # <<<<<<<<<<<<<< @@ -3196,11 +3177,11 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_25userauth_publickey(PyObject case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pubkeydata)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("userauth_publickey", 1, 2, 2, 1); __PYX_ERR(0, 159, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("userauth_publickey", 1, 2, 2, 1); __PYX_ERR(0, 162, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "userauth_publickey") < 0)) __PYX_ERR(0, 159, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "userauth_publickey") < 0)) __PYX_ERR(0, 162, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -3213,16 +3194,16 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_25userauth_publickey(PyObject } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("userauth_publickey", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 159, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("userauth_publickey", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 162, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.session.Session.userauth_publickey", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(((PyObject *)__pyx_v_username) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "username"); __PYX_ERR(0, 159, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "username"); __PYX_ERR(0, 162, __pyx_L1_error) } - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pubkeydata), (&PyBytes_Type), 0, "pubkeydata", 1))) __PYX_ERR(0, 160, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pubkeydata), (&PyBytes_Type), 0, "pubkeydata", 1))) __PYX_ERR(0, 163, __pyx_L1_error) __pyx_r = __pyx_pf_4ssh2_7session_7Session_24userauth_publickey(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), __pyx_v_username, __pyx_v_pubkeydata); /* function exit code */ @@ -3246,7 +3227,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_24userauth_publickey(struct __ PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("userauth_publickey", 0); - /* "ssh2/session.pyx":171 + /* "ssh2/session.pyx":174 * """ * cdef int rc * cdef char *_username = to_bytes(username) # <<<<<<<<<<<<<< @@ -3255,27 +3236,27 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_24userauth_publickey(struct __ */ __pyx_v__username = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_username); - /* "ssh2/session.pyx":172 + /* "ssh2/session.pyx":175 * cdef int rc * cdef char *_username = to_bytes(username) * cdef unsigned char *_pubkeydata = pubkeydata # <<<<<<<<<<<<<< * cdef size_t pubkeydata_len = len(pubkeydata) * with nogil: */ - __pyx_t_1 = __Pyx_PyObject_AsWritableUString(__pyx_v_pubkeydata); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(0, 172, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_AsWritableUString(__pyx_v_pubkeydata); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(0, 175, __pyx_L1_error) __pyx_v__pubkeydata = __pyx_t_1; - /* "ssh2/session.pyx":173 + /* "ssh2/session.pyx":176 * cdef char *_username = to_bytes(username) * cdef unsigned char *_pubkeydata = pubkeydata * cdef size_t pubkeydata_len = len(pubkeydata) # <<<<<<<<<<<<<< * with nogil: * rc = c_ssh2.libssh2_userauth_publickey( */ - __pyx_t_2 = PyBytes_GET_SIZE(__pyx_v_pubkeydata); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 173, __pyx_L1_error) + __pyx_t_2 = PyBytes_GET_SIZE(__pyx_v_pubkeydata); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 176, __pyx_L1_error) __pyx_v_pubkeydata_len = __pyx_t_2; - /* "ssh2/session.pyx":174 + /* "ssh2/session.pyx":177 * cdef unsigned char *_pubkeydata = pubkeydata * cdef size_t pubkeydata_len = len(pubkeydata) * with nogil: # <<<<<<<<<<<<<< @@ -3290,7 +3271,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_24userauth_publickey(struct __ #endif /*try:*/ { - /* "ssh2/session.pyx":175 + /* "ssh2/session.pyx":178 * cdef size_t pubkeydata_len = len(pubkeydata) * with nogil: * rc = c_ssh2.libssh2_userauth_publickey( # <<<<<<<<<<<<<< @@ -3300,7 +3281,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_24userauth_publickey(struct __ __pyx_v_rc = libssh2_userauth_publickey(__pyx_v_self->_session, __pyx_v__username, __pyx_v__pubkeydata, __pyx_v_pubkeydata_len, NULL, NULL); } - /* "ssh2/session.pyx":174 + /* "ssh2/session.pyx":177 * cdef unsigned char *_pubkeydata = pubkeydata * cdef size_t pubkeydata_len = len(pubkeydata) * with nogil: # <<<<<<<<<<<<<< @@ -3319,7 +3300,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_24userauth_publickey(struct __ } } - /* "ssh2/session.pyx":178 + /* "ssh2/session.pyx":181 * self._session, _username, _pubkeydata, * pubkeydata_len, NULL, NULL) * return rc # <<<<<<<<<<<<<< @@ -3327,13 +3308,13 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_24userauth_publickey(struct __ * def userauth_hostbased_fromfile(self, */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 178, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":159 + /* "ssh2/session.pyx":162 * return rc * * def userauth_publickey(self, username not None, # <<<<<<<<<<<<<< @@ -3352,7 +3333,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_24userauth_publickey(struct __ return __pyx_r; } -/* "ssh2/session.pyx":180 +/* "ssh2/session.pyx":183 * return rc * * def userauth_hostbased_fromfile(self, # <<<<<<<<<<<<<< @@ -3401,29 +3382,29 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_27userauth_hostbased_fromfile( case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_publickey)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("userauth_hostbased_fromfile", 1, 5, 5, 1); __PYX_ERR(0, 180, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("userauth_hostbased_fromfile", 1, 5, 5, 1); __PYX_ERR(0, 183, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_privatekey)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("userauth_hostbased_fromfile", 1, 5, 5, 2); __PYX_ERR(0, 180, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("userauth_hostbased_fromfile", 1, 5, 5, 2); __PYX_ERR(0, 183, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_passphrase)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("userauth_hostbased_fromfile", 1, 5, 5, 3); __PYX_ERR(0, 180, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("userauth_hostbased_fromfile", 1, 5, 5, 3); __PYX_ERR(0, 183, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_hostname)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("userauth_hostbased_fromfile", 1, 5, 5, 4); __PYX_ERR(0, 180, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("userauth_hostbased_fromfile", 1, 5, 5, 4); __PYX_ERR(0, 183, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "userauth_hostbased_fromfile") < 0)) __PYX_ERR(0, 180, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "userauth_hostbased_fromfile") < 0)) __PYX_ERR(0, 183, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 5) { goto __pyx_L5_argtuple_error; @@ -3442,26 +3423,26 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_27userauth_hostbased_fromfile( } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("userauth_hostbased_fromfile", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 180, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("userauth_hostbased_fromfile", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 183, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.session.Session.userauth_hostbased_fromfile", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(((PyObject *)__pyx_v_username) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "username"); __PYX_ERR(0, 181, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "username"); __PYX_ERR(0, 184, __pyx_L1_error) } if (unlikely(((PyObject *)__pyx_v_publickey) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "publickey"); __PYX_ERR(0, 182, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "publickey"); __PYX_ERR(0, 185, __pyx_L1_error) } if (unlikely(((PyObject *)__pyx_v_privatekey) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "privatekey"); __PYX_ERR(0, 183, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "privatekey"); __PYX_ERR(0, 186, __pyx_L1_error) } if (unlikely(((PyObject *)__pyx_v_passphrase) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "passphrase"); __PYX_ERR(0, 184, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "passphrase"); __PYX_ERR(0, 187, __pyx_L1_error) } if (unlikely(((PyObject *)__pyx_v_hostname) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "hostname"); __PYX_ERR(0, 185, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "hostname"); __PYX_ERR(0, 188, __pyx_L1_error) } __pyx_r = __pyx_pf_4ssh2_7session_7Session_26userauth_hostbased_fromfile(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), __pyx_v_username, __pyx_v_publickey, __pyx_v_privatekey, __pyx_v_passphrase, __pyx_v_hostname); @@ -3486,7 +3467,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_26userauth_hostbased_fromfile( PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("userauth_hostbased_fromfile", 0); - /* "ssh2/session.pyx":187 + /* "ssh2/session.pyx":190 * hostname not None): * cdef int rc * cdef char *_username = to_bytes(username) # <<<<<<<<<<<<<< @@ -3495,7 +3476,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_26userauth_hostbased_fromfile( */ __pyx_v__username = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_username); - /* "ssh2/session.pyx":188 + /* "ssh2/session.pyx":191 * cdef int rc * cdef char *_username = to_bytes(username) * cdef char *_publickey = to_bytes(publickey) # <<<<<<<<<<<<<< @@ -3504,7 +3485,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_26userauth_hostbased_fromfile( */ __pyx_v__publickey = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_publickey); - /* "ssh2/session.pyx":189 + /* "ssh2/session.pyx":192 * cdef char *_username = to_bytes(username) * cdef char *_publickey = to_bytes(publickey) * cdef char *_privatekey = to_bytes(privatekey) # <<<<<<<<<<<<<< @@ -3513,7 +3494,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_26userauth_hostbased_fromfile( */ __pyx_v__privatekey = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_privatekey); - /* "ssh2/session.pyx":190 + /* "ssh2/session.pyx":193 * cdef char *_publickey = to_bytes(publickey) * cdef char *_privatekey = to_bytes(privatekey) * cdef char *_passphrase = to_bytes(passphrase) # <<<<<<<<<<<<<< @@ -3522,7 +3503,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_26userauth_hostbased_fromfile( */ __pyx_v__passphrase = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_passphrase); - /* "ssh2/session.pyx":191 + /* "ssh2/session.pyx":194 * cdef char *_privatekey = to_bytes(privatekey) * cdef char *_passphrase = to_bytes(passphrase) * cdef char *_hostname = to_bytes(hostname) # <<<<<<<<<<<<<< @@ -3531,7 +3512,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_26userauth_hostbased_fromfile( */ __pyx_v__hostname = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_hostname); - /* "ssh2/session.pyx":192 + /* "ssh2/session.pyx":195 * cdef char *_passphrase = to_bytes(passphrase) * cdef char *_hostname = to_bytes(hostname) * with nogil: # <<<<<<<<<<<<<< @@ -3546,7 +3527,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_26userauth_hostbased_fromfile( #endif /*try:*/ { - /* "ssh2/session.pyx":193 + /* "ssh2/session.pyx":196 * cdef char *_hostname = to_bytes(hostname) * with nogil: * rc = c_ssh2.libssh2_userauth_hostbased_fromfile( # <<<<<<<<<<<<<< @@ -3556,7 +3537,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_26userauth_hostbased_fromfile( __pyx_v_rc = libssh2_userauth_hostbased_fromfile(__pyx_v_self->_session, __pyx_v__username, __pyx_v__publickey, __pyx_v__privatekey, __pyx_v__passphrase, __pyx_v__hostname); } - /* "ssh2/session.pyx":192 + /* "ssh2/session.pyx":195 * cdef char *_passphrase = to_bytes(passphrase) * cdef char *_hostname = to_bytes(hostname) * with nogil: # <<<<<<<<<<<<<< @@ -3575,21 +3556,21 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_26userauth_hostbased_fromfile( } } - /* "ssh2/session.pyx":196 + /* "ssh2/session.pyx":199 * self._session, _username, _publickey, * _privatekey, _passphrase, _hostname) * return rc # <<<<<<<<<<<<<< * - * # def userauth_publickey_frommemory(self, + * IF EMBEDDED_LIB: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 196, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":180 + /* "ssh2/session.pyx":183 * return rc * * def userauth_hostbased_fromfile(self, # <<<<<<<<<<<<<< @@ -3608,8 +3589,8 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_26userauth_hostbased_fromfile( return __pyx_r; } -/* "ssh2/session.pyx":214 - * # return rc +/* "ssh2/session.pyx":218 + * return rc * * def userauth_password(self, username not None, password not None): # <<<<<<<<<<<<<< * """Perform password authentication @@ -3648,11 +3629,11 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_29userauth_password(PyObject * case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_password)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("userauth_password", 1, 2, 2, 1); __PYX_ERR(0, 214, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("userauth_password", 1, 2, 2, 1); __PYX_ERR(0, 218, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "userauth_password") < 0)) __PYX_ERR(0, 214, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "userauth_password") < 0)) __PYX_ERR(0, 218, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -3665,17 +3646,17 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_29userauth_password(PyObject * } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("userauth_password", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 214, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("userauth_password", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 218, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.session.Session.userauth_password", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(((PyObject *)__pyx_v_username) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "username"); __PYX_ERR(0, 214, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "username"); __PYX_ERR(0, 218, __pyx_L1_error) } if (unlikely(((PyObject *)__pyx_v_password) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "password"); __PYX_ERR(0, 214, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "password"); __PYX_ERR(0, 218, __pyx_L1_error) } __pyx_r = __pyx_pf_4ssh2_7session_7Session_28userauth_password(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), __pyx_v_username, __pyx_v_password); @@ -3697,7 +3678,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_28userauth_password(struct __p PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("userauth_password", 0); - /* "ssh2/session.pyx":222 + /* "ssh2/session.pyx":226 * :type password: str""" * cdef int rc * cdef const char *_username = to_bytes(username) # <<<<<<<<<<<<<< @@ -3706,7 +3687,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_28userauth_password(struct __p */ __pyx_v__username = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_username); - /* "ssh2/session.pyx":223 + /* "ssh2/session.pyx":227 * cdef int rc * cdef const char *_username = to_bytes(username) * cdef const char *_password = to_bytes(password) # <<<<<<<<<<<<<< @@ -3715,7 +3696,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_28userauth_password(struct __p */ __pyx_v__password = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_password); - /* "ssh2/session.pyx":224 + /* "ssh2/session.pyx":228 * cdef const char *_username = to_bytes(username) * cdef const char *_password = to_bytes(password) * with nogil: # <<<<<<<<<<<<<< @@ -3730,7 +3711,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_28userauth_password(struct __p #endif /*try:*/ { - /* "ssh2/session.pyx":225 + /* "ssh2/session.pyx":229 * cdef const char *_password = to_bytes(password) * with nogil: * rc = c_ssh2.libssh2_userauth_password( # <<<<<<<<<<<<<< @@ -3740,7 +3721,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_28userauth_password(struct __p __pyx_v_rc = libssh2_userauth_password(__pyx_v_self->_session, __pyx_v__username, __pyx_v__password); } - /* "ssh2/session.pyx":224 + /* "ssh2/session.pyx":228 * cdef const char *_username = to_bytes(username) * cdef const char *_password = to_bytes(password) * with nogil: # <<<<<<<<<<<<<< @@ -3759,7 +3740,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_28userauth_password(struct __p } } - /* "ssh2/session.pyx":227 + /* "ssh2/session.pyx":231 * rc = c_ssh2.libssh2_userauth_password( * self._session, _username, _password) * return rc # <<<<<<<<<<<<<< @@ -3767,14 +3748,14 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_28userauth_password(struct __p * def agent_init(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 227, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":214 - * # return rc + /* "ssh2/session.pyx":218 + * return rc * * def userauth_password(self, username not None, password not None): # <<<<<<<<<<<<<< * """Perform password authentication @@ -3792,7 +3773,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_28userauth_password(struct __p return __pyx_r; } -/* "ssh2/session.pyx":229 +/* "ssh2/session.pyx":233 * return rc * * def agent_init(self): # <<<<<<<<<<<<<< @@ -3822,7 +3803,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_30agent_init(struct __pyx_obj_ PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("agent_init", 0); - /* "ssh2/session.pyx":234 + /* "ssh2/session.pyx":238 * :rtype: :py:class:`ssh2.agent.Agent` * """ * cdef c_ssh2.LIBSSH2_AGENT *agent = self._agent_init() # <<<<<<<<<<<<<< @@ -3831,7 +3812,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_30agent_init(struct __pyx_obj_ */ __pyx_v_agent = ((struct __pyx_vtabstruct_4ssh2_7session_Session *)__pyx_v_self->__pyx_vtab)->_agent_init(__pyx_v_self); - /* "ssh2/session.pyx":235 + /* "ssh2/session.pyx":239 * """ * cdef c_ssh2.LIBSSH2_AGENT *agent = self._agent_init() * if agent is NULL: # <<<<<<<<<<<<<< @@ -3841,7 +3822,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_30agent_init(struct __pyx_obj_ __pyx_t_1 = ((__pyx_v_agent == NULL) != 0); if (__pyx_t_1) { - /* "ssh2/session.pyx":236 + /* "ssh2/session.pyx":240 * cdef c_ssh2.LIBSSH2_AGENT *agent = self._agent_init() * if agent is NULL: * return # <<<<<<<<<<<<<< @@ -3852,7 +3833,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_30agent_init(struct __pyx_obj_ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "ssh2/session.pyx":235 + /* "ssh2/session.pyx":239 * """ * cdef c_ssh2.LIBSSH2_AGENT *agent = self._agent_init() * if agent is NULL: # <<<<<<<<<<<<<< @@ -3861,7 +3842,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_30agent_init(struct __pyx_obj_ */ } - /* "ssh2/session.pyx":237 + /* "ssh2/session.pyx":241 * if agent is NULL: * return * return PyAgent(agent, self) # <<<<<<<<<<<<<< @@ -3869,13 +3850,13 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_30agent_init(struct __pyx_obj_ * cdef c_ssh2.LIBSSH2_AGENT * _agent_init(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __pyx_f_4ssh2_5agent_PyAgent(__pyx_v_agent, __pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 237, __pyx_L1_error) + __pyx_t_2 = __pyx_f_4ssh2_5agent_PyAgent(__pyx_v_agent, __pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":229 + /* "ssh2/session.pyx":233 * return rc * * def agent_init(self): # <<<<<<<<<<<<<< @@ -3894,7 +3875,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_30agent_init(struct __pyx_obj_ return __pyx_r; } -/* "ssh2/session.pyx":239 +/* "ssh2/session.pyx":243 * return PyAgent(agent, self) * * cdef c_ssh2.LIBSSH2_AGENT * _agent_init(self): # <<<<<<<<<<<<<< @@ -3909,7 +3890,7 @@ static LIBSSH2_AGENT *__pyx_f_4ssh2_7session_7Session__agent_init(struct __pyx_o int __pyx_t_1; __Pyx_RefNannySetupContext("_agent_init", 0); - /* "ssh2/session.pyx":241 + /* "ssh2/session.pyx":245 * cdef c_ssh2.LIBSSH2_AGENT * _agent_init(self): * cdef c_ssh2.LIBSSH2_AGENT *agent * with nogil: # <<<<<<<<<<<<<< @@ -3924,7 +3905,7 @@ static LIBSSH2_AGENT *__pyx_f_4ssh2_7session_7Session__agent_init(struct __pyx_o #endif /*try:*/ { - /* "ssh2/session.pyx":242 + /* "ssh2/session.pyx":246 * cdef c_ssh2.LIBSSH2_AGENT *agent * with nogil: * agent = c_ssh2.libssh2_agent_init(self._session) # <<<<<<<<<<<<<< @@ -3933,7 +3914,7 @@ static LIBSSH2_AGENT *__pyx_f_4ssh2_7session_7Session__agent_init(struct __pyx_o */ __pyx_v_agent = libssh2_agent_init(__pyx_v_self->_session); - /* "ssh2/session.pyx":243 + /* "ssh2/session.pyx":247 * with nogil: * agent = c_ssh2.libssh2_agent_init(self._session) * if agent is NULL: # <<<<<<<<<<<<<< @@ -3943,7 +3924,7 @@ static LIBSSH2_AGENT *__pyx_f_4ssh2_7session_7Session__agent_init(struct __pyx_o __pyx_t_1 = ((__pyx_v_agent == NULL) != 0); if (__pyx_t_1) { - /* "ssh2/session.pyx":244 + /* "ssh2/session.pyx":248 * agent = c_ssh2.libssh2_agent_init(self._session) * if agent is NULL: * with gil: # <<<<<<<<<<<<<< @@ -3956,17 +3937,17 @@ static LIBSSH2_AGENT *__pyx_f_4ssh2_7session_7Session__agent_init(struct __pyx_o #endif /*try:*/ { - /* "ssh2/session.pyx":245 + /* "ssh2/session.pyx":249 * if agent is NULL: * with gil: * raise MemoryError # <<<<<<<<<<<<<< * return agent * */ - PyErr_NoMemory(); __PYX_ERR(0, 245, __pyx_L8_error) + PyErr_NoMemory(); __PYX_ERR(0, 249, __pyx_L8_error) } - /* "ssh2/session.pyx":244 + /* "ssh2/session.pyx":248 * agent = c_ssh2.libssh2_agent_init(self._session) * if agent is NULL: * with gil: # <<<<<<<<<<<<<< @@ -3983,7 +3964,7 @@ static LIBSSH2_AGENT *__pyx_f_4ssh2_7session_7Session__agent_init(struct __pyx_o } } - /* "ssh2/session.pyx":243 + /* "ssh2/session.pyx":247 * with nogil: * agent = c_ssh2.libssh2_agent_init(self._session) * if agent is NULL: # <<<<<<<<<<<<<< @@ -3992,7 +3973,7 @@ static LIBSSH2_AGENT *__pyx_f_4ssh2_7session_7Session__agent_init(struct __pyx_o */ } - /* "ssh2/session.pyx":246 + /* "ssh2/session.pyx":250 * with gil: * raise MemoryError * return agent # <<<<<<<<<<<<<< @@ -4003,7 +3984,7 @@ static LIBSSH2_AGENT *__pyx_f_4ssh2_7session_7Session__agent_init(struct __pyx_o goto __pyx_L3_return; } - /* "ssh2/session.pyx":241 + /* "ssh2/session.pyx":245 * cdef c_ssh2.LIBSSH2_AGENT * _agent_init(self): * cdef c_ssh2.LIBSSH2_AGENT *agent * with nogil: # <<<<<<<<<<<<<< @@ -4028,7 +4009,7 @@ static LIBSSH2_AGENT *__pyx_f_4ssh2_7session_7Session__agent_init(struct __pyx_o } } - /* "ssh2/session.pyx":239 + /* "ssh2/session.pyx":243 * return PyAgent(agent, self) * * cdef c_ssh2.LIBSSH2_AGENT * _agent_init(self): # <<<<<<<<<<<<<< @@ -4045,7 +4026,7 @@ static LIBSSH2_AGENT *__pyx_f_4ssh2_7session_7Session__agent_init(struct __pyx_o return __pyx_r; } -/* "ssh2/session.pyx":248 +/* "ssh2/session.pyx":252 * return agent * * cdef c_ssh2.LIBSSH2_AGENT * init_connect_agent(self) nogil except NULL: # <<<<<<<<<<<<<< @@ -4067,7 +4048,7 @@ static LIBSSH2_AGENT *__pyx_f_4ssh2_7session_7Session_init_connect_agent(struct __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif - /* "ssh2/session.pyx":249 + /* "ssh2/session.pyx":253 * * cdef c_ssh2.LIBSSH2_AGENT * init_connect_agent(self) nogil except NULL: * agent = c_ssh2.libssh2_agent_init(self._session) # <<<<<<<<<<<<<< @@ -4077,7 +4058,7 @@ static LIBSSH2_AGENT *__pyx_f_4ssh2_7session_7Session_init_connect_agent(struct /*try:*/ { __pyx_v_agent = libssh2_agent_init(__pyx_v_self->_session); - /* "ssh2/session.pyx":250 + /* "ssh2/session.pyx":254 * cdef c_ssh2.LIBSSH2_AGENT * init_connect_agent(self) nogil except NULL: * agent = c_ssh2.libssh2_agent_init(self._session) * if agent is NULL: # <<<<<<<<<<<<<< @@ -4087,7 +4068,7 @@ static LIBSSH2_AGENT *__pyx_f_4ssh2_7session_7Session_init_connect_agent(struct __pyx_t_1 = ((__pyx_v_agent == NULL) != 0); if (__pyx_t_1) { - /* "ssh2/session.pyx":251 + /* "ssh2/session.pyx":255 * agent = c_ssh2.libssh2_agent_init(self._session) * if agent is NULL: * with gil: # <<<<<<<<<<<<<< @@ -4100,17 +4081,17 @@ static LIBSSH2_AGENT *__pyx_f_4ssh2_7session_7Session_init_connect_agent(struct #endif /*try:*/ { - /* "ssh2/session.pyx":252 + /* "ssh2/session.pyx":256 * if agent is NULL: * with gil: * raise MemoryError # <<<<<<<<<<<<<< * if c_ssh2.libssh2_agent_connect(agent) != 0: * c_ssh2.libssh2_agent_free(agent) */ - PyErr_NoMemory(); __PYX_ERR(0, 252, __pyx_L8_error) + PyErr_NoMemory(); __PYX_ERR(0, 256, __pyx_L8_error) } - /* "ssh2/session.pyx":251 + /* "ssh2/session.pyx":255 * agent = c_ssh2.libssh2_agent_init(self._session) * if agent is NULL: * with gil: # <<<<<<<<<<<<<< @@ -4127,7 +4108,7 @@ static LIBSSH2_AGENT *__pyx_f_4ssh2_7session_7Session_init_connect_agent(struct } } - /* "ssh2/session.pyx":250 + /* "ssh2/session.pyx":254 * cdef c_ssh2.LIBSSH2_AGENT * init_connect_agent(self) nogil except NULL: * agent = c_ssh2.libssh2_agent_init(self._session) * if agent is NULL: # <<<<<<<<<<<<<< @@ -4136,7 +4117,7 @@ static LIBSSH2_AGENT *__pyx_f_4ssh2_7session_7Session_init_connect_agent(struct */ } - /* "ssh2/session.pyx":253 + /* "ssh2/session.pyx":257 * with gil: * raise MemoryError * if c_ssh2.libssh2_agent_connect(agent) != 0: # <<<<<<<<<<<<<< @@ -4146,7 +4127,7 @@ static LIBSSH2_AGENT *__pyx_f_4ssh2_7session_7Session_init_connect_agent(struct __pyx_t_1 = ((libssh2_agent_connect(__pyx_v_agent) != 0) != 0); if (__pyx_t_1) { - /* "ssh2/session.pyx":254 + /* "ssh2/session.pyx":258 * raise MemoryError * if c_ssh2.libssh2_agent_connect(agent) != 0: * c_ssh2.libssh2_agent_free(agent) # <<<<<<<<<<<<<< @@ -4155,7 +4136,7 @@ static LIBSSH2_AGENT *__pyx_f_4ssh2_7session_7Session_init_connect_agent(struct */ libssh2_agent_free(__pyx_v_agent); - /* "ssh2/session.pyx":255 + /* "ssh2/session.pyx":259 * if c_ssh2.libssh2_agent_connect(agent) != 0: * c_ssh2.libssh2_agent_free(agent) * with gil: # <<<<<<<<<<<<<< @@ -4168,21 +4149,21 @@ static LIBSSH2_AGENT *__pyx_f_4ssh2_7session_7Session_init_connect_agent(struct #endif /*try:*/ { - /* "ssh2/session.pyx":256 + /* "ssh2/session.pyx":260 * c_ssh2.libssh2_agent_free(agent) * with gil: * raise AgentConnectionError("Unable to connect to agent") # <<<<<<<<<<<<<< * return agent * */ - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4ssh2_10exceptions_AgentConnectionError), __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 256, __pyx_L12_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4ssh2_10exceptions_AgentConnectionError), __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 260, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 256, __pyx_L12_error) + __PYX_ERR(0, 260, __pyx_L12_error) } - /* "ssh2/session.pyx":255 + /* "ssh2/session.pyx":259 * if c_ssh2.libssh2_agent_connect(agent) != 0: * c_ssh2.libssh2_agent_free(agent) * with gil: # <<<<<<<<<<<<<< @@ -4199,7 +4180,7 @@ static LIBSSH2_AGENT *__pyx_f_4ssh2_7session_7Session_init_connect_agent(struct } } - /* "ssh2/session.pyx":253 + /* "ssh2/session.pyx":257 * with gil: * raise MemoryError * if c_ssh2.libssh2_agent_connect(agent) != 0: # <<<<<<<<<<<<<< @@ -4208,7 +4189,7 @@ static LIBSSH2_AGENT *__pyx_f_4ssh2_7session_7Session_init_connect_agent(struct */ } - /* "ssh2/session.pyx":257 + /* "ssh2/session.pyx":261 * with gil: * raise AgentConnectionError("Unable to connect to agent") * return agent # <<<<<<<<<<<<<< @@ -4219,7 +4200,7 @@ static LIBSSH2_AGENT *__pyx_f_4ssh2_7session_7Session_init_connect_agent(struct goto __pyx_L3_return; } - /* "ssh2/session.pyx":249 + /* "ssh2/session.pyx":253 * * cdef c_ssh2.LIBSSH2_AGENT * init_connect_agent(self) nogil except NULL: * agent = c_ssh2.libssh2_agent_init(self._session) # <<<<<<<<<<<<<< @@ -4241,7 +4222,7 @@ static LIBSSH2_AGENT *__pyx_f_4ssh2_7session_7Session_init_connect_agent(struct } } - /* "ssh2/session.pyx":248 + /* "ssh2/session.pyx":252 * return agent * * cdef c_ssh2.LIBSSH2_AGENT * init_connect_agent(self) nogil except NULL: # <<<<<<<<<<<<<< @@ -4263,7 +4244,7 @@ static LIBSSH2_AGENT *__pyx_f_4ssh2_7session_7Session_init_connect_agent(struct return __pyx_r; } -/* "ssh2/session.pyx":259 +/* "ssh2/session.pyx":263 * return agent * * def agent_auth(self, username not None): # <<<<<<<<<<<<<< @@ -4279,7 +4260,7 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_33agent_auth(PyObject *__pyx_v __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("agent_auth (wrapper)", 0); if (unlikely(((PyObject *)__pyx_v_username) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "username"); __PYX_ERR(0, 259, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "username"); __PYX_ERR(0, 263, __pyx_L1_error) } __pyx_r = __pyx_pf_4ssh2_7session_7Session_32agent_auth(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), ((PyObject *)__pyx_v_username)); @@ -4305,7 +4286,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_32agent_auth(struct __pyx_obj_ int __pyx_t_4; __Pyx_RefNannySetupContext("agent_auth", 0); - /* "ssh2/session.pyx":287 + /* "ssh2/session.pyx":291 * :rtype: None * """ * cdef char *_username = to_bytes(username) # <<<<<<<<<<<<<< @@ -4314,7 +4295,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_32agent_auth(struct __pyx_obj_ */ __pyx_v__username = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_username); - /* "ssh2/session.pyx":288 + /* "ssh2/session.pyx":292 * """ * cdef char *_username = to_bytes(username) * cdef c_ssh2.LIBSSH2_AGENT *agent = NULL # <<<<<<<<<<<<<< @@ -4323,7 +4304,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_32agent_auth(struct __pyx_obj_ */ __pyx_v_agent = NULL; - /* "ssh2/session.pyx":289 + /* "ssh2/session.pyx":293 * cdef char *_username = to_bytes(username) * cdef c_ssh2.LIBSSH2_AGENT *agent = NULL * cdef c_ssh2.libssh2_agent_publickey *identity = NULL # <<<<<<<<<<<<<< @@ -4332,7 +4313,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_32agent_auth(struct __pyx_obj_ */ __pyx_v_identity = NULL; - /* "ssh2/session.pyx":290 + /* "ssh2/session.pyx":294 * cdef c_ssh2.LIBSSH2_AGENT *agent = NULL * cdef c_ssh2.libssh2_agent_publickey *identity = NULL * cdef c_ssh2.libssh2_agent_publickey *prev = NULL # <<<<<<<<<<<<<< @@ -4341,7 +4322,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_32agent_auth(struct __pyx_obj_ */ __pyx_v_prev = NULL; - /* "ssh2/session.pyx":291 + /* "ssh2/session.pyx":295 * cdef c_ssh2.libssh2_agent_publickey *identity = NULL * cdef c_ssh2.libssh2_agent_publickey *prev = NULL * with nogil: # <<<<<<<<<<<<<< @@ -4356,17 +4337,17 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_32agent_auth(struct __pyx_obj_ #endif /*try:*/ { - /* "ssh2/session.pyx":292 + /* "ssh2/session.pyx":296 * cdef c_ssh2.libssh2_agent_publickey *prev = NULL * with nogil: * agent = self.init_connect_agent() # <<<<<<<<<<<<<< * if c_ssh2.libssh2_agent_list_identities(agent) != 0: * clear_agent(agent) */ - __pyx_t_1 = ((struct __pyx_vtabstruct_4ssh2_7session_Session *)__pyx_v_self->__pyx_vtab)->init_connect_agent(__pyx_v_self); if (unlikely(__pyx_t_1 == NULL)) __PYX_ERR(0, 292, __pyx_L4_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_4ssh2_7session_Session *)__pyx_v_self->__pyx_vtab)->init_connect_agent(__pyx_v_self); if (unlikely(__pyx_t_1 == NULL)) __PYX_ERR(0, 296, __pyx_L4_error) __pyx_v_agent = __pyx_t_1; - /* "ssh2/session.pyx":293 + /* "ssh2/session.pyx":297 * with nogil: * agent = self.init_connect_agent() * if c_ssh2.libssh2_agent_list_identities(agent) != 0: # <<<<<<<<<<<<<< @@ -4376,7 +4357,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_32agent_auth(struct __pyx_obj_ __pyx_t_2 = ((libssh2_agent_list_identities(__pyx_v_agent) != 0) != 0); if (__pyx_t_2) { - /* "ssh2/session.pyx":294 + /* "ssh2/session.pyx":298 * agent = self.init_connect_agent() * if c_ssh2.libssh2_agent_list_identities(agent) != 0: * clear_agent(agent) # <<<<<<<<<<<<<< @@ -4385,7 +4366,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_32agent_auth(struct __pyx_obj_ */ __pyx_f_4ssh2_5agent_clear_agent(__pyx_v_agent); - /* "ssh2/session.pyx":295 + /* "ssh2/session.pyx":299 * if c_ssh2.libssh2_agent_list_identities(agent) != 0: * clear_agent(agent) * with gil: # <<<<<<<<<<<<<< @@ -4398,21 +4379,21 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_32agent_auth(struct __pyx_obj_ #endif /*try:*/ { - /* "ssh2/session.pyx":296 + /* "ssh2/session.pyx":300 * clear_agent(agent) * with gil: * raise AgentListIdentitiesError( # <<<<<<<<<<<<<< * "Failure requesting identities from agent") * while 1: */ - __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4ssh2_10exceptions_AgentListIdentitiesError), __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 296, __pyx_L8_error) + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4ssh2_10exceptions_AgentListIdentitiesError), __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 300, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 296, __pyx_L8_error) + __PYX_ERR(0, 300, __pyx_L8_error) } - /* "ssh2/session.pyx":295 + /* "ssh2/session.pyx":299 * if c_ssh2.libssh2_agent_list_identities(agent) != 0: * clear_agent(agent) * with gil: # <<<<<<<<<<<<<< @@ -4429,7 +4410,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_32agent_auth(struct __pyx_obj_ } } - /* "ssh2/session.pyx":293 + /* "ssh2/session.pyx":297 * with nogil: * agent = self.init_connect_agent() * if c_ssh2.libssh2_agent_list_identities(agent) != 0: # <<<<<<<<<<<<<< @@ -4438,7 +4419,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_32agent_auth(struct __pyx_obj_ */ } - /* "ssh2/session.pyx":298 + /* "ssh2/session.pyx":302 * raise AgentListIdentitiesError( * "Failure requesting identities from agent") * while 1: # <<<<<<<<<<<<<< @@ -4447,16 +4428,16 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_32agent_auth(struct __pyx_obj_ */ while (1) { - /* "ssh2/session.pyx":299 + /* "ssh2/session.pyx":303 * "Failure requesting identities from agent") * while 1: * auth_identity(_username, agent, &identity, prev) # <<<<<<<<<<<<<< * if c_ssh2.libssh2_agent_userauth( * agent, _username, identity) == 0: */ - __pyx_t_4 = __pyx_f_4ssh2_5agent_auth_identity(__pyx_v__username, __pyx_v_agent, (&__pyx_v_identity), __pyx_v_prev); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 299, __pyx_L4_error) + __pyx_t_4 = __pyx_f_4ssh2_5agent_auth_identity(__pyx_v__username, __pyx_v_agent, (&__pyx_v_identity), __pyx_v_prev); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 303, __pyx_L4_error) - /* "ssh2/session.pyx":301 + /* "ssh2/session.pyx":305 * auth_identity(_username, agent, &identity, prev) * if c_ssh2.libssh2_agent_userauth( * agent, _username, identity) == 0: # <<<<<<<<<<<<<< @@ -4465,7 +4446,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_32agent_auth(struct __pyx_obj_ */ __pyx_t_2 = ((libssh2_agent_userauth(__pyx_v_agent, __pyx_v__username, __pyx_v_identity) == 0) != 0); - /* "ssh2/session.pyx":300 + /* "ssh2/session.pyx":304 * while 1: * auth_identity(_username, agent, &identity, prev) * if c_ssh2.libssh2_agent_userauth( # <<<<<<<<<<<<<< @@ -4474,7 +4455,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_32agent_auth(struct __pyx_obj_ */ if (__pyx_t_2) { - /* "ssh2/session.pyx":302 + /* "ssh2/session.pyx":306 * if c_ssh2.libssh2_agent_userauth( * agent, _username, identity) == 0: * break # <<<<<<<<<<<<<< @@ -4483,7 +4464,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_32agent_auth(struct __pyx_obj_ */ goto __pyx_L11_break; - /* "ssh2/session.pyx":300 + /* "ssh2/session.pyx":304 * while 1: * auth_identity(_username, agent, &identity, prev) * if c_ssh2.libssh2_agent_userauth( # <<<<<<<<<<<<<< @@ -4492,7 +4473,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_32agent_auth(struct __pyx_obj_ */ } - /* "ssh2/session.pyx":303 + /* "ssh2/session.pyx":307 * agent, _username, identity) == 0: * break * prev = identity # <<<<<<<<<<<<<< @@ -4503,7 +4484,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_32agent_auth(struct __pyx_obj_ } __pyx_L11_break:; - /* "ssh2/session.pyx":304 + /* "ssh2/session.pyx":308 * break * prev = identity * clear_agent(agent) # <<<<<<<<<<<<<< @@ -4513,7 +4494,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_32agent_auth(struct __pyx_obj_ __pyx_f_4ssh2_5agent_clear_agent(__pyx_v_agent); } - /* "ssh2/session.pyx":291 + /* "ssh2/session.pyx":295 * cdef c_ssh2.libssh2_agent_publickey *identity = NULL * cdef c_ssh2.libssh2_agent_publickey *prev = NULL * with nogil: # <<<<<<<<<<<<<< @@ -4539,7 +4520,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_32agent_auth(struct __pyx_obj_ } } - /* "ssh2/session.pyx":259 + /* "ssh2/session.pyx":263 * return agent * * def agent_auth(self, username not None): # <<<<<<<<<<<<<< @@ -4560,7 +4541,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_32agent_auth(struct __pyx_obj_ return __pyx_r; } -/* "ssh2/session.pyx":306 +/* "ssh2/session.pyx":310 * clear_agent(agent) * * def open_session(self): # <<<<<<<<<<<<<< @@ -4590,7 +4571,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_34open_session(struct __pyx_ob PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("open_session", 0); - /* "ssh2/session.pyx":312 + /* "ssh2/session.pyx":316 * """ * cdef c_ssh2.LIBSSH2_CHANNEL *channel * with nogil: # <<<<<<<<<<<<<< @@ -4605,7 +4586,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_34open_session(struct __pyx_ob #endif /*try:*/ { - /* "ssh2/session.pyx":313 + /* "ssh2/session.pyx":317 * cdef c_ssh2.LIBSSH2_CHANNEL *channel * with nogil: * channel = c_ssh2.libssh2_channel_open_session( # <<<<<<<<<<<<<< @@ -4614,7 +4595,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_34open_session(struct __pyx_ob */ __pyx_v_channel = libssh2_channel_open_session(__pyx_v_self->_session); - /* "ssh2/session.pyx":315 + /* "ssh2/session.pyx":319 * channel = c_ssh2.libssh2_channel_open_session( * self._session) * if channel is NULL: # <<<<<<<<<<<<<< @@ -4624,7 +4605,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_34open_session(struct __pyx_ob __pyx_t_1 = ((__pyx_v_channel == NULL) != 0); if (__pyx_t_1) { - /* "ssh2/session.pyx":316 + /* "ssh2/session.pyx":320 * self._session) * if channel is NULL: * with gil: # <<<<<<<<<<<<<< @@ -4637,7 +4618,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_34open_session(struct __pyx_ob #endif /*try:*/ { - /* "ssh2/session.pyx":317 + /* "ssh2/session.pyx":321 * if channel is NULL: * with gil: * return None # <<<<<<<<<<<<<< @@ -4650,7 +4631,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_34open_session(struct __pyx_ob goto __pyx_L7_return; } - /* "ssh2/session.pyx":316 + /* "ssh2/session.pyx":320 * self._session) * if channel is NULL: * with gil: # <<<<<<<<<<<<<< @@ -4667,7 +4648,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_34open_session(struct __pyx_ob } } - /* "ssh2/session.pyx":315 + /* "ssh2/session.pyx":319 * channel = c_ssh2.libssh2_channel_open_session( * self._session) * if channel is NULL: # <<<<<<<<<<<<<< @@ -4677,7 +4658,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_34open_session(struct __pyx_ob } } - /* "ssh2/session.pyx":312 + /* "ssh2/session.pyx":316 * """ * cdef c_ssh2.LIBSSH2_CHANNEL *channel * with nogil: # <<<<<<<<<<<<<< @@ -4703,7 +4684,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_34open_session(struct __pyx_ob } } - /* "ssh2/session.pyx":318 + /* "ssh2/session.pyx":322 * with gil: * return None * return PyChannel(channel, self) # <<<<<<<<<<<<<< @@ -4711,13 +4692,13 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_34open_session(struct __pyx_ob * def direct_tcpip_ex(self, host not None, int port, */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __pyx_f_4ssh2_7channel_PyChannel(__pyx_v_channel, __pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 318, __pyx_L1_error) + __pyx_t_2 = __pyx_f_4ssh2_7channel_PyChannel(__pyx_v_channel, __pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":306 + /* "ssh2/session.pyx":310 * clear_agent(agent) * * def open_session(self): # <<<<<<<<<<<<<< @@ -4736,7 +4717,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_34open_session(struct __pyx_ob return __pyx_r; } -/* "ssh2/session.pyx":320 +/* "ssh2/session.pyx":324 * return PyChannel(channel, self) * * def direct_tcpip_ex(self, host not None, int port, # <<<<<<<<<<<<<< @@ -4782,23 +4763,23 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_37direct_tcpip_ex(PyObject *__ case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_port)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("direct_tcpip_ex", 1, 4, 4, 1); __PYX_ERR(0, 320, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("direct_tcpip_ex", 1, 4, 4, 1); __PYX_ERR(0, 324, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_shost)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("direct_tcpip_ex", 1, 4, 4, 2); __PYX_ERR(0, 320, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("direct_tcpip_ex", 1, 4, 4, 2); __PYX_ERR(0, 324, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_sport)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("direct_tcpip_ex", 1, 4, 4, 3); __PYX_ERR(0, 320, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("direct_tcpip_ex", 1, 4, 4, 3); __PYX_ERR(0, 324, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "direct_tcpip_ex") < 0)) __PYX_ERR(0, 320, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "direct_tcpip_ex") < 0)) __PYX_ERR(0, 324, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; @@ -4809,23 +4790,23 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_37direct_tcpip_ex(PyObject *__ values[3] = PyTuple_GET_ITEM(__pyx_args, 3); } __pyx_v_host = values[0]; - __pyx_v_port = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_port == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 320, __pyx_L3_error) + __pyx_v_port = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_port == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 324, __pyx_L3_error) __pyx_v_shost = values[2]; - __pyx_v_sport = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_sport == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 321, __pyx_L3_error) + __pyx_v_sport = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_sport == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 325, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("direct_tcpip_ex", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 320, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("direct_tcpip_ex", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 324, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.session.Session.direct_tcpip_ex", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(((PyObject *)__pyx_v_host) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "host"); __PYX_ERR(0, 320, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "host"); __PYX_ERR(0, 324, __pyx_L1_error) } if (unlikely(((PyObject *)__pyx_v_shost) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "shost"); __PYX_ERR(0, 321, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "shost"); __PYX_ERR(0, 325, __pyx_L1_error) } __pyx_r = __pyx_pf_4ssh2_7session_7Session_36direct_tcpip_ex(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), __pyx_v_host, __pyx_v_port, __pyx_v_shost, __pyx_v_sport); @@ -4848,7 +4829,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_36direct_tcpip_ex(struct __pyx PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("direct_tcpip_ex", 0); - /* "ssh2/session.pyx":323 + /* "ssh2/session.pyx":327 * shost not None, int sport): * cdef c_ssh2.LIBSSH2_CHANNEL *channel * cdef char *_host = to_bytes(host) # <<<<<<<<<<<<<< @@ -4857,7 +4838,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_36direct_tcpip_ex(struct __pyx */ __pyx_v__host = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_host); - /* "ssh2/session.pyx":324 + /* "ssh2/session.pyx":328 * cdef c_ssh2.LIBSSH2_CHANNEL *channel * cdef char *_host = to_bytes(host) * cdef char *_shost = to_bytes(shost) # <<<<<<<<<<<<<< @@ -4866,7 +4847,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_36direct_tcpip_ex(struct __pyx */ __pyx_v__shost = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_shost); - /* "ssh2/session.pyx":325 + /* "ssh2/session.pyx":329 * cdef char *_host = to_bytes(host) * cdef char *_shost = to_bytes(shost) * with nogil: # <<<<<<<<<<<<<< @@ -4881,7 +4862,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_36direct_tcpip_ex(struct __pyx #endif /*try:*/ { - /* "ssh2/session.pyx":326 + /* "ssh2/session.pyx":330 * cdef char *_shost = to_bytes(shost) * with nogil: * channel = c_ssh2.libssh2_channel_direct_tcpip_ex( # <<<<<<<<<<<<<< @@ -4890,7 +4871,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_36direct_tcpip_ex(struct __pyx */ __pyx_v_channel = libssh2_channel_direct_tcpip_ex(__pyx_v_self->_session, __pyx_v__host, __pyx_v_port, __pyx_v__shost, __pyx_v_sport); - /* "ssh2/session.pyx":328 + /* "ssh2/session.pyx":332 * channel = c_ssh2.libssh2_channel_direct_tcpip_ex( * self._session, _host, port, _shost, sport) * if channel is NULL: # <<<<<<<<<<<<<< @@ -4900,7 +4881,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_36direct_tcpip_ex(struct __pyx __pyx_t_1 = ((__pyx_v_channel == NULL) != 0); if (__pyx_t_1) { - /* "ssh2/session.pyx":329 + /* "ssh2/session.pyx":333 * self._session, _host, port, _shost, sport) * if channel is NULL: * with gil: # <<<<<<<<<<<<<< @@ -4913,7 +4894,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_36direct_tcpip_ex(struct __pyx #endif /*try:*/ { - /* "ssh2/session.pyx":330 + /* "ssh2/session.pyx":334 * if channel is NULL: * with gil: * return # <<<<<<<<<<<<<< @@ -4925,7 +4906,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_36direct_tcpip_ex(struct __pyx goto __pyx_L7_return; } - /* "ssh2/session.pyx":329 + /* "ssh2/session.pyx":333 * self._session, _host, port, _shost, sport) * if channel is NULL: * with gil: # <<<<<<<<<<<<<< @@ -4942,7 +4923,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_36direct_tcpip_ex(struct __pyx } } - /* "ssh2/session.pyx":328 + /* "ssh2/session.pyx":332 * channel = c_ssh2.libssh2_channel_direct_tcpip_ex( * self._session, _host, port, _shost, sport) * if channel is NULL: # <<<<<<<<<<<<<< @@ -4952,7 +4933,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_36direct_tcpip_ex(struct __pyx } } - /* "ssh2/session.pyx":325 + /* "ssh2/session.pyx":329 * cdef char *_host = to_bytes(host) * cdef char *_shost = to_bytes(shost) * with nogil: # <<<<<<<<<<<<<< @@ -4978,7 +4959,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_36direct_tcpip_ex(struct __pyx } } - /* "ssh2/session.pyx":331 + /* "ssh2/session.pyx":335 * with gil: * return * return PyChannel(channel, self) # <<<<<<<<<<<<<< @@ -4986,13 +4967,13 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_36direct_tcpip_ex(struct __pyx * def direct_tcpip(self, host not None, int port): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __pyx_f_4ssh2_7channel_PyChannel(__pyx_v_channel, __pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 331, __pyx_L1_error) + __pyx_t_2 = __pyx_f_4ssh2_7channel_PyChannel(__pyx_v_channel, __pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":320 + /* "ssh2/session.pyx":324 * return PyChannel(channel, self) * * def direct_tcpip_ex(self, host not None, int port, # <<<<<<<<<<<<<< @@ -5011,7 +4992,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_36direct_tcpip_ex(struct __pyx return __pyx_r; } -/* "ssh2/session.pyx":333 +/* "ssh2/session.pyx":337 * return PyChannel(channel, self) * * def direct_tcpip(self, host not None, int port): # <<<<<<<<<<<<<< @@ -5051,11 +5032,11 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_39direct_tcpip(PyObject *__pyx case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_port)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("direct_tcpip", 1, 2, 2, 1); __PYX_ERR(0, 333, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("direct_tcpip", 1, 2, 2, 1); __PYX_ERR(0, 337, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "direct_tcpip") < 0)) __PYX_ERR(0, 333, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "direct_tcpip") < 0)) __PYX_ERR(0, 337, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -5064,18 +5045,18 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_39direct_tcpip(PyObject *__pyx values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_host = values[0]; - __pyx_v_port = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_port == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 333, __pyx_L3_error) + __pyx_v_port = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_port == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 337, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("direct_tcpip", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 333, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("direct_tcpip", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 337, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.session.Session.direct_tcpip", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(((PyObject *)__pyx_v_host) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "host"); __PYX_ERR(0, 333, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "host"); __PYX_ERR(0, 337, __pyx_L1_error) } __pyx_r = __pyx_pf_4ssh2_7session_7Session_38direct_tcpip(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), __pyx_v_host, __pyx_v_port); @@ -5097,7 +5078,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_38direct_tcpip(struct __pyx_ob PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("direct_tcpip", 0); - /* "ssh2/session.pyx":335 + /* "ssh2/session.pyx":339 * def direct_tcpip(self, host not None, int port): * cdef c_ssh2.LIBSSH2_CHANNEL *channel * cdef char *_host = to_bytes(host) # <<<<<<<<<<<<<< @@ -5106,7 +5087,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_38direct_tcpip(struct __pyx_ob */ __pyx_v__host = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_host); - /* "ssh2/session.pyx":336 + /* "ssh2/session.pyx":340 * cdef c_ssh2.LIBSSH2_CHANNEL *channel * cdef char *_host = to_bytes(host) * with nogil: # <<<<<<<<<<<<<< @@ -5121,7 +5102,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_38direct_tcpip(struct __pyx_ob #endif /*try:*/ { - /* "ssh2/session.pyx":337 + /* "ssh2/session.pyx":341 * cdef char *_host = to_bytes(host) * with nogil: * channel = c_ssh2.libssh2_channel_direct_tcpip( # <<<<<<<<<<<<<< @@ -5130,7 +5111,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_38direct_tcpip(struct __pyx_ob */ __pyx_v_channel = libssh2_channel_direct_tcpip(__pyx_v_self->_session, __pyx_v__host, __pyx_v_port); - /* "ssh2/session.pyx":339 + /* "ssh2/session.pyx":343 * channel = c_ssh2.libssh2_channel_direct_tcpip( * self._session, _host, port) * if channel is NULL: # <<<<<<<<<<<<<< @@ -5140,7 +5121,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_38direct_tcpip(struct __pyx_ob __pyx_t_1 = ((__pyx_v_channel == NULL) != 0); if (__pyx_t_1) { - /* "ssh2/session.pyx":340 + /* "ssh2/session.pyx":344 * self._session, _host, port) * if channel is NULL: * with gil: # <<<<<<<<<<<<<< @@ -5153,7 +5134,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_38direct_tcpip(struct __pyx_ob #endif /*try:*/ { - /* "ssh2/session.pyx":341 + /* "ssh2/session.pyx":345 * if channel is NULL: * with gil: * return # <<<<<<<<<<<<<< @@ -5165,7 +5146,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_38direct_tcpip(struct __pyx_ob goto __pyx_L7_return; } - /* "ssh2/session.pyx":340 + /* "ssh2/session.pyx":344 * self._session, _host, port) * if channel is NULL: * with gil: # <<<<<<<<<<<<<< @@ -5182,7 +5163,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_38direct_tcpip(struct __pyx_ob } } - /* "ssh2/session.pyx":339 + /* "ssh2/session.pyx":343 * channel = c_ssh2.libssh2_channel_direct_tcpip( * self._session, _host, port) * if channel is NULL: # <<<<<<<<<<<<<< @@ -5192,7 +5173,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_38direct_tcpip(struct __pyx_ob } } - /* "ssh2/session.pyx":336 + /* "ssh2/session.pyx":340 * cdef c_ssh2.LIBSSH2_CHANNEL *channel * cdef char *_host = to_bytes(host) * with nogil: # <<<<<<<<<<<<<< @@ -5218,7 +5199,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_38direct_tcpip(struct __pyx_ob } } - /* "ssh2/session.pyx":342 + /* "ssh2/session.pyx":346 * with gil: * return * return PyChannel(channel, self) # <<<<<<<<<<<<<< @@ -5226,13 +5207,13 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_38direct_tcpip(struct __pyx_ob * def blockdirections(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __pyx_f_4ssh2_7channel_PyChannel(__pyx_v_channel, __pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 342, __pyx_L1_error) + __pyx_t_2 = __pyx_f_4ssh2_7channel_PyChannel(__pyx_v_channel, __pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 346, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":333 + /* "ssh2/session.pyx":337 * return PyChannel(channel, self) * * def direct_tcpip(self, host not None, int port): # <<<<<<<<<<<<<< @@ -5251,7 +5232,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_38direct_tcpip(struct __pyx_ob return __pyx_r; } -/* "ssh2/session.pyx":344 +/* "ssh2/session.pyx":348 * return PyChannel(channel, self) * * def blockdirections(self): # <<<<<<<<<<<<<< @@ -5280,7 +5261,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_40blockdirections(struct __pyx PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("blockdirections", 0); - /* "ssh2/session.pyx":346 + /* "ssh2/session.pyx":350 * def blockdirections(self): * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -5295,7 +5276,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_40blockdirections(struct __pyx #endif /*try:*/ { - /* "ssh2/session.pyx":347 + /* "ssh2/session.pyx":351 * cdef int rc * with nogil: * rc = c_ssh2.libssh2_session_block_directions( # <<<<<<<<<<<<<< @@ -5305,7 +5286,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_40blockdirections(struct __pyx __pyx_v_rc = libssh2_session_block_directions(__pyx_v_self->_session); } - /* "ssh2/session.pyx":346 + /* "ssh2/session.pyx":350 * def blockdirections(self): * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -5324,7 +5305,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_40blockdirections(struct __pyx } } - /* "ssh2/session.pyx":349 + /* "ssh2/session.pyx":353 * rc = c_ssh2.libssh2_session_block_directions( * self._session) * return rc # <<<<<<<<<<<<<< @@ -5332,13 +5313,13 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_40blockdirections(struct __pyx * def forward_listen(self, int port): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 349, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 353, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":344 + /* "ssh2/session.pyx":348 * return PyChannel(channel, self) * * def blockdirections(self): # <<<<<<<<<<<<<< @@ -5357,7 +5338,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_40blockdirections(struct __pyx return __pyx_r; } -/* "ssh2/session.pyx":351 +/* "ssh2/session.pyx":355 * return rc * * def forward_listen(self, int port): # <<<<<<<<<<<<<< @@ -5374,7 +5355,7 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_43forward_listen(PyObject *__p __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("forward_listen (wrapper)", 0); assert(__pyx_arg_port); { - __pyx_v_port = __Pyx_PyInt_As_int(__pyx_arg_port); if (unlikely((__pyx_v_port == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 351, __pyx_L3_error) + __pyx_v_port = __Pyx_PyInt_As_int(__pyx_arg_port); if (unlikely((__pyx_v_port == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 355, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -5397,7 +5378,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_42forward_listen(struct __pyx_ PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("forward_listen", 0); - /* "ssh2/session.pyx":353 + /* "ssh2/session.pyx":357 * def forward_listen(self, int port): * cdef c_ssh2.LIBSSH2_LISTENER *listener * with nogil: # <<<<<<<<<<<<<< @@ -5412,7 +5393,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_42forward_listen(struct __pyx_ #endif /*try:*/ { - /* "ssh2/session.pyx":354 + /* "ssh2/session.pyx":358 * cdef c_ssh2.LIBSSH2_LISTENER *listener * with nogil: * listener = c_ssh2.libssh2_channel_forward_listen( # <<<<<<<<<<<<<< @@ -5422,7 +5403,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_42forward_listen(struct __pyx_ __pyx_v_listener = libssh2_channel_forward_listen(__pyx_v_self->_session, __pyx_v_port); } - /* "ssh2/session.pyx":353 + /* "ssh2/session.pyx":357 * def forward_listen(self, int port): * cdef c_ssh2.LIBSSH2_LISTENER *listener * with nogil: # <<<<<<<<<<<<<< @@ -5441,7 +5422,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_42forward_listen(struct __pyx_ } } - /* "ssh2/session.pyx":356 + /* "ssh2/session.pyx":360 * listener = c_ssh2.libssh2_channel_forward_listen( * self._session, port) * if listener is NULL: # <<<<<<<<<<<<<< @@ -5451,7 +5432,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_42forward_listen(struct __pyx_ __pyx_t_1 = ((__pyx_v_listener == NULL) != 0); if (__pyx_t_1) { - /* "ssh2/session.pyx":357 + /* "ssh2/session.pyx":361 * self._session, port) * if listener is NULL: * return # <<<<<<<<<<<<<< @@ -5462,7 +5443,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_42forward_listen(struct __pyx_ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "ssh2/session.pyx":356 + /* "ssh2/session.pyx":360 * listener = c_ssh2.libssh2_channel_forward_listen( * self._session, port) * if listener is NULL: # <<<<<<<<<<<<<< @@ -5471,7 +5452,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_42forward_listen(struct __pyx_ */ } - /* "ssh2/session.pyx":358 + /* "ssh2/session.pyx":362 * if listener is NULL: * return * return PyListener(listener, self) # <<<<<<<<<<<<<< @@ -5479,13 +5460,13 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_42forward_listen(struct __pyx_ * def forward_listen_ex(self, host not None, int port, */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __pyx_f_4ssh2_8listener_PyListener(__pyx_v_listener, __pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 358, __pyx_L1_error) + __pyx_t_2 = __pyx_f_4ssh2_8listener_PyListener(__pyx_v_listener, __pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 362, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":351 + /* "ssh2/session.pyx":355 * return rc * * def forward_listen(self, int port): # <<<<<<<<<<<<<< @@ -5504,7 +5485,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_42forward_listen(struct __pyx_ return __pyx_r; } -/* "ssh2/session.pyx":360 +/* "ssh2/session.pyx":364 * return PyListener(listener, self) * * def forward_listen_ex(self, host not None, int port, # <<<<<<<<<<<<<< @@ -5550,23 +5531,23 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_45forward_listen_ex(PyObject * case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_port)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("forward_listen_ex", 1, 4, 4, 1); __PYX_ERR(0, 360, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("forward_listen_ex", 1, 4, 4, 1); __PYX_ERR(0, 364, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bound_port)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("forward_listen_ex", 1, 4, 4, 2); __PYX_ERR(0, 360, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("forward_listen_ex", 1, 4, 4, 2); __PYX_ERR(0, 364, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_queue_maxsize)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("forward_listen_ex", 1, 4, 4, 3); __PYX_ERR(0, 360, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("forward_listen_ex", 1, 4, 4, 3); __PYX_ERR(0, 364, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "forward_listen_ex") < 0)) __PYX_ERR(0, 360, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "forward_listen_ex") < 0)) __PYX_ERR(0, 364, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; @@ -5577,20 +5558,20 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_45forward_listen_ex(PyObject * values[3] = PyTuple_GET_ITEM(__pyx_args, 3); } __pyx_v_host = values[0]; - __pyx_v_port = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_port == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 360, __pyx_L3_error) - __pyx_v_bound_port = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_bound_port == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 361, __pyx_L3_error) - __pyx_v_queue_maxsize = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_queue_maxsize == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 361, __pyx_L3_error) + __pyx_v_port = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_port == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 364, __pyx_L3_error) + __pyx_v_bound_port = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_bound_port == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 365, __pyx_L3_error) + __pyx_v_queue_maxsize = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_queue_maxsize == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 365, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("forward_listen_ex", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 360, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("forward_listen_ex", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 364, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.session.Session.forward_listen_ex", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(((PyObject *)__pyx_v_host) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "host"); __PYX_ERR(0, 360, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "host"); __PYX_ERR(0, 364, __pyx_L1_error) } __pyx_r = __pyx_pf_4ssh2_7session_7Session_44forward_listen_ex(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), __pyx_v_host, __pyx_v_port, __pyx_v_bound_port, __pyx_v_queue_maxsize); @@ -5612,7 +5593,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_44forward_listen_ex(struct __p PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("forward_listen_ex", 0); - /* "ssh2/session.pyx":363 + /* "ssh2/session.pyx":367 * int bound_port, int queue_maxsize): * cdef c_ssh2.LIBSSH2_LISTENER *listener * cdef char *_host = to_bytes(host) # <<<<<<<<<<<<<< @@ -5621,7 +5602,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_44forward_listen_ex(struct __p */ __pyx_v__host = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_host); - /* "ssh2/session.pyx":364 + /* "ssh2/session.pyx":368 * cdef c_ssh2.LIBSSH2_LISTENER *listener * cdef char *_host = to_bytes(host) * with nogil: # <<<<<<<<<<<<<< @@ -5636,7 +5617,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_44forward_listen_ex(struct __p #endif /*try:*/ { - /* "ssh2/session.pyx":365 + /* "ssh2/session.pyx":369 * cdef char *_host = to_bytes(host) * with nogil: * listener = c_ssh2.libssh2_channel_forward_listen_ex( # <<<<<<<<<<<<<< @@ -5646,7 +5627,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_44forward_listen_ex(struct __p __pyx_v_listener = libssh2_channel_forward_listen_ex(__pyx_v_self->_session, __pyx_v__host, __pyx_v_port, (&__pyx_v_bound_port), __pyx_v_queue_maxsize); } - /* "ssh2/session.pyx":364 + /* "ssh2/session.pyx":368 * cdef c_ssh2.LIBSSH2_LISTENER *listener * cdef char *_host = to_bytes(host) * with nogil: # <<<<<<<<<<<<<< @@ -5665,7 +5646,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_44forward_listen_ex(struct __p } } - /* "ssh2/session.pyx":367 + /* "ssh2/session.pyx":371 * listener = c_ssh2.libssh2_channel_forward_listen_ex( * self._session, _host, port, &bound_port, queue_maxsize) * if listener is NULL: # <<<<<<<<<<<<<< @@ -5675,7 +5656,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_44forward_listen_ex(struct __p __pyx_t_1 = ((__pyx_v_listener == NULL) != 0); if (__pyx_t_1) { - /* "ssh2/session.pyx":368 + /* "ssh2/session.pyx":372 * self._session, _host, port, &bound_port, queue_maxsize) * if listener is NULL: * return # <<<<<<<<<<<<<< @@ -5686,7 +5667,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_44forward_listen_ex(struct __p __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "ssh2/session.pyx":367 + /* "ssh2/session.pyx":371 * listener = c_ssh2.libssh2_channel_forward_listen_ex( * self._session, _host, port, &bound_port, queue_maxsize) * if listener is NULL: # <<<<<<<<<<<<<< @@ -5695,7 +5676,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_44forward_listen_ex(struct __p */ } - /* "ssh2/session.pyx":369 + /* "ssh2/session.pyx":373 * if listener is NULL: * return * return PyListener(listener, self) # <<<<<<<<<<<<<< @@ -5703,13 +5684,13 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_44forward_listen_ex(struct __p * def sftp_init(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __pyx_f_4ssh2_8listener_PyListener(__pyx_v_listener, __pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 369, __pyx_L1_error) + __pyx_t_2 = __pyx_f_4ssh2_8listener_PyListener(__pyx_v_listener, __pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 373, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":360 + /* "ssh2/session.pyx":364 * return PyListener(listener, self) * * def forward_listen_ex(self, host not None, int port, # <<<<<<<<<<<<<< @@ -5728,7 +5709,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_44forward_listen_ex(struct __p return __pyx_r; } -/* "ssh2/session.pyx":371 +/* "ssh2/session.pyx":375 * return PyListener(listener, self) * * def sftp_init(self): # <<<<<<<<<<<<<< @@ -5758,7 +5739,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_46sftp_init(struct __pyx_obj_4 PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("sftp_init", 0); - /* "ssh2/session.pyx":377 + /* "ssh2/session.pyx":381 * """ * cdef c_sftp.LIBSSH2_SFTP *_sftp * with nogil: # <<<<<<<<<<<<<< @@ -5773,7 +5754,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_46sftp_init(struct __pyx_obj_4 #endif /*try:*/ { - /* "ssh2/session.pyx":378 + /* "ssh2/session.pyx":382 * cdef c_sftp.LIBSSH2_SFTP *_sftp * with nogil: * _sftp = c_sftp.libssh2_sftp_init(self._session) # <<<<<<<<<<<<<< @@ -5783,7 +5764,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_46sftp_init(struct __pyx_obj_4 __pyx_v__sftp = libssh2_sftp_init(__pyx_v_self->_session); } - /* "ssh2/session.pyx":377 + /* "ssh2/session.pyx":381 * """ * cdef c_sftp.LIBSSH2_SFTP *_sftp * with nogil: # <<<<<<<<<<<<<< @@ -5802,7 +5783,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_46sftp_init(struct __pyx_obj_4 } } - /* "ssh2/session.pyx":379 + /* "ssh2/session.pyx":383 * with nogil: * _sftp = c_sftp.libssh2_sftp_init(self._session) * if _sftp is NULL: # <<<<<<<<<<<<<< @@ -5812,7 +5793,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_46sftp_init(struct __pyx_obj_4 __pyx_t_1 = ((__pyx_v__sftp == NULL) != 0); if (__pyx_t_1) { - /* "ssh2/session.pyx":380 + /* "ssh2/session.pyx":384 * _sftp = c_sftp.libssh2_sftp_init(self._session) * if _sftp is NULL: * return # <<<<<<<<<<<<<< @@ -5823,7 +5804,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_46sftp_init(struct __pyx_obj_4 __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "ssh2/session.pyx":379 + /* "ssh2/session.pyx":383 * with nogil: * _sftp = c_sftp.libssh2_sftp_init(self._session) * if _sftp is NULL: # <<<<<<<<<<<<<< @@ -5832,7 +5813,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_46sftp_init(struct __pyx_obj_4 */ } - /* "ssh2/session.pyx":381 + /* "ssh2/session.pyx":385 * if _sftp is NULL: * return * return PySFTP(_sftp, self) # <<<<<<<<<<<<<< @@ -5840,13 +5821,13 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_46sftp_init(struct __pyx_obj_4 * def last_error(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __pyx_f_4ssh2_4sftp_PySFTP(__pyx_v__sftp, __pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 381, __pyx_L1_error) + __pyx_t_2 = __pyx_f_4ssh2_4sftp_PySFTP(__pyx_v__sftp, __pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 385, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":371 + /* "ssh2/session.pyx":375 * return PyListener(listener, self) * * def sftp_init(self): # <<<<<<<<<<<<<< @@ -5865,7 +5846,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_46sftp_init(struct __pyx_obj_4 return __pyx_r; } -/* "ssh2/session.pyx":383 +/* "ssh2/session.pyx":387 * return PySFTP(_sftp, self) * * def last_error(self): # <<<<<<<<<<<<<< @@ -5904,7 +5885,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_48last_error(struct __pyx_obj_ PyObject *__pyx_t_7 = NULL; __Pyx_RefNannySetupContext("last_error", 0); - /* "ssh2/session.pyx":389 + /* "ssh2/session.pyx":393 * :rtype: str * """ * cdef char **_error_msg = NULL # <<<<<<<<<<<<<< @@ -5913,7 +5894,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_48last_error(struct __pyx_obj_ */ __pyx_v__error_msg = NULL; - /* "ssh2/session.pyx":391 + /* "ssh2/session.pyx":395 * cdef char **_error_msg = NULL * cdef bytes msg * cdef int errmsg_len = 0 # <<<<<<<<<<<<<< @@ -5922,7 +5903,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_48last_error(struct __pyx_obj_ */ __pyx_v_errmsg_len = 0; - /* "ssh2/session.pyx":393 + /* "ssh2/session.pyx":397 * cdef int errmsg_len = 0 * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -5937,7 +5918,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_48last_error(struct __pyx_obj_ #endif /*try:*/ { - /* "ssh2/session.pyx":394 + /* "ssh2/session.pyx":398 * cdef int rc * with nogil: * rc = c_ssh2.libssh2_session_last_error( # <<<<<<<<<<<<<< @@ -5947,7 +5928,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_48last_error(struct __pyx_obj_ __pyx_v_rc = libssh2_session_last_error(__pyx_v_self->_session, __pyx_v__error_msg, (&__pyx_v_errmsg_len), 0); } - /* "ssh2/session.pyx":393 + /* "ssh2/session.pyx":397 * cdef int errmsg_len = 0 * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -5966,7 +5947,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_48last_error(struct __pyx_obj_ } } - /* "ssh2/session.pyx":396 + /* "ssh2/session.pyx":400 * rc = c_ssh2.libssh2_session_last_error( * self._session, _error_msg, &errmsg_len, 0) * if errmsg_len > 0 and _error_msg is not NULL: # <<<<<<<<<<<<<< @@ -5984,7 +5965,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_48last_error(struct __pyx_obj_ __pyx_L7_bool_binop_done:; if (__pyx_t_1) { - /* "ssh2/session.pyx":397 + /* "ssh2/session.pyx":401 * self._session, _error_msg, &errmsg_len, 0) * if errmsg_len > 0 and _error_msg is not NULL: * for line in _error_msg[:errmsg_len]: # <<<<<<<<<<<<<< @@ -5996,24 +5977,24 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_48last_error(struct __pyx_obj_ __pyx_t_3 = __pyx_t_5; __pyx_v_line = (__pyx_t_3[0]); - /* "ssh2/session.pyx":398 + /* "ssh2/session.pyx":402 * if errmsg_len > 0 and _error_msg is not NULL: * for line in _error_msg[:errmsg_len]: * msg += line # <<<<<<<<<<<<<< * else: * msg = b'' */ - if (unlikely(!__pyx_v_msg)) { __Pyx_RaiseUnboundLocalError("msg"); __PYX_ERR(0, 398, __pyx_L1_error) } - __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_line); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 398, __pyx_L1_error) + if (unlikely(!__pyx_v_msg)) { __Pyx_RaiseUnboundLocalError("msg"); __PYX_ERR(0, 402, __pyx_L1_error) } + __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_line); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 402, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PyNumber_InPlaceAdd(__pyx_v_msg, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 398, __pyx_L1_error) + __pyx_t_7 = PyNumber_InPlaceAdd(__pyx_v_msg, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 402, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF_SET(__pyx_v_msg, ((PyObject*)__pyx_t_7)); __pyx_t_7 = 0; } - /* "ssh2/session.pyx":396 + /* "ssh2/session.pyx":400 * rc = c_ssh2.libssh2_session_last_error( * self._session, _error_msg, &errmsg_len, 0) * if errmsg_len > 0 and _error_msg is not NULL: # <<<<<<<<<<<<<< @@ -6023,7 +6004,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_48last_error(struct __pyx_obj_ goto __pyx_L6; } - /* "ssh2/session.pyx":400 + /* "ssh2/session.pyx":404 * msg += line * else: * msg = b'' # <<<<<<<<<<<<<< @@ -6036,7 +6017,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_48last_error(struct __pyx_obj_ } __pyx_L6:; - /* "ssh2/session.pyx":401 + /* "ssh2/session.pyx":405 * else: * msg = b'' * return msg # <<<<<<<<<<<<<< @@ -6044,12 +6025,12 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_48last_error(struct __pyx_obj_ * def scp_recv(self, path not None): */ __Pyx_XDECREF(__pyx_r); - if (unlikely(!__pyx_v_msg)) { __Pyx_RaiseUnboundLocalError("msg"); __PYX_ERR(0, 401, __pyx_L1_error) } + if (unlikely(!__pyx_v_msg)) { __Pyx_RaiseUnboundLocalError("msg"); __PYX_ERR(0, 405, __pyx_L1_error) } __Pyx_INCREF(__pyx_v_msg); __pyx_r = __pyx_v_msg; goto __pyx_L0; - /* "ssh2/session.pyx":383 + /* "ssh2/session.pyx":387 * return PySFTP(_sftp, self) * * def last_error(self): # <<<<<<<<<<<<<< @@ -6070,7 +6051,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_48last_error(struct __pyx_obj_ return __pyx_r; } -/* "ssh2/session.pyx":403 +/* "ssh2/session.pyx":407 * return msg * * def scp_recv(self, path not None): # <<<<<<<<<<<<<< @@ -6086,7 +6067,7 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_51scp_recv(PyObject *__pyx_v_s __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("scp_recv (wrapper)", 0); if (unlikely(((PyObject *)__pyx_v_path) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "path"); __PYX_ERR(0, 403, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "path"); __PYX_ERR(0, 407, __pyx_L1_error) } __pyx_r = __pyx_pf_4ssh2_7session_7Session_50scp_recv(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), ((PyObject *)__pyx_v_path)); @@ -6110,7 +6091,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_50scp_recv(struct __pyx_obj_4s PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("scp_recv", 0); - /* "ssh2/session.pyx":404 + /* "ssh2/session.pyx":408 * * def scp_recv(self, path not None): * cdef char *_path = to_bytes(path) # <<<<<<<<<<<<<< @@ -6119,19 +6100,19 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_50scp_recv(struct __pyx_obj_4s */ __pyx_v__path = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_path); - /* "ssh2/session.pyx":405 + /* "ssh2/session.pyx":409 * def scp_recv(self, path not None): * cdef char *_path = to_bytes(path) * cdef StatInfo statinfo = StatInfo() # <<<<<<<<<<<<<< * cdef c_ssh2.LIBSSH2_CHANNEL *channel * with nogil: */ - __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4ssh2_8statinfo_StatInfo), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 405, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4ssh2_8statinfo_StatInfo), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_statinfo = ((struct __pyx_obj_4ssh2_8statinfo_StatInfo *)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/session.pyx":407 + /* "ssh2/session.pyx":411 * cdef StatInfo statinfo = StatInfo() * cdef c_ssh2.LIBSSH2_CHANNEL *channel * with nogil: # <<<<<<<<<<<<<< @@ -6146,7 +6127,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_50scp_recv(struct __pyx_obj_4s #endif /*try:*/ { - /* "ssh2/session.pyx":408 + /* "ssh2/session.pyx":412 * cdef c_ssh2.LIBSSH2_CHANNEL *channel * with nogil: * channel = c_ssh2.libssh2_scp_recv( # <<<<<<<<<<<<<< @@ -6156,7 +6137,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_50scp_recv(struct __pyx_obj_4s __pyx_v_channel = libssh2_scp_recv(__pyx_v_self->_session, __pyx_v__path, __pyx_v_statinfo->_stat); } - /* "ssh2/session.pyx":407 + /* "ssh2/session.pyx":411 * cdef StatInfo statinfo = StatInfo() * cdef c_ssh2.LIBSSH2_CHANNEL *channel * with nogil: # <<<<<<<<<<<<<< @@ -6175,7 +6156,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_50scp_recv(struct __pyx_obj_4s } } - /* "ssh2/session.pyx":410 + /* "ssh2/session.pyx":414 * channel = c_ssh2.libssh2_scp_recv( * self._session, _path, statinfo._stat) * if channel is not NULL: # <<<<<<<<<<<<<< @@ -6185,17 +6166,17 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_50scp_recv(struct __pyx_obj_4s __pyx_t_2 = ((__pyx_v_channel != NULL) != 0); if (__pyx_t_2) { - /* "ssh2/session.pyx":411 + /* "ssh2/session.pyx":415 * self._session, _path, statinfo._stat) * if channel is not NULL: * return PyChannel(channel, self), statinfo # <<<<<<<<<<<<<< * - * # def scp_recv2(self, path not None): + * IF EMBEDDED_LIB: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_4ssh2_7channel_PyChannel(__pyx_v_channel, __pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 411, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_7channel_PyChannel(__pyx_v_channel, __pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 415, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 411, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 415, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); @@ -6207,7 +6188,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_50scp_recv(struct __pyx_obj_4s __pyx_t_3 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":410 + /* "ssh2/session.pyx":414 * channel = c_ssh2.libssh2_scp_recv( * self._session, _path, statinfo._stat) * if channel is not NULL: # <<<<<<<<<<<<<< @@ -6216,7 +6197,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_50scp_recv(struct __pyx_obj_4s */ } - /* "ssh2/session.pyx":403 + /* "ssh2/session.pyx":407 * return msg * * def scp_recv(self, path not None): # <<<<<<<<<<<<<< @@ -6239,8 +6220,8 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_50scp_recv(struct __pyx_obj_4s return __pyx_r; } -/* "ssh2/session.pyx":428 - * # return PyChannel(channel, self), fileinfo +/* "ssh2/session.pyx":433 + * return PyChannel(channel, self), fileinfo * * def scp_send(self, path not None, int mode, size_t size): # <<<<<<<<<<<<<< * """Send file via SCP. @@ -6282,17 +6263,17 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_53scp_send(PyObject *__pyx_v_s case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mode)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("scp_send", 1, 3, 3, 1); __PYX_ERR(0, 428, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("scp_send", 1, 3, 3, 1); __PYX_ERR(0, 433, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("scp_send", 1, 3, 3, 2); __PYX_ERR(0, 428, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("scp_send", 1, 3, 3, 2); __PYX_ERR(0, 433, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "scp_send") < 0)) __PYX_ERR(0, 428, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "scp_send") < 0)) __PYX_ERR(0, 433, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -6302,19 +6283,19 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_53scp_send(PyObject *__pyx_v_s values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_path = values[0]; - __pyx_v_mode = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_mode == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 428, __pyx_L3_error) - __pyx_v_size = __Pyx_PyInt_As_size_t(values[2]); if (unlikely((__pyx_v_size == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 428, __pyx_L3_error) + __pyx_v_mode = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_mode == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 433, __pyx_L3_error) + __pyx_v_size = __Pyx_PyInt_As_size_t(values[2]); if (unlikely((__pyx_v_size == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 433, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("scp_send", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 428, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("scp_send", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 433, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.session.Session.scp_send", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(((PyObject *)__pyx_v_path) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "path"); __PYX_ERR(0, 428, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "path"); __PYX_ERR(0, 433, __pyx_L1_error) } __pyx_r = __pyx_pf_4ssh2_7session_7Session_52scp_send(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), __pyx_v_path, __pyx_v_mode, __pyx_v_size); @@ -6336,7 +6317,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_52scp_send(struct __pyx_obj_4s PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("scp_send", 0); - /* "ssh2/session.pyx":439 + /* "ssh2/session.pyx":444 * * :rtype: :py:class:`ssh2.channel.Channel`""" * cdef char *_path = to_bytes(path) # <<<<<<<<<<<<<< @@ -6345,7 +6326,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_52scp_send(struct __pyx_obj_4s */ __pyx_v__path = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_path); - /* "ssh2/session.pyx":441 + /* "ssh2/session.pyx":446 * cdef char *_path = to_bytes(path) * cdef c_ssh2.LIBSSH2_CHANNEL *channel * with nogil: # <<<<<<<<<<<<<< @@ -6360,7 +6341,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_52scp_send(struct __pyx_obj_4s #endif /*try:*/ { - /* "ssh2/session.pyx":442 + /* "ssh2/session.pyx":447 * cdef c_ssh2.LIBSSH2_CHANNEL *channel * with nogil: * channel = c_ssh2.libssh2_scp_send( # <<<<<<<<<<<<<< @@ -6370,7 +6351,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_52scp_send(struct __pyx_obj_4s __pyx_v_channel = libssh2_scp_send(__pyx_v_self->_session, __pyx_v__path, __pyx_v_mode, __pyx_v_size); } - /* "ssh2/session.pyx":441 + /* "ssh2/session.pyx":446 * cdef char *_path = to_bytes(path) * cdef c_ssh2.LIBSSH2_CHANNEL *channel * with nogil: # <<<<<<<<<<<<<< @@ -6389,7 +6370,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_52scp_send(struct __pyx_obj_4s } } - /* "ssh2/session.pyx":444 + /* "ssh2/session.pyx":449 * channel = c_ssh2.libssh2_scp_send( * self._session, _path, mode, size) * if channel is not NULL: # <<<<<<<<<<<<<< @@ -6399,7 +6380,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_52scp_send(struct __pyx_obj_4s __pyx_t_1 = ((__pyx_v_channel != NULL) != 0); if (__pyx_t_1) { - /* "ssh2/session.pyx":445 + /* "ssh2/session.pyx":450 * self._session, _path, mode, size) * if channel is not NULL: * return PyChannel(channel, self) # <<<<<<<<<<<<<< @@ -6407,13 +6388,13 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_52scp_send(struct __pyx_obj_4s * def scp_send64(self, path not None, int mode, uint64_t size, */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __pyx_f_4ssh2_7channel_PyChannel(__pyx_v_channel, __pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 445, __pyx_L1_error) + __pyx_t_2 = __pyx_f_4ssh2_7channel_PyChannel(__pyx_v_channel, __pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 450, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":444 + /* "ssh2/session.pyx":449 * channel = c_ssh2.libssh2_scp_send( * self._session, _path, mode, size) * if channel is not NULL: # <<<<<<<<<<<<<< @@ -6422,8 +6403,8 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_52scp_send(struct __pyx_obj_4s */ } - /* "ssh2/session.pyx":428 - * # return PyChannel(channel, self), fileinfo + /* "ssh2/session.pyx":433 + * return PyChannel(channel, self), fileinfo * * def scp_send(self, path not None, int mode, size_t size): # <<<<<<<<<<<<<< * """Send file via SCP. @@ -6443,7 +6424,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_52scp_send(struct __pyx_obj_4s return __pyx_r; } -/* "ssh2/session.pyx":447 +/* "ssh2/session.pyx":452 * return PyChannel(channel, self) * * def scp_send64(self, path not None, int mode, uint64_t size, # <<<<<<<<<<<<<< @@ -6492,29 +6473,29 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_55scp_send64(PyObject *__pyx_v case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mode)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("scp_send64", 1, 5, 5, 1); __PYX_ERR(0, 447, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("scp_send64", 1, 5, 5, 1); __PYX_ERR(0, 452, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("scp_send64", 1, 5, 5, 2); __PYX_ERR(0, 447, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("scp_send64", 1, 5, 5, 2); __PYX_ERR(0, 452, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mtime)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("scp_send64", 1, 5, 5, 3); __PYX_ERR(0, 447, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("scp_send64", 1, 5, 5, 3); __PYX_ERR(0, 452, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_atime)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("scp_send64", 1, 5, 5, 4); __PYX_ERR(0, 447, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("scp_send64", 1, 5, 5, 4); __PYX_ERR(0, 452, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "scp_send64") < 0)) __PYX_ERR(0, 447, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "scp_send64") < 0)) __PYX_ERR(0, 452, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 5) { goto __pyx_L5_argtuple_error; @@ -6526,21 +6507,21 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_55scp_send64(PyObject *__pyx_v values[4] = PyTuple_GET_ITEM(__pyx_args, 4); } __pyx_v_path = values[0]; - __pyx_v_mode = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_mode == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 447, __pyx_L3_error) - __pyx_v_size = __Pyx_PyInt_As_uint64_t(values[2]); if (unlikely((__pyx_v_size == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 447, __pyx_L3_error) - __pyx_v_mtime = __Pyx_PyInt_As_time_t(values[3]); if (unlikely((__pyx_v_mtime == ((time_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 448, __pyx_L3_error) - __pyx_v_atime = __Pyx_PyInt_As_time_t(values[4]); if (unlikely((__pyx_v_atime == ((time_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 448, __pyx_L3_error) + __pyx_v_mode = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_mode == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 452, __pyx_L3_error) + __pyx_v_size = __Pyx_PyInt_As_uint64_t(values[2]); if (unlikely((__pyx_v_size == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 452, __pyx_L3_error) + __pyx_v_mtime = __Pyx_PyInt_As_time_t(values[3]); if (unlikely((__pyx_v_mtime == ((time_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 453, __pyx_L3_error) + __pyx_v_atime = __Pyx_PyInt_As_time_t(values[4]); if (unlikely((__pyx_v_atime == ((time_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 453, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("scp_send64", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 447, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("scp_send64", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 452, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.session.Session.scp_send64", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(((PyObject *)__pyx_v_path) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "path"); __PYX_ERR(0, 447, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "path"); __PYX_ERR(0, 452, __pyx_L1_error) } __pyx_r = __pyx_pf_4ssh2_7session_7Session_54scp_send64(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), __pyx_v_path, __pyx_v_mode, __pyx_v_size, __pyx_v_mtime, __pyx_v_atime); @@ -6562,7 +6543,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_54scp_send64(struct __pyx_obj_ PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("scp_send64", 0); - /* "ssh2/session.pyx":449 + /* "ssh2/session.pyx":454 * def scp_send64(self, path not None, int mode, uint64_t size, * time_t mtime, time_t atime): * cdef char *_path = to_bytes(path) # <<<<<<<<<<<<<< @@ -6571,7 +6552,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_54scp_send64(struct __pyx_obj_ */ __pyx_v__path = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_path); - /* "ssh2/session.pyx":451 + /* "ssh2/session.pyx":456 * cdef char *_path = to_bytes(path) * cdef c_ssh2.LIBSSH2_CHANNEL *channel * with nogil: # <<<<<<<<<<<<<< @@ -6586,7 +6567,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_54scp_send64(struct __pyx_obj_ #endif /*try:*/ { - /* "ssh2/session.pyx":452 + /* "ssh2/session.pyx":457 * cdef c_ssh2.LIBSSH2_CHANNEL *channel * with nogil: * channel = c_ssh2.libssh2_scp_send64( # <<<<<<<<<<<<<< @@ -6596,7 +6577,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_54scp_send64(struct __pyx_obj_ __pyx_v_channel = libssh2_scp_send64(__pyx_v_self->_session, __pyx_v__path, __pyx_v_mode, __pyx_v_size, __pyx_v_mtime, __pyx_v_atime); } - /* "ssh2/session.pyx":451 + /* "ssh2/session.pyx":456 * cdef char *_path = to_bytes(path) * cdef c_ssh2.LIBSSH2_CHANNEL *channel * with nogil: # <<<<<<<<<<<<<< @@ -6615,7 +6596,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_54scp_send64(struct __pyx_obj_ } } - /* "ssh2/session.pyx":454 + /* "ssh2/session.pyx":459 * channel = c_ssh2.libssh2_scp_send64( * self._session, _path, mode, size, mtime, atime) * if channel is not NULL: # <<<<<<<<<<<<<< @@ -6624,19 +6605,19 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_54scp_send64(struct __pyx_obj_ __pyx_t_1 = ((__pyx_v_channel != NULL) != 0); if (__pyx_t_1) { - /* "ssh2/session.pyx":455 + /* "ssh2/session.pyx":460 * self._session, _path, mode, size, mtime, atime) * if channel is not NULL: * return PyChannel(channel, self) # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __pyx_f_4ssh2_7channel_PyChannel(__pyx_v_channel, __pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 455, __pyx_L1_error) + __pyx_t_2 = __pyx_f_4ssh2_7channel_PyChannel(__pyx_v_channel, __pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 460, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":454 + /* "ssh2/session.pyx":459 * channel = c_ssh2.libssh2_scp_send64( * self._session, _path, mode, size, mtime, atime) * if channel is not NULL: # <<<<<<<<<<<<<< @@ -6644,7 +6625,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_54scp_send64(struct __pyx_obj_ */ } - /* "ssh2/session.pyx":447 + /* "ssh2/session.pyx":452 * return PyChannel(channel, self) * * def scp_send64(self, path not None, int mode, uint64_t size, # <<<<<<<<<<<<<< @@ -6960,7 +6941,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {0, 0, 0, 0, 0, 0, 0} }; static int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(0, 43, __pyx_L1_error) + __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(0, 46, __pyx_L1_error) __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error) return 0; __pyx_L1_error:; @@ -6971,36 +6952,36 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - /* "ssh2/session.pyx":140 + /* "ssh2/session.pyx":143 * return * auth = to_str(_auth) * return auth.split(',') # <<<<<<<<<<<<<< * * def userauth_publickey_fromfile(self, username not None, */ - __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 140, __pyx_L1_error) + __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); - /* "ssh2/session.pyx":256 + /* "ssh2/session.pyx":260 * c_ssh2.libssh2_agent_free(agent) * with gil: * raise AgentConnectionError("Unable to connect to agent") # <<<<<<<<<<<<<< * return agent * */ - __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_connect_to_agent); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 256, __pyx_L1_error) + __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_connect_to_agent); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 260, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); - /* "ssh2/session.pyx":296 + /* "ssh2/session.pyx":300 * clear_agent(agent) * with gil: * raise AgentListIdentitiesError( # <<<<<<<<<<<<<< * "Failure requesting identities from agent") * while 1: */ - __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_Failure_requesting_identities_fr); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 296, __pyx_L1_error) + __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_Failure_requesting_identities_fr); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 300, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); @@ -7129,11 +7110,11 @@ PyMODINIT_FUNC PyInit_session(void) __pyx_vtabptr_4ssh2_7session_Session = &__pyx_vtable_4ssh2_7session_Session; __pyx_vtable_4ssh2_7session_Session.init_connect_agent = (LIBSSH2_AGENT *(*)(struct __pyx_obj_4ssh2_7session_Session *))__pyx_f_4ssh2_7session_7Session_init_connect_agent; __pyx_vtable_4ssh2_7session_Session._agent_init = (LIBSSH2_AGENT *(*)(struct __pyx_obj_4ssh2_7session_Session *))__pyx_f_4ssh2_7session_7Session__agent_init; - if (PyType_Ready(&__pyx_type_4ssh2_7session_Session) < 0) __PYX_ERR(0, 34, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_4ssh2_7session_Session) < 0) __PYX_ERR(0, 37, __pyx_L1_error) __pyx_type_4ssh2_7session_Session.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_4ssh2_7session_Session.tp_dict, __pyx_vtabptr_4ssh2_7session_Session) < 0) __PYX_ERR(0, 34, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "Session", (PyObject *)&__pyx_type_4ssh2_7session_Session) < 0) __PYX_ERR(0, 34, __pyx_L1_error) - if (__Pyx_setup_reduce((PyObject*)&__pyx_type_4ssh2_7session_Session) < 0) __PYX_ERR(0, 34, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type_4ssh2_7session_Session.tp_dict, __pyx_vtabptr_4ssh2_7session_Session) < 0) __PYX_ERR(0, 37, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "Session", (PyObject *)&__pyx_type_4ssh2_7session_Session) < 0) __PYX_ERR(0, 37, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_4ssh2_7session_Session) < 0) __PYX_ERR(0, 37, __pyx_L1_error) __pyx_ptype_4ssh2_7session_Session = &__pyx_type_4ssh2_7session_Session; /*--- Type import code ---*/ __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", diff --git a/ssh2/session.pyx b/ssh2/session.pyx index 7d69898f..1b0690f8 100644 --- a/ssh2/session.pyx +++ b/ssh2/session.pyx @@ -14,6 +14,8 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# cython: embedsignature=True, boundscheck=False, optimize.use_switch=True, wraparound=False + from cpython cimport PyObject_AsFileDescriptor from libc.stdint cimport uint64_t from libc.time cimport time_t @@ -27,7 +29,8 @@ from exceptions cimport SessionHandshakeError, SessionStartupError, \ from listener cimport PyListener from sftp cimport PySFTP from utils cimport to_bytes, to_str -# from fileinfo cimport FileInfo +IF EMBEDDED_LIB: + from fileinfo cimport FileInfo from statinfo cimport StatInfo @@ -195,21 +198,22 @@ cdef class Session: _privatekey, _passphrase, _hostname) return rc - # def userauth_publickey_frommemory(self, - # const char *username, - # const char *publickeyfiledata, - # const char *privatekeyfiledata, - # const char *passphrase): - # cdef int rc - # cdef size_t username_len, pubkeydata_len, privatekeydata_len - # username_len, pubkeydata_len, privatekeydata_len = \ - # len(username), len(publickeyfiledata), len(privatekeyfiledata) - # with nogil: - # rc = c_ssh2.libssh2_userauth_publickey_frommemory( - # self._session, username, username_len, publickeyfiledata, - # pubkeydata_len, privatekeyfiledata, - # privatekeydata_len, passphrase) - # return rc + IF EMBEDDED_LIB: + def userauth_publickey_frommemory(self, + const char *username, + const char *publickeyfiledata, + const char *privatekeyfiledata, + const char *passphrase): + cdef int rc + cdef size_t username_len, pubkeydata_len, privatekeydata_len + username_len, pubkeydata_len, privatekeydata_len = \ + len(username), len(publickeyfiledata), len(privatekeyfiledata) + with nogil: + rc = c_ssh2.libssh2_userauth_publickey_frommemory( + self._session, username, username_len, publickeyfiledata, + pubkeydata_len, privatekeyfiledata, + privatekeydata_len, passphrase) + return rc def userauth_password(self, username not None, password not None): """Perform password authentication @@ -410,20 +414,21 @@ cdef class Session: if channel is not NULL: return PyChannel(channel, self), statinfo - # def scp_recv2(self, path not None): - # """Receive file via SCP. - # :param path: File path to receive. - # :type path: str - # :rtype: tuple(:py:class:`ssh2.channel.Channel`, - # :py:class:`ssh2.fileinfo.FileInfo)""" - # cdef FileInfo fileinfo = FileInfo() - # cdef char *_path = to_bytes(path) - # cdef c_ssh2.LIBSSH2_CHANNEL *channel - # with nogil: - # channel = c_ssh2.libssh2_scp_recv2( - # self._session, _path, fileinfo._stat) - # if channel is not NULL: - # return PyChannel(channel, self), fileinfo + IF EMBEDDED_LIB: + def scp_recv2(self, path not None): + """Receive file via SCP. + :param path: File path to receive. + :type path: str + :rtype: tuple(:py:class:`ssh2.channel.Channel`, + :py:class:`ssh2.fileinfo.FileInfo)""" + cdef FileInfo fileinfo = FileInfo() + cdef char *_path = to_bytes(path) + cdef c_ssh2.LIBSSH2_CHANNEL *channel + with nogil: + channel = c_ssh2.libssh2_scp_recv2( + self._session, _path, fileinfo._stat) + if channel is not NULL: + return PyChannel(channel, self), fileinfo def scp_send(self, path not None, int mode, size_t size): """Send file via SCP. diff --git a/ssh2/sftp.c b/ssh2/sftp.c index c8eedf6e..7ed0c706 100644 --- a/ssh2/sftp.c +++ b/ssh2/sftp.c @@ -1,24 +1,5 @@ /* Generated by Cython 0.26 */ -/* BEGIN: Cython Metadata -{ - "distutils": { - "depends": [], - "extra_compile_args": [ - "-ggdb" - ], - "libraries": [ - "ssh2" - ], - "name": "ssh2.sftp", - "sources": [ - "ssh2/sftp.pyx" - ] - }, - "module_name": "ssh2.sftp" -} -END: Cython Metadata */ - #define PY_SSIZE_T_CLEAN #include "Python.h" #ifndef Py_PYTHON_H @@ -896,7 +877,7 @@ struct __pyx_obj_4ssh2_4sftp_SFTP { }; -/* "ssh2/sftp.pyx":319 +/* "ssh2/sftp.pyx":321 * * * cdef class SFTPAttributes: # <<<<<<<<<<<<<< @@ -909,7 +890,7 @@ struct __pyx_obj_4ssh2_4sftp_SFTPAttributes { }; -/* "ssh2/sftp.pyx":398 +/* "ssh2/sftp.pyx":400 * * * cdef class SFTPHandle: # <<<<<<<<<<<<<< @@ -1476,7 +1457,7 @@ static PyObject *__pyx_tuple__4; static PyObject *__pyx_tuple__8; static PyObject *__pyx_tuple__9; -/* "ssh2/sftp.pyx":57 +/* "ssh2/sftp.pyx":59 * * * cdef object PySFTPHandle(c_sftp.LIBSSH2_SFTP_HANDLE *handle, SFTP sftp): # <<<<<<<<<<<<<< @@ -1492,25 +1473,25 @@ static PyObject *__pyx_f_4ssh2_4sftp_PySFTPHandle(LIBSSH2_SFTP_HANDLE *__pyx_v_h PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("PySFTPHandle", 0); - /* "ssh2/sftp.pyx":58 + /* "ssh2/sftp.pyx":60 * * cdef object PySFTPHandle(c_sftp.LIBSSH2_SFTP_HANDLE *handle, SFTP sftp): * cdef SFTPHandle _handle = SFTPHandle(sftp) # <<<<<<<<<<<<<< * _handle._handle = handle * return _handle */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 58, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_v_sftp)); __Pyx_GIVEREF(((PyObject *)__pyx_v_sftp)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_sftp)); - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4ssh2_4sftp_SFTPHandle), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 58, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4ssh2_4sftp_SFTPHandle), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v__handle = ((struct __pyx_obj_4ssh2_4sftp_SFTPHandle *)__pyx_t_2); __pyx_t_2 = 0; - /* "ssh2/sftp.pyx":59 + /* "ssh2/sftp.pyx":61 * cdef object PySFTPHandle(c_sftp.LIBSSH2_SFTP_HANDLE *handle, SFTP sftp): * cdef SFTPHandle _handle = SFTPHandle(sftp) * _handle._handle = handle # <<<<<<<<<<<<<< @@ -1519,7 +1500,7 @@ static PyObject *__pyx_f_4ssh2_4sftp_PySFTPHandle(LIBSSH2_SFTP_HANDLE *__pyx_v_h */ __pyx_v__handle->_handle = __pyx_v_handle; - /* "ssh2/sftp.pyx":60 + /* "ssh2/sftp.pyx":62 * cdef SFTPHandle _handle = SFTPHandle(sftp) * _handle._handle = handle * return _handle # <<<<<<<<<<<<<< @@ -1531,7 +1512,7 @@ static PyObject *__pyx_f_4ssh2_4sftp_PySFTPHandle(LIBSSH2_SFTP_HANDLE *__pyx_v_h __pyx_r = ((PyObject *)__pyx_v__handle); goto __pyx_L0; - /* "ssh2/sftp.pyx":57 + /* "ssh2/sftp.pyx":59 * * * cdef object PySFTPHandle(c_sftp.LIBSSH2_SFTP_HANDLE *handle, SFTP sftp): # <<<<<<<<<<<<<< @@ -1552,7 +1533,7 @@ static PyObject *__pyx_f_4ssh2_4sftp_PySFTPHandle(LIBSSH2_SFTP_HANDLE *__pyx_v_h return __pyx_r; } -/* "ssh2/sftp.pyx":63 +/* "ssh2/sftp.pyx":65 * * * cdef object PySFTP(c_sftp.LIBSSH2_SFTP *sftp, Session session): # <<<<<<<<<<<<<< @@ -1568,25 +1549,25 @@ static PyObject *__pyx_f_4ssh2_4sftp_PySFTP(LIBSSH2_SFTP *__pyx_v_sftp, struct _ PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("PySFTP", 0); - /* "ssh2/sftp.pyx":64 + /* "ssh2/sftp.pyx":66 * * cdef object PySFTP(c_sftp.LIBSSH2_SFTP *sftp, Session session): * cdef SFTP _sftp = SFTP(session) # <<<<<<<<<<<<<< * _sftp._sftp = sftp * return _sftp */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 64, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_v_session)); __Pyx_GIVEREF(((PyObject *)__pyx_v_session)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_session)); - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4ssh2_4sftp_SFTP), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 64, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4ssh2_4sftp_SFTP), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v__sftp = ((struct __pyx_obj_4ssh2_4sftp_SFTP *)__pyx_t_2); __pyx_t_2 = 0; - /* "ssh2/sftp.pyx":65 + /* "ssh2/sftp.pyx":67 * cdef object PySFTP(c_sftp.LIBSSH2_SFTP *sftp, Session session): * cdef SFTP _sftp = SFTP(session) * _sftp._sftp = sftp # <<<<<<<<<<<<<< @@ -1595,7 +1576,7 @@ static PyObject *__pyx_f_4ssh2_4sftp_PySFTP(LIBSSH2_SFTP *__pyx_v_sftp, struct _ */ __pyx_v__sftp->_sftp = __pyx_v_sftp; - /* "ssh2/sftp.pyx":66 + /* "ssh2/sftp.pyx":68 * cdef SFTP _sftp = SFTP(session) * _sftp._sftp = sftp * return _sftp # <<<<<<<<<<<<<< @@ -1607,7 +1588,7 @@ static PyObject *__pyx_f_4ssh2_4sftp_PySFTP(LIBSSH2_SFTP *__pyx_v_sftp, struct _ __pyx_r = ((PyObject *)__pyx_v__sftp); goto __pyx_L0; - /* "ssh2/sftp.pyx":63 + /* "ssh2/sftp.pyx":65 * * * cdef object PySFTP(c_sftp.LIBSSH2_SFTP *sftp, Session session): # <<<<<<<<<<<<<< @@ -1628,7 +1609,7 @@ static PyObject *__pyx_f_4ssh2_4sftp_PySFTP(LIBSSH2_SFTP *__pyx_v_sftp, struct _ return __pyx_r; } -/* "ssh2/sftp.pyx":71 +/* "ssh2/sftp.pyx":73 * cdef class SFTP: * * def __cinit__(self, session): # <<<<<<<<<<<<<< @@ -1662,7 +1643,7 @@ static int __pyx_pw_4ssh2_4sftp_4SFTP_1__cinit__(PyObject *__pyx_v_self, PyObjec else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 71, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 73, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; @@ -1673,7 +1654,7 @@ static int __pyx_pw_4ssh2_4sftp_4SFTP_1__cinit__(PyObject *__pyx_v_self, PyObjec } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 71, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 73, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.sftp.SFTP.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -1692,7 +1673,7 @@ static int __pyx_pf_4ssh2_4sftp_4SFTP___cinit__(struct __pyx_obj_4ssh2_4sftp_SFT PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "ssh2/sftp.pyx":72 + /* "ssh2/sftp.pyx":74 * * def __cinit__(self, session): * self._sftp = NULL # <<<<<<<<<<<<<< @@ -1701,14 +1682,14 @@ static int __pyx_pf_4ssh2_4sftp_4SFTP___cinit__(struct __pyx_obj_4ssh2_4sftp_SFT */ __pyx_v_self->_sftp = NULL; - /* "ssh2/sftp.pyx":73 + /* "ssh2/sftp.pyx":75 * def __cinit__(self, session): * self._sftp = NULL * self._session = session # <<<<<<<<<<<<<< * * def __dealloc__(self): */ - if (!(likely(((__pyx_v_session) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_session, __pyx_ptype_4ssh2_7session_Session))))) __PYX_ERR(0, 73, __pyx_L1_error) + if (!(likely(((__pyx_v_session) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_session, __pyx_ptype_4ssh2_7session_Session))))) __PYX_ERR(0, 75, __pyx_L1_error) __pyx_t_1 = __pyx_v_session; __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); @@ -1717,7 +1698,7 @@ static int __pyx_pf_4ssh2_4sftp_4SFTP___cinit__(struct __pyx_obj_4ssh2_4sftp_SFT __pyx_v_self->_session = ((struct __pyx_obj_4ssh2_7session_Session *)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/sftp.pyx":71 + /* "ssh2/sftp.pyx":73 * cdef class SFTP: * * def __cinit__(self, session): # <<<<<<<<<<<<<< @@ -1737,7 +1718,7 @@ static int __pyx_pf_4ssh2_4sftp_4SFTP___cinit__(struct __pyx_obj_4ssh2_4sftp_SFT return __pyx_r; } -/* "ssh2/sftp.pyx":75 +/* "ssh2/sftp.pyx":77 * self._session = session * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -1760,7 +1741,7 @@ static void __pyx_pf_4ssh2_4sftp_4SFTP_2__dealloc__(struct __pyx_obj_4ssh2_4sftp __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "ssh2/sftp.pyx":76 + /* "ssh2/sftp.pyx":78 * * def __dealloc__(self): * with nogil: # <<<<<<<<<<<<<< @@ -1775,7 +1756,7 @@ static void __pyx_pf_4ssh2_4sftp_4SFTP_2__dealloc__(struct __pyx_obj_4ssh2_4sftp #endif /*try:*/ { - /* "ssh2/sftp.pyx":77 + /* "ssh2/sftp.pyx":79 * def __dealloc__(self): * with nogil: * c_sftp.libssh2_sftp_shutdown(self._sftp) # <<<<<<<<<<<<<< @@ -1785,7 +1766,7 @@ static void __pyx_pf_4ssh2_4sftp_4SFTP_2__dealloc__(struct __pyx_obj_4ssh2_4sftp libssh2_sftp_shutdown(__pyx_v_self->_sftp); } - /* "ssh2/sftp.pyx":76 + /* "ssh2/sftp.pyx":78 * * def __dealloc__(self): * with nogil: # <<<<<<<<<<<<<< @@ -1804,7 +1785,7 @@ static void __pyx_pf_4ssh2_4sftp_4SFTP_2__dealloc__(struct __pyx_obj_4ssh2_4sftp } } - /* "ssh2/sftp.pyx":75 + /* "ssh2/sftp.pyx":77 * self._session = session * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -1816,7 +1797,7 @@ static void __pyx_pf_4ssh2_4sftp_4SFTP_2__dealloc__(struct __pyx_obj_4ssh2_4sftp __Pyx_RefNannyFinishContext(); } -/* "ssh2/sftp.pyx":79 +/* "ssh2/sftp.pyx":81 * c_sftp.libssh2_sftp_shutdown(self._sftp) * * def get_channel(self): # <<<<<<<<<<<<<< @@ -1847,7 +1828,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_4get_channel(struct __pyx_obj_4ssh2_ PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("get_channel", 0); - /* "ssh2/sftp.pyx":81 + /* "ssh2/sftp.pyx":83 * def get_channel(self): * cdef c_ssh2.LIBSSH2_CHANNEL *_channel * with nogil: # <<<<<<<<<<<<<< @@ -1862,7 +1843,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_4get_channel(struct __pyx_obj_4ssh2_ #endif /*try:*/ { - /* "ssh2/sftp.pyx":82 + /* "ssh2/sftp.pyx":84 * cdef c_ssh2.LIBSSH2_CHANNEL *_channel * with nogil: * _channel = c_sftp.libssh2_sftp_get_channel(self._sftp) # <<<<<<<<<<<<<< @@ -1872,7 +1853,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_4get_channel(struct __pyx_obj_4ssh2_ __pyx_v__channel = libssh2_sftp_get_channel(__pyx_v_self->_sftp); } - /* "ssh2/sftp.pyx":81 + /* "ssh2/sftp.pyx":83 * def get_channel(self): * cdef c_ssh2.LIBSSH2_CHANNEL *_channel * with nogil: # <<<<<<<<<<<<<< @@ -1891,7 +1872,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_4get_channel(struct __pyx_obj_4ssh2_ } } - /* "ssh2/sftp.pyx":83 + /* "ssh2/sftp.pyx":85 * with nogil: * _channel = c_sftp.libssh2_sftp_get_channel(self._sftp) * if _channel is NULL: # <<<<<<<<<<<<<< @@ -1901,7 +1882,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_4get_channel(struct __pyx_obj_4ssh2_ __pyx_t_1 = ((__pyx_v__channel == NULL) != 0); if (__pyx_t_1) { - /* "ssh2/sftp.pyx":84 + /* "ssh2/sftp.pyx":86 * _channel = c_sftp.libssh2_sftp_get_channel(self._sftp) * if _channel is NULL: * return # <<<<<<<<<<<<<< @@ -1912,7 +1893,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_4get_channel(struct __pyx_obj_4ssh2_ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "ssh2/sftp.pyx":83 + /* "ssh2/sftp.pyx":85 * with nogil: * _channel = c_sftp.libssh2_sftp_get_channel(self._sftp) * if _channel is NULL: # <<<<<<<<<<<<<< @@ -1921,7 +1902,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_4get_channel(struct __pyx_obj_4ssh2_ */ } - /* "ssh2/sftp.pyx":85 + /* "ssh2/sftp.pyx":87 * if _channel is NULL: * return * return PyChannel(_channel, self._session) # <<<<<<<<<<<<<< @@ -1931,14 +1912,14 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_4get_channel(struct __pyx_obj_4ssh2_ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = ((PyObject *)__pyx_v_self->_session); __Pyx_INCREF(__pyx_t_2); - __pyx_t_3 = __pyx_f_4ssh2_7channel_PyChannel(__pyx_v__channel, ((struct __pyx_obj_4ssh2_7session_Session *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 85, __pyx_L1_error) + __pyx_t_3 = __pyx_f_4ssh2_7channel_PyChannel(__pyx_v__channel, ((struct __pyx_obj_4ssh2_7session_Session *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - /* "ssh2/sftp.pyx":79 + /* "ssh2/sftp.pyx":81 * c_sftp.libssh2_sftp_shutdown(self._sftp) * * def get_channel(self): # <<<<<<<<<<<<<< @@ -1958,7 +1939,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_4get_channel(struct __pyx_obj_4ssh2_ return __pyx_r; } -/* "ssh2/sftp.pyx":87 +/* "ssh2/sftp.pyx":89 * return PyChannel(_channel, self._session) * * def open_ex(self, const char *filename, # <<<<<<<<<<<<<< @@ -2007,29 +1988,29 @@ static PyObject *__pyx_pw_4ssh2_4sftp_4SFTP_7open_ex(PyObject *__pyx_v_self, PyO case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_filename_len)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("open_ex", 1, 5, 5, 1); __PYX_ERR(0, 87, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("open_ex", 1, 5, 5, 1); __PYX_ERR(0, 89, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("open_ex", 1, 5, 5, 2); __PYX_ERR(0, 87, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("open_ex", 1, 5, 5, 2); __PYX_ERR(0, 89, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mode)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("open_ex", 1, 5, 5, 3); __PYX_ERR(0, 87, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("open_ex", 1, 5, 5, 3); __PYX_ERR(0, 89, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open_type)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("open_ex", 1, 5, 5, 4); __PYX_ERR(0, 87, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("open_ex", 1, 5, 5, 4); __PYX_ERR(0, 89, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "open_ex") < 0)) __PYX_ERR(0, 87, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "open_ex") < 0)) __PYX_ERR(0, 89, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 5) { goto __pyx_L5_argtuple_error; @@ -2040,15 +2021,15 @@ static PyObject *__pyx_pw_4ssh2_4sftp_4SFTP_7open_ex(PyObject *__pyx_v_self, PyO values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[4] = PyTuple_GET_ITEM(__pyx_args, 4); } - __pyx_v_filename = __Pyx_PyObject_AsString(values[0]); if (unlikely((!__pyx_v_filename) && PyErr_Occurred())) __PYX_ERR(0, 87, __pyx_L3_error) - __pyx_v_filename_len = __Pyx_PyInt_As_unsigned_int(values[1]); if (unlikely((__pyx_v_filename_len == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 88, __pyx_L3_error) - __pyx_v_flags = __Pyx_PyInt_As_unsigned_long(values[2]); if (unlikely((__pyx_v_flags == (unsigned long)-1) && PyErr_Occurred())) __PYX_ERR(0, 89, __pyx_L3_error) - __pyx_v_mode = __Pyx_PyInt_As_long(values[3]); if (unlikely((__pyx_v_mode == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 90, __pyx_L3_error) - __pyx_v_open_type = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_open_type == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 90, __pyx_L3_error) + __pyx_v_filename = __Pyx_PyObject_AsString(values[0]); if (unlikely((!__pyx_v_filename) && PyErr_Occurred())) __PYX_ERR(0, 89, __pyx_L3_error) + __pyx_v_filename_len = __Pyx_PyInt_As_unsigned_int(values[1]); if (unlikely((__pyx_v_filename_len == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 90, __pyx_L3_error) + __pyx_v_flags = __Pyx_PyInt_As_unsigned_long(values[2]); if (unlikely((__pyx_v_flags == (unsigned long)-1) && PyErr_Occurred())) __PYX_ERR(0, 91, __pyx_L3_error) + __pyx_v_mode = __Pyx_PyInt_As_long(values[3]); if (unlikely((__pyx_v_mode == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 92, __pyx_L3_error) + __pyx_v_open_type = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_open_type == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 92, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("open_ex", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 87, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("open_ex", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 89, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.sftp.SFTP.open_ex", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -2070,7 +2051,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_6open_ex(struct __pyx_obj_4ssh2_4sft PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("open_ex", 0); - /* "ssh2/sftp.pyx":93 + /* "ssh2/sftp.pyx":95 * cdef c_sftp.LIBSSH2_SFTP_HANDLE *_handle * cdef SFTPHandle handle * with nogil: # <<<<<<<<<<<<<< @@ -2085,7 +2066,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_6open_ex(struct __pyx_obj_4ssh2_4sft #endif /*try:*/ { - /* "ssh2/sftp.pyx":94 + /* "ssh2/sftp.pyx":96 * cdef SFTPHandle handle * with nogil: * _handle = c_sftp.libssh2_sftp_open_ex( # <<<<<<<<<<<<<< @@ -2095,7 +2076,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_6open_ex(struct __pyx_obj_4ssh2_4sft __pyx_v__handle = libssh2_sftp_open_ex(__pyx_v_self->_sftp, __pyx_v_filename, __pyx_v_filename_len, __pyx_v_flags, __pyx_v_mode, __pyx_v_open_type); } - /* "ssh2/sftp.pyx":93 + /* "ssh2/sftp.pyx":95 * cdef c_sftp.LIBSSH2_SFTP_HANDLE *_handle * cdef SFTPHandle handle * with nogil: # <<<<<<<<<<<<<< @@ -2114,7 +2095,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_6open_ex(struct __pyx_obj_4ssh2_4sft } } - /* "ssh2/sftp.pyx":97 + /* "ssh2/sftp.pyx":99 * self._sftp, filename, filename_len, flags, * mode, open_type) * if _handle is NULL: # <<<<<<<<<<<<<< @@ -2124,7 +2105,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_6open_ex(struct __pyx_obj_4ssh2_4sft __pyx_t_1 = ((__pyx_v__handle == NULL) != 0); if (__pyx_t_1) { - /* "ssh2/sftp.pyx":98 + /* "ssh2/sftp.pyx":100 * mode, open_type) * if _handle is NULL: * return # <<<<<<<<<<<<<< @@ -2135,7 +2116,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_6open_ex(struct __pyx_obj_4ssh2_4sft __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "ssh2/sftp.pyx":97 + /* "ssh2/sftp.pyx":99 * self._sftp, filename, filename_len, flags, * mode, open_type) * if _handle is NULL: # <<<<<<<<<<<<<< @@ -2144,20 +2125,20 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_6open_ex(struct __pyx_obj_4ssh2_4sft */ } - /* "ssh2/sftp.pyx":99 + /* "ssh2/sftp.pyx":101 * if _handle is NULL: * return * handle = PySFTPHandle(_handle, self) # <<<<<<<<<<<<<< * return handle * */ - __pyx_t_2 = __pyx_f_4ssh2_4sftp_PySFTPHandle(__pyx_v__handle, __pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 99, __pyx_L1_error) + __pyx_t_2 = __pyx_f_4ssh2_4sftp_PySFTPHandle(__pyx_v__handle, __pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_4ssh2_4sftp_SFTPHandle))))) __PYX_ERR(0, 99, __pyx_L1_error) + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_4ssh2_4sftp_SFTPHandle))))) __PYX_ERR(0, 101, __pyx_L1_error) __pyx_v_handle = ((struct __pyx_obj_4ssh2_4sftp_SFTPHandle *)__pyx_t_2); __pyx_t_2 = 0; - /* "ssh2/sftp.pyx":100 + /* "ssh2/sftp.pyx":102 * return * handle = PySFTPHandle(_handle, self) * return handle # <<<<<<<<<<<<<< @@ -2169,7 +2150,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_6open_ex(struct __pyx_obj_4ssh2_4sft __pyx_r = ((PyObject *)__pyx_v_handle); goto __pyx_L0; - /* "ssh2/sftp.pyx":87 + /* "ssh2/sftp.pyx":89 * return PyChannel(_channel, self._session) * * def open_ex(self, const char *filename, # <<<<<<<<<<<<<< @@ -2189,7 +2170,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_6open_ex(struct __pyx_obj_4ssh2_4sft return __pyx_r; } -/* "ssh2/sftp.pyx":102 +/* "ssh2/sftp.pyx":104 * return handle * * def open(self, filename not None, # <<<<<<<<<<<<<< @@ -2232,17 +2213,17 @@ static PyObject *__pyx_pw_4ssh2_4sftp_4SFTP_9open(PyObject *__pyx_v_self, PyObje case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("open", 1, 3, 3, 1); __PYX_ERR(0, 102, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("open", 1, 3, 3, 1); __PYX_ERR(0, 104, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mode)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("open", 1, 3, 3, 2); __PYX_ERR(0, 102, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("open", 1, 3, 3, 2); __PYX_ERR(0, 104, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "open") < 0)) __PYX_ERR(0, 102, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "open") < 0)) __PYX_ERR(0, 104, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -2252,19 +2233,19 @@ static PyObject *__pyx_pw_4ssh2_4sftp_4SFTP_9open(PyObject *__pyx_v_self, PyObje values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_filename = values[0]; - __pyx_v_flags = __Pyx_PyInt_As_unsigned_long(values[1]); if (unlikely((__pyx_v_flags == (unsigned long)-1) && PyErr_Occurred())) __PYX_ERR(0, 103, __pyx_L3_error) - __pyx_v_mode = __Pyx_PyInt_As_long(values[2]); if (unlikely((__pyx_v_mode == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 104, __pyx_L3_error) + __pyx_v_flags = __Pyx_PyInt_As_unsigned_long(values[1]); if (unlikely((__pyx_v_flags == (unsigned long)-1) && PyErr_Occurred())) __PYX_ERR(0, 105, __pyx_L3_error) + __pyx_v_mode = __Pyx_PyInt_As_long(values[2]); if (unlikely((__pyx_v_mode == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 106, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("open", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 102, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("open", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 104, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.sftp.SFTP.open", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(((PyObject *)__pyx_v_filename) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "filename"); __PYX_ERR(0, 102, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "filename"); __PYX_ERR(0, 104, __pyx_L1_error) } __pyx_r = __pyx_pf_4ssh2_4sftp_4SFTP_8open(((struct __pyx_obj_4ssh2_4sftp_SFTP *)__pyx_v_self), __pyx_v_filename, __pyx_v_flags, __pyx_v_mode); @@ -2287,7 +2268,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_8open(struct __pyx_obj_4ssh2_4sftp_S PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("open", 0); - /* "ssh2/sftp.pyx":121 + /* "ssh2/sftp.pyx":123 * cdef c_sftp.LIBSSH2_SFTP_HANDLE *_handle * cdef SFTPHandle handle * cdef char *_filename = to_bytes(filename) # <<<<<<<<<<<<<< @@ -2296,7 +2277,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_8open(struct __pyx_obj_4ssh2_4sftp_S */ __pyx_v__filename = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_filename); - /* "ssh2/sftp.pyx":122 + /* "ssh2/sftp.pyx":124 * cdef SFTPHandle handle * cdef char *_filename = to_bytes(filename) * with nogil: # <<<<<<<<<<<<<< @@ -2311,7 +2292,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_8open(struct __pyx_obj_4ssh2_4sftp_S #endif /*try:*/ { - /* "ssh2/sftp.pyx":123 + /* "ssh2/sftp.pyx":125 * cdef char *_filename = to_bytes(filename) * with nogil: * _handle = c_sftp.libssh2_sftp_open( # <<<<<<<<<<<<<< @@ -2321,7 +2302,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_8open(struct __pyx_obj_4ssh2_4sftp_S __pyx_v__handle = libssh2_sftp_open(__pyx_v_self->_sftp, __pyx_v__filename, __pyx_v_flags, __pyx_v_mode); } - /* "ssh2/sftp.pyx":122 + /* "ssh2/sftp.pyx":124 * cdef SFTPHandle handle * cdef char *_filename = to_bytes(filename) * with nogil: # <<<<<<<<<<<<<< @@ -2340,7 +2321,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_8open(struct __pyx_obj_4ssh2_4sftp_S } } - /* "ssh2/sftp.pyx":125 + /* "ssh2/sftp.pyx":127 * _handle = c_sftp.libssh2_sftp_open( * self._sftp, _filename, flags, mode) * if _handle is NULL: # <<<<<<<<<<<<<< @@ -2350,7 +2331,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_8open(struct __pyx_obj_4ssh2_4sftp_S __pyx_t_1 = ((__pyx_v__handle == NULL) != 0); if (__pyx_t_1) { - /* "ssh2/sftp.pyx":126 + /* "ssh2/sftp.pyx":128 * self._sftp, _filename, flags, mode) * if _handle is NULL: * return # <<<<<<<<<<<<<< @@ -2361,7 +2342,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_8open(struct __pyx_obj_4ssh2_4sftp_S __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "ssh2/sftp.pyx":125 + /* "ssh2/sftp.pyx":127 * _handle = c_sftp.libssh2_sftp_open( * self._sftp, _filename, flags, mode) * if _handle is NULL: # <<<<<<<<<<<<<< @@ -2370,20 +2351,20 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_8open(struct __pyx_obj_4ssh2_4sftp_S */ } - /* "ssh2/sftp.pyx":127 + /* "ssh2/sftp.pyx":129 * if _handle is NULL: * return * handle = PySFTPHandle(_handle, self) # <<<<<<<<<<<<<< * return handle * */ - __pyx_t_2 = __pyx_f_4ssh2_4sftp_PySFTPHandle(__pyx_v__handle, __pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 127, __pyx_L1_error) + __pyx_t_2 = __pyx_f_4ssh2_4sftp_PySFTPHandle(__pyx_v__handle, __pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_4ssh2_4sftp_SFTPHandle))))) __PYX_ERR(0, 127, __pyx_L1_error) + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_4ssh2_4sftp_SFTPHandle))))) __PYX_ERR(0, 129, __pyx_L1_error) __pyx_v_handle = ((struct __pyx_obj_4ssh2_4sftp_SFTPHandle *)__pyx_t_2); __pyx_t_2 = 0; - /* "ssh2/sftp.pyx":128 + /* "ssh2/sftp.pyx":130 * return * handle = PySFTPHandle(_handle, self) * return handle # <<<<<<<<<<<<<< @@ -2395,7 +2376,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_8open(struct __pyx_obj_4ssh2_4sftp_S __pyx_r = ((PyObject *)__pyx_v_handle); goto __pyx_L0; - /* "ssh2/sftp.pyx":102 + /* "ssh2/sftp.pyx":104 * return handle * * def open(self, filename not None, # <<<<<<<<<<<<<< @@ -2415,7 +2396,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_8open(struct __pyx_obj_4ssh2_4sftp_S return __pyx_r; } -/* "ssh2/sftp.pyx":130 +/* "ssh2/sftp.pyx":132 * return handle * * def opendir(self, path not None): # <<<<<<<<<<<<<< @@ -2431,7 +2412,7 @@ static PyObject *__pyx_pw_4ssh2_4sftp_4SFTP_11opendir(PyObject *__pyx_v_self, Py __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("opendir (wrapper)", 0); if (unlikely(((PyObject *)__pyx_v_path) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "path"); __PYX_ERR(0, 130, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "path"); __PYX_ERR(0, 132, __pyx_L1_error) } __pyx_r = __pyx_pf_4ssh2_4sftp_4SFTP_10opendir(((struct __pyx_obj_4ssh2_4sftp_SFTP *)__pyx_v_self), ((PyObject *)__pyx_v_path)); @@ -2453,7 +2434,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_10opendir(struct __pyx_obj_4ssh2_4sf PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("opendir", 0); - /* "ssh2/sftp.pyx":138 + /* "ssh2/sftp.pyx":140 * :rtype: :py:class:`ssh2.sftp.SFTPHandle` or `None`""" * cdef c_sftp.LIBSSH2_SFTP_HANDLE *_handle * cdef char *_path = to_bytes(path) # <<<<<<<<<<<<<< @@ -2462,7 +2443,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_10opendir(struct __pyx_obj_4ssh2_4sf */ __pyx_v__path = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_path); - /* "ssh2/sftp.pyx":139 + /* "ssh2/sftp.pyx":141 * cdef c_sftp.LIBSSH2_SFTP_HANDLE *_handle * cdef char *_path = to_bytes(path) * with nogil: # <<<<<<<<<<<<<< @@ -2477,7 +2458,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_10opendir(struct __pyx_obj_4ssh2_4sf #endif /*try:*/ { - /* "ssh2/sftp.pyx":140 + /* "ssh2/sftp.pyx":142 * cdef char *_path = to_bytes(path) * with nogil: * _handle = c_sftp.libssh2_sftp_opendir(self._sftp, _path) # <<<<<<<<<<<<<< @@ -2487,7 +2468,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_10opendir(struct __pyx_obj_4ssh2_4sf __pyx_v__handle = libssh2_sftp_opendir(__pyx_v_self->_sftp, __pyx_v__path); } - /* "ssh2/sftp.pyx":139 + /* "ssh2/sftp.pyx":141 * cdef c_sftp.LIBSSH2_SFTP_HANDLE *_handle * cdef char *_path = to_bytes(path) * with nogil: # <<<<<<<<<<<<<< @@ -2506,7 +2487,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_10opendir(struct __pyx_obj_4ssh2_4sf } } - /* "ssh2/sftp.pyx":141 + /* "ssh2/sftp.pyx":143 * with nogil: * _handle = c_sftp.libssh2_sftp_opendir(self._sftp, _path) * if _handle is NULL: # <<<<<<<<<<<<<< @@ -2516,7 +2497,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_10opendir(struct __pyx_obj_4ssh2_4sf __pyx_t_1 = ((__pyx_v__handle == NULL) != 0); if (__pyx_t_1) { - /* "ssh2/sftp.pyx":142 + /* "ssh2/sftp.pyx":144 * _handle = c_sftp.libssh2_sftp_opendir(self._sftp, _path) * if _handle is NULL: * return # <<<<<<<<<<<<<< @@ -2527,7 +2508,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_10opendir(struct __pyx_obj_4ssh2_4sf __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "ssh2/sftp.pyx":141 + /* "ssh2/sftp.pyx":143 * with nogil: * _handle = c_sftp.libssh2_sftp_opendir(self._sftp, _path) * if _handle is NULL: # <<<<<<<<<<<<<< @@ -2536,7 +2517,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_10opendir(struct __pyx_obj_4ssh2_4sf */ } - /* "ssh2/sftp.pyx":143 + /* "ssh2/sftp.pyx":145 * if _handle is NULL: * return * return PySFTPHandle(_handle, self) # <<<<<<<<<<<<<< @@ -2544,13 +2525,13 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_10opendir(struct __pyx_obj_4ssh2_4sf * def rename_ex(self, const char *source_filename, */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __pyx_f_4ssh2_4sftp_PySFTPHandle(__pyx_v__handle, __pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 143, __pyx_L1_error) + __pyx_t_2 = __pyx_f_4ssh2_4sftp_PySFTPHandle(__pyx_v__handle, __pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "ssh2/sftp.pyx":130 + /* "ssh2/sftp.pyx":132 * return handle * * def opendir(self, path not None): # <<<<<<<<<<<<<< @@ -2569,7 +2550,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_10opendir(struct __pyx_obj_4ssh2_4sf return __pyx_r; } -/* "ssh2/sftp.pyx":145 +/* "ssh2/sftp.pyx":147 * return PySFTPHandle(_handle, self) * * def rename_ex(self, const char *source_filename, # <<<<<<<<<<<<<< @@ -2618,29 +2599,29 @@ static PyObject *__pyx_pw_4ssh2_4sftp_4SFTP_13rename_ex(PyObject *__pyx_v_self, case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_source_filename_len)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("rename_ex", 1, 5, 5, 1); __PYX_ERR(0, 145, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("rename_ex", 1, 5, 5, 1); __PYX_ERR(0, 147, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dest_filename)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("rename_ex", 1, 5, 5, 2); __PYX_ERR(0, 145, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("rename_ex", 1, 5, 5, 2); __PYX_ERR(0, 147, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dest_filename_len)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("rename_ex", 1, 5, 5, 3); __PYX_ERR(0, 145, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("rename_ex", 1, 5, 5, 3); __PYX_ERR(0, 147, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("rename_ex", 1, 5, 5, 4); __PYX_ERR(0, 145, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("rename_ex", 1, 5, 5, 4); __PYX_ERR(0, 147, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "rename_ex") < 0)) __PYX_ERR(0, 145, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "rename_ex") < 0)) __PYX_ERR(0, 147, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 5) { goto __pyx_L5_argtuple_error; @@ -2651,15 +2632,15 @@ static PyObject *__pyx_pw_4ssh2_4sftp_4SFTP_13rename_ex(PyObject *__pyx_v_self, values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[4] = PyTuple_GET_ITEM(__pyx_args, 4); } - __pyx_v_source_filename = __Pyx_PyObject_AsString(values[0]); if (unlikely((!__pyx_v_source_filename) && PyErr_Occurred())) __PYX_ERR(0, 145, __pyx_L3_error) - __pyx_v_source_filename_len = __Pyx_PyInt_As_unsigned_int(values[1]); if (unlikely((__pyx_v_source_filename_len == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 146, __pyx_L3_error) - __pyx_v_dest_filename = __Pyx_PyObject_AsString(values[2]); if (unlikely((!__pyx_v_dest_filename) && PyErr_Occurred())) __PYX_ERR(0, 147, __pyx_L3_error) - __pyx_v_dest_filename_len = __Pyx_PyInt_As_unsigned_int(values[3]); if (unlikely((__pyx_v_dest_filename_len == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 148, __pyx_L3_error) - __pyx_v_flags = __Pyx_PyInt_As_long(values[4]); if (unlikely((__pyx_v_flags == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 149, __pyx_L3_error) + __pyx_v_source_filename = __Pyx_PyObject_AsString(values[0]); if (unlikely((!__pyx_v_source_filename) && PyErr_Occurred())) __PYX_ERR(0, 147, __pyx_L3_error) + __pyx_v_source_filename_len = __Pyx_PyInt_As_unsigned_int(values[1]); if (unlikely((__pyx_v_source_filename_len == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 148, __pyx_L3_error) + __pyx_v_dest_filename = __Pyx_PyObject_AsString(values[2]); if (unlikely((!__pyx_v_dest_filename) && PyErr_Occurred())) __PYX_ERR(0, 149, __pyx_L3_error) + __pyx_v_dest_filename_len = __Pyx_PyInt_As_unsigned_int(values[3]); if (unlikely((__pyx_v_dest_filename_len == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 150, __pyx_L3_error) + __pyx_v_flags = __Pyx_PyInt_As_long(values[4]); if (unlikely((__pyx_v_flags == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 151, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("rename_ex", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 145, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("rename_ex", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 147, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.sftp.SFTP.rename_ex", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -2679,7 +2660,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_12rename_ex(struct __pyx_obj_4ssh2_4 PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("rename_ex", 0); - /* "ssh2/sftp.pyx":151 + /* "ssh2/sftp.pyx":153 * long flags): * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -2694,7 +2675,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_12rename_ex(struct __pyx_obj_4ssh2_4 #endif /*try:*/ { - /* "ssh2/sftp.pyx":152 + /* "ssh2/sftp.pyx":154 * cdef int rc * with nogil: * rc = c_sftp.libssh2_sftp_rename_ex( # <<<<<<<<<<<<<< @@ -2704,7 +2685,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_12rename_ex(struct __pyx_obj_4ssh2_4 __pyx_v_rc = libssh2_sftp_rename_ex(__pyx_v_self->_sftp, __pyx_v_source_filename, __pyx_v_source_filename_len, __pyx_v_dest_filename, __pyx_v_dest_filename_len, __pyx_v_flags); } - /* "ssh2/sftp.pyx":151 + /* "ssh2/sftp.pyx":153 * long flags): * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -2723,7 +2704,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_12rename_ex(struct __pyx_obj_4ssh2_4 } } - /* "ssh2/sftp.pyx":155 + /* "ssh2/sftp.pyx":157 * self._sftp, source_filename, source_filename_len, * dest_filename, dest_filename_len, flags) * return rc # <<<<<<<<<<<<<< @@ -2731,13 +2712,13 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_12rename_ex(struct __pyx_obj_4ssh2_4 * def rename(self, source_filename not None, dest_filename not None): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 155, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/sftp.pyx":145 + /* "ssh2/sftp.pyx":147 * return PySFTPHandle(_handle, self) * * def rename_ex(self, const char *source_filename, # <<<<<<<<<<<<<< @@ -2756,7 +2737,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_12rename_ex(struct __pyx_obj_4ssh2_4 return __pyx_r; } -/* "ssh2/sftp.pyx":157 +/* "ssh2/sftp.pyx":159 * return rc * * def rename(self, source_filename not None, dest_filename not None): # <<<<<<<<<<<<<< @@ -2796,11 +2777,11 @@ static PyObject *__pyx_pw_4ssh2_4sftp_4SFTP_15rename(PyObject *__pyx_v_self, PyO case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dest_filename)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("rename", 1, 2, 2, 1); __PYX_ERR(0, 157, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("rename", 1, 2, 2, 1); __PYX_ERR(0, 159, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "rename") < 0)) __PYX_ERR(0, 157, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "rename") < 0)) __PYX_ERR(0, 159, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -2813,17 +2794,17 @@ static PyObject *__pyx_pw_4ssh2_4sftp_4SFTP_15rename(PyObject *__pyx_v_self, PyO } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("rename", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 157, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("rename", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 159, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.sftp.SFTP.rename", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(((PyObject *)__pyx_v_source_filename) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "source_filename"); __PYX_ERR(0, 157, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "source_filename"); __PYX_ERR(0, 159, __pyx_L1_error) } if (unlikely(((PyObject *)__pyx_v_dest_filename) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "dest_filename"); __PYX_ERR(0, 157, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "dest_filename"); __PYX_ERR(0, 159, __pyx_L1_error) } __pyx_r = __pyx_pf_4ssh2_4sftp_4SFTP_14rename(((struct __pyx_obj_4ssh2_4sftp_SFTP *)__pyx_v_self), __pyx_v_source_filename, __pyx_v_dest_filename); @@ -2845,7 +2826,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_14rename(struct __pyx_obj_4ssh2_4sft PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("rename", 0); - /* "ssh2/sftp.pyx":165 + /* "ssh2/sftp.pyx":167 * :type dest_filename: str""" * cdef int rc * cdef char *_source_filename = to_bytes(source_filename) # <<<<<<<<<<<<<< @@ -2854,7 +2835,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_14rename(struct __pyx_obj_4ssh2_4sft */ __pyx_v__source_filename = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_source_filename); - /* "ssh2/sftp.pyx":166 + /* "ssh2/sftp.pyx":168 * cdef int rc * cdef char *_source_filename = to_bytes(source_filename) * cdef char *_dest_filename = to_bytes(dest_filename) # <<<<<<<<<<<<<< @@ -2863,7 +2844,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_14rename(struct __pyx_obj_4ssh2_4sft */ __pyx_v__dest_filename = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_dest_filename); - /* "ssh2/sftp.pyx":167 + /* "ssh2/sftp.pyx":169 * cdef char *_source_filename = to_bytes(source_filename) * cdef char *_dest_filename = to_bytes(dest_filename) * with nogil: # <<<<<<<<<<<<<< @@ -2878,7 +2859,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_14rename(struct __pyx_obj_4ssh2_4sft #endif /*try:*/ { - /* "ssh2/sftp.pyx":168 + /* "ssh2/sftp.pyx":170 * cdef char *_dest_filename = to_bytes(dest_filename) * with nogil: * rc = c_sftp.libssh2_sftp_rename( # <<<<<<<<<<<<<< @@ -2888,7 +2869,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_14rename(struct __pyx_obj_4ssh2_4sft __pyx_v_rc = libssh2_sftp_rename(__pyx_v_self->_sftp, __pyx_v__source_filename, __pyx_v__dest_filename); } - /* "ssh2/sftp.pyx":167 + /* "ssh2/sftp.pyx":169 * cdef char *_source_filename = to_bytes(source_filename) * cdef char *_dest_filename = to_bytes(dest_filename) * with nogil: # <<<<<<<<<<<<<< @@ -2907,7 +2888,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_14rename(struct __pyx_obj_4ssh2_4sft } } - /* "ssh2/sftp.pyx":170 + /* "ssh2/sftp.pyx":172 * rc = c_sftp.libssh2_sftp_rename( * self._sftp, _source_filename, _dest_filename) * return rc # <<<<<<<<<<<<<< @@ -2915,13 +2896,13 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_14rename(struct __pyx_obj_4ssh2_4sft * def unlink(self, filename not None): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 170, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/sftp.pyx":157 + /* "ssh2/sftp.pyx":159 * return rc * * def rename(self, source_filename not None, dest_filename not None): # <<<<<<<<<<<<<< @@ -2940,7 +2921,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_14rename(struct __pyx_obj_4ssh2_4sft return __pyx_r; } -/* "ssh2/sftp.pyx":172 +/* "ssh2/sftp.pyx":174 * return rc * * def unlink(self, filename not None): # <<<<<<<<<<<<<< @@ -2956,7 +2937,7 @@ static PyObject *__pyx_pw_4ssh2_4sftp_4SFTP_17unlink(PyObject *__pyx_v_self, PyO __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("unlink (wrapper)", 0); if (unlikely(((PyObject *)__pyx_v_filename) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "filename"); __PYX_ERR(0, 172, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "filename"); __PYX_ERR(0, 174, __pyx_L1_error) } __pyx_r = __pyx_pf_4ssh2_4sftp_4SFTP_16unlink(((struct __pyx_obj_4ssh2_4sftp_SFTP *)__pyx_v_self), ((PyObject *)__pyx_v_filename)); @@ -2977,7 +2958,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_16unlink(struct __pyx_obj_4ssh2_4sft PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("unlink", 0); - /* "ssh2/sftp.pyx":178 + /* "ssh2/sftp.pyx":180 * :type filename: str""" * cdef int rc * cdef char *_filename = to_bytes(filename) # <<<<<<<<<<<<<< @@ -2986,7 +2967,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_16unlink(struct __pyx_obj_4ssh2_4sft */ __pyx_v__filename = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_filename); - /* "ssh2/sftp.pyx":179 + /* "ssh2/sftp.pyx":181 * cdef int rc * cdef char *_filename = to_bytes(filename) * with nogil: # <<<<<<<<<<<<<< @@ -3001,7 +2982,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_16unlink(struct __pyx_obj_4ssh2_4sft #endif /*try:*/ { - /* "ssh2/sftp.pyx":180 + /* "ssh2/sftp.pyx":182 * cdef char *_filename = to_bytes(filename) * with nogil: * rc = c_sftp.libssh2_sftp_unlink(self._sftp, _filename) # <<<<<<<<<<<<<< @@ -3011,7 +2992,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_16unlink(struct __pyx_obj_4ssh2_4sft __pyx_v_rc = libssh2_sftp_unlink(__pyx_v_self->_sftp, __pyx_v__filename); } - /* "ssh2/sftp.pyx":179 + /* "ssh2/sftp.pyx":181 * cdef int rc * cdef char *_filename = to_bytes(filename) * with nogil: # <<<<<<<<<<<<<< @@ -3030,7 +3011,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_16unlink(struct __pyx_obj_4ssh2_4sft } } - /* "ssh2/sftp.pyx":181 + /* "ssh2/sftp.pyx":183 * with nogil: * rc = c_sftp.libssh2_sftp_unlink(self._sftp, _filename) * return rc # <<<<<<<<<<<<<< @@ -3038,13 +3019,13 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_16unlink(struct __pyx_obj_4ssh2_4sft * def fstatvfs(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 181, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/sftp.pyx":172 + /* "ssh2/sftp.pyx":174 * return rc * * def unlink(self, filename not None): # <<<<<<<<<<<<<< @@ -3063,7 +3044,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_16unlink(struct __pyx_obj_4ssh2_4sft return __pyx_r; } -/* "ssh2/sftp.pyx":183 +/* "ssh2/sftp.pyx":185 * return rc * * def fstatvfs(self): # <<<<<<<<<<<<<< @@ -3090,7 +3071,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_18fstatvfs(CYTHON_UNUSED struct __py __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("fstatvfs", 0); - /* "ssh2/sftp.pyx":184 + /* "ssh2/sftp.pyx":186 * * def fstatvfs(self): * raise NotImplementedError # <<<<<<<<<<<<<< @@ -3098,9 +3079,9 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_18fstatvfs(CYTHON_UNUSED struct __py * def statvfs(self): */ __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); - __PYX_ERR(0, 184, __pyx_L1_error) + __PYX_ERR(0, 186, __pyx_L1_error) - /* "ssh2/sftp.pyx":183 + /* "ssh2/sftp.pyx":185 * return rc * * def fstatvfs(self): # <<<<<<<<<<<<<< @@ -3117,7 +3098,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_18fstatvfs(CYTHON_UNUSED struct __py return __pyx_r; } -/* "ssh2/sftp.pyx":186 +/* "ssh2/sftp.pyx":188 * raise NotImplementedError * * def statvfs(self): # <<<<<<<<<<<<<< @@ -3144,7 +3125,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_20statvfs(CYTHON_UNUSED struct __pyx __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("statvfs", 0); - /* "ssh2/sftp.pyx":187 + /* "ssh2/sftp.pyx":189 * * def statvfs(self): * raise NotImplementedError # <<<<<<<<<<<<<< @@ -3152,9 +3133,9 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_20statvfs(CYTHON_UNUSED struct __pyx * def mkdir(self, path not None, long mode): */ __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); - __PYX_ERR(0, 187, __pyx_L1_error) + __PYX_ERR(0, 189, __pyx_L1_error) - /* "ssh2/sftp.pyx":186 + /* "ssh2/sftp.pyx":188 * raise NotImplementedError * * def statvfs(self): # <<<<<<<<<<<<<< @@ -3171,7 +3152,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_20statvfs(CYTHON_UNUSED struct __pyx return __pyx_r; } -/* "ssh2/sftp.pyx":189 +/* "ssh2/sftp.pyx":191 * raise NotImplementedError * * def mkdir(self, path not None, long mode): # <<<<<<<<<<<<<< @@ -3211,11 +3192,11 @@ static PyObject *__pyx_pw_4ssh2_4sftp_4SFTP_23mkdir(PyObject *__pyx_v_self, PyOb case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mode)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("mkdir", 1, 2, 2, 1); __PYX_ERR(0, 189, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("mkdir", 1, 2, 2, 1); __PYX_ERR(0, 191, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "mkdir") < 0)) __PYX_ERR(0, 189, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "mkdir") < 0)) __PYX_ERR(0, 191, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -3224,18 +3205,18 @@ static PyObject *__pyx_pw_4ssh2_4sftp_4SFTP_23mkdir(PyObject *__pyx_v_self, PyOb values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_path = values[0]; - __pyx_v_mode = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v_mode == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 189, __pyx_L3_error) + __pyx_v_mode = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v_mode == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 191, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("mkdir", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 189, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("mkdir", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 191, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.sftp.SFTP.mkdir", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(((PyObject *)__pyx_v_path) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "path"); __PYX_ERR(0, 189, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "path"); __PYX_ERR(0, 191, __pyx_L1_error) } __pyx_r = __pyx_pf_4ssh2_4sftp_4SFTP_22mkdir(((struct __pyx_obj_4ssh2_4sftp_SFTP *)__pyx_v_self), __pyx_v_path, __pyx_v_mode); @@ -3257,17 +3238,17 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_22mkdir(struct __pyx_obj_4ssh2_4sftp PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("mkdir", 0); - /* "ssh2/sftp.pyx":199 + /* "ssh2/sftp.pyx":201 * :rtype: int""" * cdef int rc * cdef char *_path = path # <<<<<<<<<<<<<< * with nogil: * rc = c_sftp.libssh2_sftp_mkdir(self._sftp, _path, mode) */ - __pyx_t_1 = __Pyx_PyObject_AsWritableString(__pyx_v_path); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(0, 199, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_AsWritableString(__pyx_v_path); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(0, 201, __pyx_L1_error) __pyx_v__path = __pyx_t_1; - /* "ssh2/sftp.pyx":200 + /* "ssh2/sftp.pyx":202 * cdef int rc * cdef char *_path = path * with nogil: # <<<<<<<<<<<<<< @@ -3282,7 +3263,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_22mkdir(struct __pyx_obj_4ssh2_4sftp #endif /*try:*/ { - /* "ssh2/sftp.pyx":201 + /* "ssh2/sftp.pyx":203 * cdef char *_path = path * with nogil: * rc = c_sftp.libssh2_sftp_mkdir(self._sftp, _path, mode) # <<<<<<<<<<<<<< @@ -3292,7 +3273,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_22mkdir(struct __pyx_obj_4ssh2_4sftp __pyx_v_rc = libssh2_sftp_mkdir(__pyx_v_self->_sftp, __pyx_v__path, __pyx_v_mode); } - /* "ssh2/sftp.pyx":200 + /* "ssh2/sftp.pyx":202 * cdef int rc * cdef char *_path = path * with nogil: # <<<<<<<<<<<<<< @@ -3311,7 +3292,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_22mkdir(struct __pyx_obj_4ssh2_4sftp } } - /* "ssh2/sftp.pyx":202 + /* "ssh2/sftp.pyx":204 * with nogil: * rc = c_sftp.libssh2_sftp_mkdir(self._sftp, _path, mode) * return rc # <<<<<<<<<<<<<< @@ -3319,13 +3300,13 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_22mkdir(struct __pyx_obj_4ssh2_4sftp * def rmdir(self, path not None): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 202, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "ssh2/sftp.pyx":189 + /* "ssh2/sftp.pyx":191 * raise NotImplementedError * * def mkdir(self, path not None, long mode): # <<<<<<<<<<<<<< @@ -3344,7 +3325,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_22mkdir(struct __pyx_obj_4ssh2_4sftp return __pyx_r; } -/* "ssh2/sftp.pyx":204 +/* "ssh2/sftp.pyx":206 * return rc * * def rmdir(self, path not None): # <<<<<<<<<<<<<< @@ -3360,7 +3341,7 @@ static PyObject *__pyx_pw_4ssh2_4sftp_4SFTP_25rmdir(PyObject *__pyx_v_self, PyOb __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("rmdir (wrapper)", 0); if (unlikely(((PyObject *)__pyx_v_path) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "path"); __PYX_ERR(0, 204, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "path"); __PYX_ERR(0, 206, __pyx_L1_error) } __pyx_r = __pyx_pf_4ssh2_4sftp_4SFTP_24rmdir(((struct __pyx_obj_4ssh2_4sftp_SFTP *)__pyx_v_self), ((PyObject *)__pyx_v_path)); @@ -3381,7 +3362,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_24rmdir(struct __pyx_obj_4ssh2_4sftp PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("rmdir", 0); - /* "ssh2/sftp.pyx":212 + /* "ssh2/sftp.pyx":214 * :rtype: int""" * cdef int rc * cdef char *_path = to_bytes(path) # <<<<<<<<<<<<<< @@ -3390,7 +3371,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_24rmdir(struct __pyx_obj_4ssh2_4sftp */ __pyx_v__path = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_path); - /* "ssh2/sftp.pyx":213 + /* "ssh2/sftp.pyx":215 * cdef int rc * cdef char *_path = to_bytes(path) * with nogil: # <<<<<<<<<<<<<< @@ -3405,7 +3386,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_24rmdir(struct __pyx_obj_4ssh2_4sftp #endif /*try:*/ { - /* "ssh2/sftp.pyx":214 + /* "ssh2/sftp.pyx":216 * cdef char *_path = to_bytes(path) * with nogil: * rc = c_sftp.libssh2_sftp_rmdir(self._sftp, _path) # <<<<<<<<<<<<<< @@ -3415,7 +3396,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_24rmdir(struct __pyx_obj_4ssh2_4sftp __pyx_v_rc = libssh2_sftp_rmdir(__pyx_v_self->_sftp, __pyx_v__path); } - /* "ssh2/sftp.pyx":213 + /* "ssh2/sftp.pyx":215 * cdef int rc * cdef char *_path = to_bytes(path) * with nogil: # <<<<<<<<<<<<<< @@ -3434,7 +3415,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_24rmdir(struct __pyx_obj_4ssh2_4sftp } } - /* "ssh2/sftp.pyx":215 + /* "ssh2/sftp.pyx":217 * with nogil: * rc = c_sftp.libssh2_sftp_rmdir(self._sftp, _path) * return rc # <<<<<<<<<<<<<< @@ -3442,13 +3423,13 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_24rmdir(struct __pyx_obj_4ssh2_4sftp * def stat(self, path not None): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 215, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/sftp.pyx":204 + /* "ssh2/sftp.pyx":206 * return rc * * def rmdir(self, path not None): # <<<<<<<<<<<<<< @@ -3467,7 +3448,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_24rmdir(struct __pyx_obj_4ssh2_4sftp return __pyx_r; } -/* "ssh2/sftp.pyx":217 +/* "ssh2/sftp.pyx":219 * return rc * * def stat(self, path not None): # <<<<<<<<<<<<<< @@ -3483,7 +3464,7 @@ static PyObject *__pyx_pw_4ssh2_4sftp_4SFTP_27stat(PyObject *__pyx_v_self, PyObj __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("stat (wrapper)", 0); if (unlikely(((PyObject *)__pyx_v_path) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "path"); __PYX_ERR(0, 217, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "path"); __PYX_ERR(0, 219, __pyx_L1_error) } __pyx_r = __pyx_pf_4ssh2_4sftp_4SFTP_26stat(((struct __pyx_obj_4ssh2_4sftp_SFTP *)__pyx_v_self), ((PyObject *)__pyx_v_path)); @@ -3508,7 +3489,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_26stat(struct __pyx_obj_4ssh2_4sftp_ PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("stat", 0); - /* "ssh2/sftp.pyx":225 + /* "ssh2/sftp.pyx":227 * :rtype: :py:class:`ssh2.sftp.SFTPAttributes` or LIBSSH2_ERROR_EAGAIN""" * cdef int rc * cdef char *_path = to_bytes(path) # <<<<<<<<<<<<<< @@ -3517,19 +3498,19 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_26stat(struct __pyx_obj_4ssh2_4sftp_ */ __pyx_v__path = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_path); - /* "ssh2/sftp.pyx":226 + /* "ssh2/sftp.pyx":228 * cdef int rc * cdef char *_path = to_bytes(path) * cdef SFTPAttributes attrs = SFTPAttributes() # <<<<<<<<<<<<<< * with nogil: * rc = c_sftp.libssh2_sftp_stat( */ - __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4ssh2_4sftp_SFTPAttributes), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 226, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4ssh2_4sftp_SFTPAttributes), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_attrs = ((struct __pyx_obj_4ssh2_4sftp_SFTPAttributes *)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/sftp.pyx":227 + /* "ssh2/sftp.pyx":229 * cdef char *_path = to_bytes(path) * cdef SFTPAttributes attrs = SFTPAttributes() * with nogil: # <<<<<<<<<<<<<< @@ -3544,7 +3525,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_26stat(struct __pyx_obj_4ssh2_4sftp_ #endif /*try:*/ { - /* "ssh2/sftp.pyx":228 + /* "ssh2/sftp.pyx":230 * cdef SFTPAttributes attrs = SFTPAttributes() * with nogil: * rc = c_sftp.libssh2_sftp_stat( # <<<<<<<<<<<<<< @@ -3553,7 +3534,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_26stat(struct __pyx_obj_4ssh2_4sftp_ */ __pyx_v_rc = libssh2_sftp_stat(__pyx_v_self->_sftp, __pyx_v__path, __pyx_v_attrs->_attrs); - /* "ssh2/sftp.pyx":230 + /* "ssh2/sftp.pyx":232 * rc = c_sftp.libssh2_sftp_stat( * self._sftp, _path, attrs._attrs) * if rc != c_ssh2._LIBSSH2_ERROR_EAGAIN and rc != 0: # <<<<<<<<<<<<<< @@ -3571,7 +3552,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_26stat(struct __pyx_obj_4ssh2_4sftp_ __pyx_L7_bool_binop_done:; if (__pyx_t_2) { - /* "ssh2/sftp.pyx":231 + /* "ssh2/sftp.pyx":233 * self._sftp, _path, attrs._attrs) * if rc != c_ssh2._LIBSSH2_ERROR_EAGAIN and rc != 0: * with gil: # <<<<<<<<<<<<<< @@ -3584,24 +3565,24 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_26stat(struct __pyx_obj_4ssh2_4sftp_ #endif /*try:*/ { - /* "ssh2/sftp.pyx":234 + /* "ssh2/sftp.pyx":236 * raise SFTPHandleError( * "Error with stat on file %s - code %s", * path, rc) # <<<<<<<<<<<<<< * if rc == c_ssh2._LIBSSH2_ERROR_EAGAIN: * return rc */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L10_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 236, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_1); - /* "ssh2/sftp.pyx":232 + /* "ssh2/sftp.pyx":234 * if rc != c_ssh2._LIBSSH2_ERROR_EAGAIN and rc != 0: * with gil: * raise SFTPHandleError( # <<<<<<<<<<<<<< * "Error with stat on file %s - code %s", * path, rc) */ - __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 232, __pyx_L10_error) + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 234, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_kp_s_Error_with_stat_on_file_s_code_s); __Pyx_GIVEREF(__pyx_kp_s_Error_with_stat_on_file_s_code_s); @@ -3612,15 +3593,15 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_26stat(struct __pyx_obj_4ssh2_4sftp_ __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4ssh2_10exceptions_SFTPHandleError), __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 232, __pyx_L10_error) + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4ssh2_10exceptions_SFTPHandleError), __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 232, __pyx_L10_error) + __PYX_ERR(0, 234, __pyx_L10_error) } - /* "ssh2/sftp.pyx":231 + /* "ssh2/sftp.pyx":233 * self._sftp, _path, attrs._attrs) * if rc != c_ssh2._LIBSSH2_ERROR_EAGAIN and rc != 0: * with gil: # <<<<<<<<<<<<<< @@ -3637,7 +3618,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_26stat(struct __pyx_obj_4ssh2_4sftp_ } } - /* "ssh2/sftp.pyx":230 + /* "ssh2/sftp.pyx":232 * rc = c_sftp.libssh2_sftp_stat( * self._sftp, _path, attrs._attrs) * if rc != c_ssh2._LIBSSH2_ERROR_EAGAIN and rc != 0: # <<<<<<<<<<<<<< @@ -3647,7 +3628,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_26stat(struct __pyx_obj_4ssh2_4sftp_ } } - /* "ssh2/sftp.pyx":227 + /* "ssh2/sftp.pyx":229 * cdef char *_path = to_bytes(path) * cdef SFTPAttributes attrs = SFTPAttributes() * with nogil: # <<<<<<<<<<<<<< @@ -3673,7 +3654,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_26stat(struct __pyx_obj_4ssh2_4sftp_ } } - /* "ssh2/sftp.pyx":235 + /* "ssh2/sftp.pyx":237 * "Error with stat on file %s - code %s", * path, rc) * if rc == c_ssh2._LIBSSH2_ERROR_EAGAIN: # <<<<<<<<<<<<<< @@ -3683,7 +3664,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_26stat(struct __pyx_obj_4ssh2_4sftp_ __pyx_t_2 = ((__pyx_v_rc == LIBSSH2_ERROR_EAGAIN) != 0); if (__pyx_t_2) { - /* "ssh2/sftp.pyx":236 + /* "ssh2/sftp.pyx":238 * path, rc) * if rc == c_ssh2._LIBSSH2_ERROR_EAGAIN: * return rc # <<<<<<<<<<<<<< @@ -3691,13 +3672,13 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_26stat(struct __pyx_obj_4ssh2_4sftp_ * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 236, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/sftp.pyx":235 + /* "ssh2/sftp.pyx":237 * "Error with stat on file %s - code %s", * path, rc) * if rc == c_ssh2._LIBSSH2_ERROR_EAGAIN: # <<<<<<<<<<<<<< @@ -3706,7 +3687,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_26stat(struct __pyx_obj_4ssh2_4sftp_ */ } - /* "ssh2/sftp.pyx":237 + /* "ssh2/sftp.pyx":239 * if rc == c_ssh2._LIBSSH2_ERROR_EAGAIN: * return rc * return attrs # <<<<<<<<<<<<<< @@ -3718,7 +3699,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_26stat(struct __pyx_obj_4ssh2_4sftp_ __pyx_r = ((PyObject *)__pyx_v_attrs); goto __pyx_L0; - /* "ssh2/sftp.pyx":217 + /* "ssh2/sftp.pyx":219 * return rc * * def stat(self, path not None): # <<<<<<<<<<<<<< @@ -3739,7 +3720,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_26stat(struct __pyx_obj_4ssh2_4sftp_ return __pyx_r; } -/* "ssh2/sftp.pyx":239 +/* "ssh2/sftp.pyx":241 * return attrs * * def lstat(self, path not None): # <<<<<<<<<<<<<< @@ -3755,7 +3736,7 @@ static PyObject *__pyx_pw_4ssh2_4sftp_4SFTP_29lstat(PyObject *__pyx_v_self, PyOb __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("lstat (wrapper)", 0); if (unlikely(((PyObject *)__pyx_v_path) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "path"); __PYX_ERR(0, 239, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "path"); __PYX_ERR(0, 241, __pyx_L1_error) } __pyx_r = __pyx_pf_4ssh2_4sftp_4SFTP_28lstat(((struct __pyx_obj_4ssh2_4sftp_SFTP *)__pyx_v_self), ((PyObject *)__pyx_v_path)); @@ -3780,7 +3761,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_28lstat(struct __pyx_obj_4ssh2_4sftp PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("lstat", 0); - /* "ssh2/sftp.pyx":241 + /* "ssh2/sftp.pyx":243 * def lstat(self, path not None): * cdef int rc * cdef char *_path = to_bytes(path) # <<<<<<<<<<<<<< @@ -3789,19 +3770,19 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_28lstat(struct __pyx_obj_4ssh2_4sftp */ __pyx_v__path = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_path); - /* "ssh2/sftp.pyx":242 + /* "ssh2/sftp.pyx":244 * cdef int rc * cdef char *_path = to_bytes(path) * cdef SFTPAttributes attrs = SFTPAttributes() # <<<<<<<<<<<<<< * with nogil: * rc = c_sftp.libssh2_sftp_lstat( */ - __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4ssh2_4sftp_SFTPAttributes), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 242, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4ssh2_4sftp_SFTPAttributes), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_attrs = ((struct __pyx_obj_4ssh2_4sftp_SFTPAttributes *)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/sftp.pyx":243 + /* "ssh2/sftp.pyx":245 * cdef char *_path = to_bytes(path) * cdef SFTPAttributes attrs = SFTPAttributes() * with nogil: # <<<<<<<<<<<<<< @@ -3816,7 +3797,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_28lstat(struct __pyx_obj_4ssh2_4sftp #endif /*try:*/ { - /* "ssh2/sftp.pyx":244 + /* "ssh2/sftp.pyx":246 * cdef SFTPAttributes attrs = SFTPAttributes() * with nogil: * rc = c_sftp.libssh2_sftp_lstat( # <<<<<<<<<<<<<< @@ -3825,7 +3806,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_28lstat(struct __pyx_obj_4ssh2_4sftp */ __pyx_v_rc = libssh2_sftp_lstat(__pyx_v_self->_sftp, __pyx_v__path, __pyx_v_attrs->_attrs); - /* "ssh2/sftp.pyx":246 + /* "ssh2/sftp.pyx":248 * rc = c_sftp.libssh2_sftp_lstat( * self._sftp, _path, attrs._attrs) * if rc != 0 and rc != c_ssh2._LIBSSH2_ERROR_EAGAIN: # <<<<<<<<<<<<<< @@ -3843,7 +3824,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_28lstat(struct __pyx_obj_4ssh2_4sftp __pyx_L7_bool_binop_done:; if (__pyx_t_2) { - /* "ssh2/sftp.pyx":247 + /* "ssh2/sftp.pyx":249 * self._sftp, _path, attrs._attrs) * if rc != 0 and rc != c_ssh2._LIBSSH2_ERROR_EAGAIN: * with gil: # <<<<<<<<<<<<<< @@ -3856,24 +3837,24 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_28lstat(struct __pyx_obj_4ssh2_4sftp #endif /*try:*/ { - /* "ssh2/sftp.pyx":250 + /* "ssh2/sftp.pyx":252 * raise SFTPHandleError( * "Error with stat on file %s - code %s", * path, rc) # <<<<<<<<<<<<<< * if rc == c_ssh2._LIBSSH2_ERROR_EAGAIN: * return rc */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 250, __pyx_L10_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 252, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_1); - /* "ssh2/sftp.pyx":248 + /* "ssh2/sftp.pyx":250 * if rc != 0 and rc != c_ssh2._LIBSSH2_ERROR_EAGAIN: * with gil: * raise SFTPHandleError( # <<<<<<<<<<<<<< * "Error with stat on file %s - code %s", * path, rc) */ - __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 248, __pyx_L10_error) + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 250, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_kp_s_Error_with_stat_on_file_s_code_s); __Pyx_GIVEREF(__pyx_kp_s_Error_with_stat_on_file_s_code_s); @@ -3884,15 +3865,15 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_28lstat(struct __pyx_obj_4ssh2_4sftp __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4ssh2_10exceptions_SFTPHandleError), __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 248, __pyx_L10_error) + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4ssh2_10exceptions_SFTPHandleError), __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 250, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 248, __pyx_L10_error) + __PYX_ERR(0, 250, __pyx_L10_error) } - /* "ssh2/sftp.pyx":247 + /* "ssh2/sftp.pyx":249 * self._sftp, _path, attrs._attrs) * if rc != 0 and rc != c_ssh2._LIBSSH2_ERROR_EAGAIN: * with gil: # <<<<<<<<<<<<<< @@ -3909,7 +3890,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_28lstat(struct __pyx_obj_4ssh2_4sftp } } - /* "ssh2/sftp.pyx":246 + /* "ssh2/sftp.pyx":248 * rc = c_sftp.libssh2_sftp_lstat( * self._sftp, _path, attrs._attrs) * if rc != 0 and rc != c_ssh2._LIBSSH2_ERROR_EAGAIN: # <<<<<<<<<<<<<< @@ -3919,7 +3900,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_28lstat(struct __pyx_obj_4ssh2_4sftp } } - /* "ssh2/sftp.pyx":243 + /* "ssh2/sftp.pyx":245 * cdef char *_path = to_bytes(path) * cdef SFTPAttributes attrs = SFTPAttributes() * with nogil: # <<<<<<<<<<<<<< @@ -3945,7 +3926,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_28lstat(struct __pyx_obj_4ssh2_4sftp } } - /* "ssh2/sftp.pyx":251 + /* "ssh2/sftp.pyx":253 * "Error with stat on file %s - code %s", * path, rc) * if rc == c_ssh2._LIBSSH2_ERROR_EAGAIN: # <<<<<<<<<<<<<< @@ -3955,7 +3936,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_28lstat(struct __pyx_obj_4ssh2_4sftp __pyx_t_2 = ((__pyx_v_rc == LIBSSH2_ERROR_EAGAIN) != 0); if (__pyx_t_2) { - /* "ssh2/sftp.pyx":252 + /* "ssh2/sftp.pyx":254 * path, rc) * if rc == c_ssh2._LIBSSH2_ERROR_EAGAIN: * return rc # <<<<<<<<<<<<<< @@ -3963,13 +3944,13 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_28lstat(struct __pyx_obj_4ssh2_4sftp * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 252, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/sftp.pyx":251 + /* "ssh2/sftp.pyx":253 * "Error with stat on file %s - code %s", * path, rc) * if rc == c_ssh2._LIBSSH2_ERROR_EAGAIN: # <<<<<<<<<<<<<< @@ -3978,7 +3959,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_28lstat(struct __pyx_obj_4ssh2_4sftp */ } - /* "ssh2/sftp.pyx":253 + /* "ssh2/sftp.pyx":255 * if rc == c_ssh2._LIBSSH2_ERROR_EAGAIN: * return rc * return attrs # <<<<<<<<<<<<<< @@ -3990,7 +3971,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_28lstat(struct __pyx_obj_4ssh2_4sftp __pyx_r = ((PyObject *)__pyx_v_attrs); goto __pyx_L0; - /* "ssh2/sftp.pyx":239 + /* "ssh2/sftp.pyx":241 * return attrs * * def lstat(self, path not None): # <<<<<<<<<<<<<< @@ -4011,7 +3992,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_28lstat(struct __pyx_obj_4ssh2_4sftp return __pyx_r; } -/* "ssh2/sftp.pyx":255 +/* "ssh2/sftp.pyx":257 * return attrs * * def setstat(self, path not None, SFTPAttributes attrs): # <<<<<<<<<<<<<< @@ -4051,11 +4032,11 @@ static PyObject *__pyx_pw_4ssh2_4sftp_4SFTP_31setstat(PyObject *__pyx_v_self, Py case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_attrs)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("setstat", 1, 2, 2, 1); __PYX_ERR(0, 255, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("setstat", 1, 2, 2, 1); __PYX_ERR(0, 257, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setstat") < 0)) __PYX_ERR(0, 255, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setstat") < 0)) __PYX_ERR(0, 257, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -4068,16 +4049,16 @@ static PyObject *__pyx_pw_4ssh2_4sftp_4SFTP_31setstat(PyObject *__pyx_v_self, Py } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("setstat", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 255, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("setstat", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 257, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.sftp.SFTP.setstat", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(((PyObject *)__pyx_v_path) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "path"); __PYX_ERR(0, 255, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "path"); __PYX_ERR(0, 257, __pyx_L1_error) } - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_attrs), __pyx_ptype_4ssh2_4sftp_SFTPAttributes, 1, "attrs", 0))) __PYX_ERR(0, 255, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_attrs), __pyx_ptype_4ssh2_4sftp_SFTPAttributes, 1, "attrs", 0))) __PYX_ERR(0, 257, __pyx_L1_error) __pyx_r = __pyx_pf_4ssh2_4sftp_4SFTP_30setstat(((struct __pyx_obj_4ssh2_4sftp_SFTP *)__pyx_v_self), __pyx_v_path, __pyx_v_attrs); /* function exit code */ @@ -4097,7 +4078,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_30setstat(struct __pyx_obj_4ssh2_4sf PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("setstat", 0); - /* "ssh2/sftp.pyx":257 + /* "ssh2/sftp.pyx":259 * def setstat(self, path not None, SFTPAttributes attrs): * cdef int rc * cdef char *_path = to_bytes(path) # <<<<<<<<<<<<<< @@ -4106,7 +4087,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_30setstat(struct __pyx_obj_4ssh2_4sf */ __pyx_v__path = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_path); - /* "ssh2/sftp.pyx":258 + /* "ssh2/sftp.pyx":260 * cdef int rc * cdef char *_path = to_bytes(path) * with nogil: # <<<<<<<<<<<<<< @@ -4121,7 +4102,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_30setstat(struct __pyx_obj_4ssh2_4sf #endif /*try:*/ { - /* "ssh2/sftp.pyx":259 + /* "ssh2/sftp.pyx":261 * cdef char *_path = to_bytes(path) * with nogil: * rc = c_sftp.libssh2_sftp_setstat( # <<<<<<<<<<<<<< @@ -4131,7 +4112,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_30setstat(struct __pyx_obj_4ssh2_4sf __pyx_v_rc = libssh2_sftp_setstat(__pyx_v_self->_sftp, __pyx_v__path, __pyx_v_attrs->_attrs); } - /* "ssh2/sftp.pyx":258 + /* "ssh2/sftp.pyx":260 * cdef int rc * cdef char *_path = to_bytes(path) * with nogil: # <<<<<<<<<<<<<< @@ -4150,7 +4131,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_30setstat(struct __pyx_obj_4ssh2_4sf } } - /* "ssh2/sftp.pyx":261 + /* "ssh2/sftp.pyx":263 * rc = c_sftp.libssh2_sftp_setstat( * self._sftp, _path, attrs._attrs) * return rc # <<<<<<<<<<<<<< @@ -4158,13 +4139,13 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_30setstat(struct __pyx_obj_4ssh2_4sf * def symlink(self, path not None, target not None): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 261, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/sftp.pyx":255 + /* "ssh2/sftp.pyx":257 * return attrs * * def setstat(self, path not None, SFTPAttributes attrs): # <<<<<<<<<<<<<< @@ -4183,7 +4164,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_30setstat(struct __pyx_obj_4ssh2_4sf return __pyx_r; } -/* "ssh2/sftp.pyx":263 +/* "ssh2/sftp.pyx":265 * return rc * * def symlink(self, path not None, target not None): # <<<<<<<<<<<<<< @@ -4223,11 +4204,11 @@ static PyObject *__pyx_pw_4ssh2_4sftp_4SFTP_33symlink(PyObject *__pyx_v_self, Py case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_target)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("symlink", 1, 2, 2, 1); __PYX_ERR(0, 263, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("symlink", 1, 2, 2, 1); __PYX_ERR(0, 265, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "symlink") < 0)) __PYX_ERR(0, 263, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "symlink") < 0)) __PYX_ERR(0, 265, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -4240,17 +4221,17 @@ static PyObject *__pyx_pw_4ssh2_4sftp_4SFTP_33symlink(PyObject *__pyx_v_self, Py } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("symlink", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 263, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("symlink", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 265, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.sftp.SFTP.symlink", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(((PyObject *)__pyx_v_path) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "path"); __PYX_ERR(0, 263, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "path"); __PYX_ERR(0, 265, __pyx_L1_error) } if (unlikely(((PyObject *)__pyx_v_target) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "target"); __PYX_ERR(0, 263, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "target"); __PYX_ERR(0, 265, __pyx_L1_error) } __pyx_r = __pyx_pf_4ssh2_4sftp_4SFTP_32symlink(((struct __pyx_obj_4ssh2_4sftp_SFTP *)__pyx_v_self), __pyx_v_path, __pyx_v_target); @@ -4272,7 +4253,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_32symlink(struct __pyx_obj_4ssh2_4sf PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("symlink", 0); - /* "ssh2/sftp.pyx":265 + /* "ssh2/sftp.pyx":267 * def symlink(self, path not None, target not None): * cdef int rc * cdef char *_path = to_bytes(path) # <<<<<<<<<<<<<< @@ -4281,7 +4262,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_32symlink(struct __pyx_obj_4ssh2_4sf */ __pyx_v__path = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_path); - /* "ssh2/sftp.pyx":266 + /* "ssh2/sftp.pyx":268 * cdef int rc * cdef char *_path = to_bytes(path) * cdef char *_target = to_bytes(target) # <<<<<<<<<<<<<< @@ -4290,7 +4271,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_32symlink(struct __pyx_obj_4ssh2_4sf */ __pyx_v__target = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_target); - /* "ssh2/sftp.pyx":267 + /* "ssh2/sftp.pyx":269 * cdef char *_path = to_bytes(path) * cdef char *_target = to_bytes(target) * with nogil: # <<<<<<<<<<<<<< @@ -4305,7 +4286,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_32symlink(struct __pyx_obj_4ssh2_4sf #endif /*try:*/ { - /* "ssh2/sftp.pyx":268 + /* "ssh2/sftp.pyx":270 * cdef char *_target = to_bytes(target) * with nogil: * rc = c_sftp.libssh2_sftp_symlink(self._sftp, _path, _target) # <<<<<<<<<<<<<< @@ -4315,7 +4296,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_32symlink(struct __pyx_obj_4ssh2_4sf __pyx_v_rc = libssh2_sftp_symlink(__pyx_v_self->_sftp, __pyx_v__path, __pyx_v__target); } - /* "ssh2/sftp.pyx":267 + /* "ssh2/sftp.pyx":269 * cdef char *_path = to_bytes(path) * cdef char *_target = to_bytes(target) * with nogil: # <<<<<<<<<<<<<< @@ -4334,7 +4315,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_32symlink(struct __pyx_obj_4ssh2_4sf } } - /* "ssh2/sftp.pyx":269 + /* "ssh2/sftp.pyx":271 * with nogil: * rc = c_sftp.libssh2_sftp_symlink(self._sftp, _path, _target) * return rc # <<<<<<<<<<<<<< @@ -4342,13 +4323,13 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_32symlink(struct __pyx_obj_4ssh2_4sf * def realpath(self, path not None, size_t max_len=256): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 269, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/sftp.pyx":263 + /* "ssh2/sftp.pyx":265 * return rc * * def symlink(self, path not None, target not None): # <<<<<<<<<<<<<< @@ -4367,7 +4348,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_32symlink(struct __pyx_obj_4ssh2_4sf return __pyx_r; } -/* "ssh2/sftp.pyx":271 +/* "ssh2/sftp.pyx":273 * return rc * * def realpath(self, path not None, size_t max_len=256): # <<<<<<<<<<<<<< @@ -4411,7 +4392,7 @@ static PyObject *__pyx_pw_4ssh2_4sftp_4SFTP_35realpath(PyObject *__pyx_v_self, P } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "realpath") < 0)) __PYX_ERR(0, 271, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "realpath") < 0)) __PYX_ERR(0, 273, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -4424,21 +4405,21 @@ static PyObject *__pyx_pw_4ssh2_4sftp_4SFTP_35realpath(PyObject *__pyx_v_self, P } __pyx_v_path = values[0]; if (values[1]) { - __pyx_v_max_len = __Pyx_PyInt_As_size_t(values[1]); if (unlikely((__pyx_v_max_len == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 271, __pyx_L3_error) + __pyx_v_max_len = __Pyx_PyInt_As_size_t(values[1]); if (unlikely((__pyx_v_max_len == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 273, __pyx_L3_error) } else { __pyx_v_max_len = ((size_t)0x100); } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("realpath", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 271, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("realpath", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 273, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.sftp.SFTP.realpath", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(((PyObject *)__pyx_v_path) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "path"); __PYX_ERR(0, 271, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "path"); __PYX_ERR(0, 273, __pyx_L1_error) } __pyx_r = __pyx_pf_4ssh2_4sftp_4SFTP_34realpath(((struct __pyx_obj_4ssh2_4sftp_SFTP *)__pyx_v_self), __pyx_v_path, __pyx_v_max_len); @@ -4475,7 +4456,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_34realpath(struct __pyx_obj_4ssh2_4s PyObject *__pyx_t_15 = NULL; __Pyx_RefNannySetupContext("realpath", 0); - /* "ssh2/sftp.pyx":283 + /* "ssh2/sftp.pyx":285 * :raises: :py:class:`ssh2.exceptions.SFTPBufferTooSmall` on max_len less * than real path length.""" * cdef char *_target = malloc(sizeof(char)*max_len) # <<<<<<<<<<<<<< @@ -4484,7 +4465,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_34realpath(struct __pyx_obj_4ssh2_4s */ __pyx_v__target = ((char *)malloc(((sizeof(char)) * __pyx_v_max_len))); - /* "ssh2/sftp.pyx":284 + /* "ssh2/sftp.pyx":286 * than real path length.""" * cdef char *_target = malloc(sizeof(char)*max_len) * if _target == NULL: # <<<<<<<<<<<<<< @@ -4494,16 +4475,16 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_34realpath(struct __pyx_obj_4ssh2_4s __pyx_t_1 = ((__pyx_v__target == NULL) != 0); if (__pyx_t_1) { - /* "ssh2/sftp.pyx":285 + /* "ssh2/sftp.pyx":287 * cdef char *_target = malloc(sizeof(char)*max_len) * if _target == NULL: * raise MemoryError # <<<<<<<<<<<<<< * cdef int rc * cdef char *_path = to_bytes(path) */ - PyErr_NoMemory(); __PYX_ERR(0, 285, __pyx_L1_error) + PyErr_NoMemory(); __PYX_ERR(0, 287, __pyx_L1_error) - /* "ssh2/sftp.pyx":284 + /* "ssh2/sftp.pyx":286 * than real path length.""" * cdef char *_target = malloc(sizeof(char)*max_len) * if _target == NULL: # <<<<<<<<<<<<<< @@ -4512,7 +4493,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_34realpath(struct __pyx_obj_4ssh2_4s */ } - /* "ssh2/sftp.pyx":287 + /* "ssh2/sftp.pyx":289 * raise MemoryError * cdef int rc * cdef char *_path = to_bytes(path) # <<<<<<<<<<<<<< @@ -4521,7 +4502,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_34realpath(struct __pyx_obj_4ssh2_4s */ __pyx_v__path = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_path); - /* "ssh2/sftp.pyx":289 + /* "ssh2/sftp.pyx":291 * cdef char *_path = to_bytes(path) * cdef bytes realpath * try: # <<<<<<<<<<<<<< @@ -4530,7 +4511,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_34realpath(struct __pyx_obj_4ssh2_4s */ /*try:*/ { - /* "ssh2/sftp.pyx":290 + /* "ssh2/sftp.pyx":292 * cdef bytes realpath * try: * with nogil: # <<<<<<<<<<<<<< @@ -4545,7 +4526,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_34realpath(struct __pyx_obj_4ssh2_4s #endif /*try:*/ { - /* "ssh2/sftp.pyx":291 + /* "ssh2/sftp.pyx":293 * try: * with nogil: * rc = c_sftp.libssh2_sftp_realpath( # <<<<<<<<<<<<<< @@ -4554,7 +4535,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_34realpath(struct __pyx_obj_4ssh2_4s */ __pyx_v_rc = libssh2_sftp_realpath(__pyx_v_self->_sftp, __pyx_v__path, __pyx_v__target, __pyx_v_max_len); - /* "ssh2/sftp.pyx":293 + /* "ssh2/sftp.pyx":295 * rc = c_sftp.libssh2_sftp_realpath( * self._sftp, _path, _target, max_len) * if rc == _LIBSSH2_ERROR_BUFFER_TOO_SMALL: # <<<<<<<<<<<<<< @@ -4564,7 +4545,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_34realpath(struct __pyx_obj_4ssh2_4s __pyx_t_1 = ((__pyx_v_rc == LIBSSH2_ERROR_BUFFER_TOO_SMALL) != 0); if (__pyx_t_1) { - /* "ssh2/sftp.pyx":294 + /* "ssh2/sftp.pyx":296 * self._sftp, _path, _target, max_len) * if rc == _LIBSSH2_ERROR_BUFFER_TOO_SMALL: * with gil: # <<<<<<<<<<<<<< @@ -4577,26 +4558,26 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_34realpath(struct __pyx_obj_4ssh2_4s #endif /*try:*/ { - /* "ssh2/sftp.pyx":298 + /* "ssh2/sftp.pyx":300 * "Buffer too small to fit realpath for %s " * "- max size %s. Error code %s", * path, max_len, rc) # <<<<<<<<<<<<<< * elif rc != c_ssh2._LIBSSH2_ERROR_EAGAIN and rc < 0: * with gil: */ - __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_max_len); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 298, __pyx_L12_error) + __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_max_len); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 300, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 298, __pyx_L12_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 300, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_3); - /* "ssh2/sftp.pyx":295 + /* "ssh2/sftp.pyx":297 * if rc == _LIBSSH2_ERROR_BUFFER_TOO_SMALL: * with gil: * raise SFTPBufferTooSmall( # <<<<<<<<<<<<<< * "Buffer too small to fit realpath for %s " * "- max size %s. Error code %s", */ - __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 295, __pyx_L12_error) + __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 297, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_kp_s_Buffer_too_small_to_fit_realpath); __Pyx_GIVEREF(__pyx_kp_s_Buffer_too_small_to_fit_realpath); @@ -4610,15 +4591,15 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_34realpath(struct __pyx_obj_4ssh2_4s PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_3); __pyx_t_2 = 0; __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4ssh2_10exceptions_SFTPBufferTooSmall), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 295, __pyx_L12_error) + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4ssh2_10exceptions_SFTPBufferTooSmall), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 297, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 295, __pyx_L12_error) + __PYX_ERR(0, 297, __pyx_L12_error) } - /* "ssh2/sftp.pyx":294 + /* "ssh2/sftp.pyx":296 * self._sftp, _path, _target, max_len) * if rc == _LIBSSH2_ERROR_BUFFER_TOO_SMALL: * with gil: # <<<<<<<<<<<<<< @@ -4635,7 +4616,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_34realpath(struct __pyx_obj_4ssh2_4s } } - /* "ssh2/sftp.pyx":293 + /* "ssh2/sftp.pyx":295 * rc = c_sftp.libssh2_sftp_realpath( * self._sftp, _path, _target, max_len) * if rc == _LIBSSH2_ERROR_BUFFER_TOO_SMALL: # <<<<<<<<<<<<<< @@ -4644,7 +4625,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_34realpath(struct __pyx_obj_4ssh2_4s */ } - /* "ssh2/sftp.pyx":299 + /* "ssh2/sftp.pyx":301 * "- max size %s. Error code %s", * path, max_len, rc) * elif rc != c_ssh2._LIBSSH2_ERROR_EAGAIN and rc < 0: # <<<<<<<<<<<<<< @@ -4662,7 +4643,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_34realpath(struct __pyx_obj_4ssh2_4s __pyx_L14_bool_binop_done:; if (__pyx_t_1) { - /* "ssh2/sftp.pyx":300 + /* "ssh2/sftp.pyx":302 * path, max_len, rc) * elif rc != c_ssh2._LIBSSH2_ERROR_EAGAIN and rc < 0: * with gil: # <<<<<<<<<<<<<< @@ -4675,24 +4656,24 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_34realpath(struct __pyx_obj_4ssh2_4s #endif /*try:*/ { - /* "ssh2/sftp.pyx":303 + /* "ssh2/sftp.pyx":305 * raise SFTPHandleError( * "Error getting real path for %s - error code %s", * path, rc) # <<<<<<<<<<<<<< * elif rc == c_ssh2._LIBSSH2_ERROR_EAGAIN: * with gil: */ - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 303, __pyx_L17_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 305, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_3); - /* "ssh2/sftp.pyx":301 + /* "ssh2/sftp.pyx":303 * elif rc != c_ssh2._LIBSSH2_ERROR_EAGAIN and rc < 0: * with gil: * raise SFTPHandleError( # <<<<<<<<<<<<<< * "Error getting real path for %s - error code %s", * path, rc) */ - __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 301, __pyx_L17_error) + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 303, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_kp_s_Error_getting_real_path_for_s_er); __Pyx_GIVEREF(__pyx_kp_s_Error_getting_real_path_for_s_er); @@ -4703,15 +4684,15 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_34realpath(struct __pyx_obj_4ssh2_4s __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4ssh2_10exceptions_SFTPHandleError), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 301, __pyx_L17_error) + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4ssh2_10exceptions_SFTPHandleError), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 303, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 301, __pyx_L17_error) + __PYX_ERR(0, 303, __pyx_L17_error) } - /* "ssh2/sftp.pyx":300 + /* "ssh2/sftp.pyx":302 * path, max_len, rc) * elif rc != c_ssh2._LIBSSH2_ERROR_EAGAIN and rc < 0: * with gil: # <<<<<<<<<<<<<< @@ -4728,7 +4709,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_34realpath(struct __pyx_obj_4ssh2_4s } } - /* "ssh2/sftp.pyx":299 + /* "ssh2/sftp.pyx":301 * "- max size %s. Error code %s", * path, max_len, rc) * elif rc != c_ssh2._LIBSSH2_ERROR_EAGAIN and rc < 0: # <<<<<<<<<<<<<< @@ -4737,7 +4718,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_34realpath(struct __pyx_obj_4ssh2_4s */ } - /* "ssh2/sftp.pyx":304 + /* "ssh2/sftp.pyx":306 * "Error getting real path for %s - error code %s", * path, rc) * elif rc == c_ssh2._LIBSSH2_ERROR_EAGAIN: # <<<<<<<<<<<<<< @@ -4747,7 +4728,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_34realpath(struct __pyx_obj_4ssh2_4s __pyx_t_1 = ((__pyx_v_rc == LIBSSH2_ERROR_EAGAIN) != 0); if (__pyx_t_1) { - /* "ssh2/sftp.pyx":305 + /* "ssh2/sftp.pyx":307 * path, rc) * elif rc == c_ssh2._LIBSSH2_ERROR_EAGAIN: * with gil: # <<<<<<<<<<<<<< @@ -4760,7 +4741,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_34realpath(struct __pyx_obj_4ssh2_4s #endif /*try:*/ { - /* "ssh2/sftp.pyx":306 + /* "ssh2/sftp.pyx":308 * elif rc == c_ssh2._LIBSSH2_ERROR_EAGAIN: * with gil: * return rc # <<<<<<<<<<<<<< @@ -4768,14 +4749,14 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_34realpath(struct __pyx_obj_4ssh2_4s * return to_str(realpath) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 306, __pyx_L20_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 308, __pyx_L20_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L19_return; } - /* "ssh2/sftp.pyx":305 + /* "ssh2/sftp.pyx":307 * path, rc) * elif rc == c_ssh2._LIBSSH2_ERROR_EAGAIN: * with gil: # <<<<<<<<<<<<<< @@ -4798,7 +4779,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_34realpath(struct __pyx_obj_4ssh2_4s } } - /* "ssh2/sftp.pyx":304 + /* "ssh2/sftp.pyx":306 * "Error getting real path for %s - error code %s", * path, rc) * elif rc == c_ssh2._LIBSSH2_ERROR_EAGAIN: # <<<<<<<<<<<<<< @@ -4808,7 +4789,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_34realpath(struct __pyx_obj_4ssh2_4s } } - /* "ssh2/sftp.pyx":290 + /* "ssh2/sftp.pyx":292 * cdef bytes realpath * try: * with nogil: # <<<<<<<<<<<<<< @@ -4841,19 +4822,19 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_34realpath(struct __pyx_obj_4ssh2_4s } } - /* "ssh2/sftp.pyx":307 + /* "ssh2/sftp.pyx":309 * with gil: * return rc * realpath = _target[:rc] # <<<<<<<<<<<<<< * return to_str(realpath) * finally: */ - __pyx_t_3 = __Pyx_PyBytes_FromStringAndSize(__pyx_v__target + 0, __pyx_v_rc - 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 307, __pyx_L5_error) + __pyx_t_3 = __Pyx_PyBytes_FromStringAndSize(__pyx_v__target + 0, __pyx_v_rc - 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 309, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_realpath = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; - /* "ssh2/sftp.pyx":308 + /* "ssh2/sftp.pyx":310 * return rc * realpath = _target[:rc] * return to_str(realpath) # <<<<<<<<<<<<<< @@ -4861,15 +4842,15 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_34realpath(struct __pyx_obj_4ssh2_4s * free(_target) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_6 = __Pyx_PyObject_AsWritableString(__pyx_v_realpath); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 308, __pyx_L5_error) - __pyx_t_3 = __pyx_f_4ssh2_5utils_to_str(__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 308, __pyx_L5_error) + __pyx_t_6 = __Pyx_PyObject_AsWritableString(__pyx_v_realpath); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 310, __pyx_L5_error) + __pyx_t_3 = __pyx_f_4ssh2_5utils_to_str(__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 310, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L4_return; } - /* "ssh2/sftp.pyx":310 + /* "ssh2/sftp.pyx":312 * return to_str(realpath) * finally: * free(_target) # <<<<<<<<<<<<<< @@ -4922,7 +4903,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_34realpath(struct __pyx_obj_4ssh2_4s } } - /* "ssh2/sftp.pyx":271 + /* "ssh2/sftp.pyx":273 * return rc * * def realpath(self, path not None, size_t max_len=256): # <<<<<<<<<<<<<< @@ -4944,7 +4925,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_34realpath(struct __pyx_obj_4ssh2_4s return __pyx_r; } -/* "ssh2/sftp.pyx":312 +/* "ssh2/sftp.pyx":314 * free(_target) * * def last_error(self): # <<<<<<<<<<<<<< @@ -4973,7 +4954,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_36last_error(struct __pyx_obj_4ssh2_ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("last_error", 0); - /* "ssh2/sftp.pyx":314 + /* "ssh2/sftp.pyx":316 * def last_error(self): * cdef unsigned long rc * with nogil: # <<<<<<<<<<<<<< @@ -4988,7 +4969,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_36last_error(struct __pyx_obj_4ssh2_ #endif /*try:*/ { - /* "ssh2/sftp.pyx":315 + /* "ssh2/sftp.pyx":317 * cdef unsigned long rc * with nogil: * rc = c_sftp.libssh2_sftp_last_error(self._sftp) # <<<<<<<<<<<<<< @@ -4998,7 +4979,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_36last_error(struct __pyx_obj_4ssh2_ __pyx_v_rc = libssh2_sftp_last_error(__pyx_v_self->_sftp); } - /* "ssh2/sftp.pyx":314 + /* "ssh2/sftp.pyx":316 * def last_error(self): * cdef unsigned long rc * with nogil: # <<<<<<<<<<<<<< @@ -5017,7 +4998,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_36last_error(struct __pyx_obj_4ssh2_ } } - /* "ssh2/sftp.pyx":316 + /* "ssh2/sftp.pyx":318 * with nogil: * rc = c_sftp.libssh2_sftp_last_error(self._sftp) * return rc # <<<<<<<<<<<<<< @@ -5025,13 +5006,13 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_36last_error(struct __pyx_obj_4ssh2_ * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_unsigned_long(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 316, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_unsigned_long(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/sftp.pyx":312 + /* "ssh2/sftp.pyx":314 * free(_target) * * def last_error(self): # <<<<<<<<<<<<<< @@ -5159,7 +5140,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_40__setstate_cython__(CYTHON_UNUSED return __pyx_r; } -/* "ssh2/sftp.pyx":322 +/* "ssh2/sftp.pyx":324 * cdef c_sftp.LIBSSH2_SFTP_ATTRIBUTES *_attrs * * def __cinit__(self): # <<<<<<<<<<<<<< @@ -5189,7 +5170,7 @@ static int __pyx_pf_4ssh2_4sftp_14SFTPAttributes___cinit__(struct __pyx_obj_4ssh int __pyx_t_1; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "ssh2/sftp.pyx":323 + /* "ssh2/sftp.pyx":325 * * def __cinit__(self): * with nogil: # <<<<<<<<<<<<<< @@ -5204,7 +5185,7 @@ static int __pyx_pf_4ssh2_4sftp_14SFTPAttributes___cinit__(struct __pyx_obj_4ssh #endif /*try:*/ { - /* "ssh2/sftp.pyx":324 + /* "ssh2/sftp.pyx":326 * def __cinit__(self): * with nogil: * self._attrs = malloc( # <<<<<<<<<<<<<< @@ -5213,7 +5194,7 @@ static int __pyx_pf_4ssh2_4sftp_14SFTPAttributes___cinit__(struct __pyx_obj_4ssh */ __pyx_v_self->_attrs = ((LIBSSH2_SFTP_ATTRIBUTES *)malloc((sizeof(LIBSSH2_SFTP_ATTRIBUTES)))); - /* "ssh2/sftp.pyx":326 + /* "ssh2/sftp.pyx":328 * self._attrs = malloc( * sizeof(c_sftp.LIBSSH2_SFTP_ATTRIBUTES)) * if self._attrs is NULL: # <<<<<<<<<<<<<< @@ -5223,7 +5204,7 @@ static int __pyx_pf_4ssh2_4sftp_14SFTPAttributes___cinit__(struct __pyx_obj_4ssh __pyx_t_1 = ((__pyx_v_self->_attrs == NULL) != 0); if (__pyx_t_1) { - /* "ssh2/sftp.pyx":327 + /* "ssh2/sftp.pyx":329 * sizeof(c_sftp.LIBSSH2_SFTP_ATTRIBUTES)) * if self._attrs is NULL: * with gil: # <<<<<<<<<<<<<< @@ -5236,17 +5217,17 @@ static int __pyx_pf_4ssh2_4sftp_14SFTPAttributes___cinit__(struct __pyx_obj_4ssh #endif /*try:*/ { - /* "ssh2/sftp.pyx":328 + /* "ssh2/sftp.pyx":330 * if self._attrs is NULL: * with gil: * raise MemoryError # <<<<<<<<<<<<<< * self._attrs.flags = 0 * self._attrs.filesize = 0 */ - PyErr_NoMemory(); __PYX_ERR(0, 328, __pyx_L8_error) + PyErr_NoMemory(); __PYX_ERR(0, 330, __pyx_L8_error) } - /* "ssh2/sftp.pyx":327 + /* "ssh2/sftp.pyx":329 * sizeof(c_sftp.LIBSSH2_SFTP_ATTRIBUTES)) * if self._attrs is NULL: * with gil: # <<<<<<<<<<<<<< @@ -5263,7 +5244,7 @@ static int __pyx_pf_4ssh2_4sftp_14SFTPAttributes___cinit__(struct __pyx_obj_4ssh } } - /* "ssh2/sftp.pyx":326 + /* "ssh2/sftp.pyx":328 * self._attrs = malloc( * sizeof(c_sftp.LIBSSH2_SFTP_ATTRIBUTES)) * if self._attrs is NULL: # <<<<<<<<<<<<<< @@ -5272,7 +5253,7 @@ static int __pyx_pf_4ssh2_4sftp_14SFTPAttributes___cinit__(struct __pyx_obj_4ssh */ } - /* "ssh2/sftp.pyx":329 + /* "ssh2/sftp.pyx":331 * with gil: * raise MemoryError * self._attrs.flags = 0 # <<<<<<<<<<<<<< @@ -5281,7 +5262,7 @@ static int __pyx_pf_4ssh2_4sftp_14SFTPAttributes___cinit__(struct __pyx_obj_4ssh */ __pyx_v_self->_attrs->flags = 0; - /* "ssh2/sftp.pyx":330 + /* "ssh2/sftp.pyx":332 * raise MemoryError * self._attrs.flags = 0 * self._attrs.filesize = 0 # <<<<<<<<<<<<<< @@ -5290,7 +5271,7 @@ static int __pyx_pf_4ssh2_4sftp_14SFTPAttributes___cinit__(struct __pyx_obj_4ssh */ __pyx_v_self->_attrs->filesize = 0; - /* "ssh2/sftp.pyx":331 + /* "ssh2/sftp.pyx":333 * self._attrs.flags = 0 * self._attrs.filesize = 0 * self._attrs.uid = 0 # <<<<<<<<<<<<<< @@ -5299,7 +5280,7 @@ static int __pyx_pf_4ssh2_4sftp_14SFTPAttributes___cinit__(struct __pyx_obj_4ssh */ __pyx_v_self->_attrs->uid = 0; - /* "ssh2/sftp.pyx":332 + /* "ssh2/sftp.pyx":334 * self._attrs.filesize = 0 * self._attrs.uid = 0 * self._attrs.gid = 0 # <<<<<<<<<<<<<< @@ -5308,7 +5289,7 @@ static int __pyx_pf_4ssh2_4sftp_14SFTPAttributes___cinit__(struct __pyx_obj_4ssh */ __pyx_v_self->_attrs->gid = 0; - /* "ssh2/sftp.pyx":333 + /* "ssh2/sftp.pyx":335 * self._attrs.uid = 0 * self._attrs.gid = 0 * self._attrs.permissions = 0 # <<<<<<<<<<<<<< @@ -5317,7 +5298,7 @@ static int __pyx_pf_4ssh2_4sftp_14SFTPAttributes___cinit__(struct __pyx_obj_4ssh */ __pyx_v_self->_attrs->permissions = 0; - /* "ssh2/sftp.pyx":334 + /* "ssh2/sftp.pyx":336 * self._attrs.gid = 0 * self._attrs.permissions = 0 * self._attrs.atime = 0 # <<<<<<<<<<<<<< @@ -5326,7 +5307,7 @@ static int __pyx_pf_4ssh2_4sftp_14SFTPAttributes___cinit__(struct __pyx_obj_4ssh */ __pyx_v_self->_attrs->atime = 0; - /* "ssh2/sftp.pyx":335 + /* "ssh2/sftp.pyx":337 * self._attrs.permissions = 0 * self._attrs.atime = 0 * self._attrs.mtime = 0 # <<<<<<<<<<<<<< @@ -5336,7 +5317,7 @@ static int __pyx_pf_4ssh2_4sftp_14SFTPAttributes___cinit__(struct __pyx_obj_4ssh __pyx_v_self->_attrs->mtime = 0; } - /* "ssh2/sftp.pyx":323 + /* "ssh2/sftp.pyx":325 * * def __cinit__(self): * with nogil: # <<<<<<<<<<<<<< @@ -5362,7 +5343,7 @@ static int __pyx_pf_4ssh2_4sftp_14SFTPAttributes___cinit__(struct __pyx_obj_4ssh } } - /* "ssh2/sftp.pyx":322 + /* "ssh2/sftp.pyx":324 * cdef c_sftp.LIBSSH2_SFTP_ATTRIBUTES *_attrs * * def __cinit__(self): # <<<<<<<<<<<<<< @@ -5381,7 +5362,7 @@ static int __pyx_pf_4ssh2_4sftp_14SFTPAttributes___cinit__(struct __pyx_obj_4ssh return __pyx_r; } -/* "ssh2/sftp.pyx":337 +/* "ssh2/sftp.pyx":339 * self._attrs.mtime = 0 * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -5404,7 +5385,7 @@ static void __pyx_pf_4ssh2_4sftp_14SFTPAttributes_2__dealloc__(struct __pyx_obj_ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "ssh2/sftp.pyx":338 + /* "ssh2/sftp.pyx":340 * * def __dealloc__(self): * with nogil: # <<<<<<<<<<<<<< @@ -5419,7 +5400,7 @@ static void __pyx_pf_4ssh2_4sftp_14SFTPAttributes_2__dealloc__(struct __pyx_obj_ #endif /*try:*/ { - /* "ssh2/sftp.pyx":339 + /* "ssh2/sftp.pyx":341 * def __dealloc__(self): * with nogil: * free(self._attrs) # <<<<<<<<<<<<<< @@ -5429,7 +5410,7 @@ static void __pyx_pf_4ssh2_4sftp_14SFTPAttributes_2__dealloc__(struct __pyx_obj_ free(__pyx_v_self->_attrs); } - /* "ssh2/sftp.pyx":338 + /* "ssh2/sftp.pyx":340 * * def __dealloc__(self): * with nogil: # <<<<<<<<<<<<<< @@ -5448,7 +5429,7 @@ static void __pyx_pf_4ssh2_4sftp_14SFTPAttributes_2__dealloc__(struct __pyx_obj_ } } - /* "ssh2/sftp.pyx":337 + /* "ssh2/sftp.pyx":339 * self._attrs.mtime = 0 * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -5460,7 +5441,7 @@ static void __pyx_pf_4ssh2_4sftp_14SFTPAttributes_2__dealloc__(struct __pyx_obj_ __Pyx_RefNannyFinishContext(); } -/* "ssh2/sftp.pyx":342 +/* "ssh2/sftp.pyx":344 * * @property * def flags(self): # <<<<<<<<<<<<<< @@ -5487,7 +5468,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_14SFTPAttributes_5flags___get__(struct __p PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__", 0); - /* "ssh2/sftp.pyx":343 + /* "ssh2/sftp.pyx":345 * @property * def flags(self): * return self._attrs.flags # <<<<<<<<<<<<<< @@ -5495,13 +5476,13 @@ static PyObject *__pyx_pf_4ssh2_4sftp_14SFTPAttributes_5flags___get__(struct __p * @flags.setter */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_unsigned_long(__pyx_v_self->_attrs->flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 343, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_unsigned_long(__pyx_v_self->_attrs->flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 345, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/sftp.pyx":342 + /* "ssh2/sftp.pyx":344 * * @property * def flags(self): # <<<<<<<<<<<<<< @@ -5520,7 +5501,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_14SFTPAttributes_5flags___get__(struct __p return __pyx_r; } -/* "ssh2/sftp.pyx":346 +/* "ssh2/sftp.pyx":348 * * @flags.setter * def flags(self, unsigned long flags): # <<<<<<<<<<<<<< @@ -5536,7 +5517,7 @@ static int __pyx_pw_4ssh2_4sftp_14SFTPAttributes_5flags_3__set__(PyObject *__pyx __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); assert(__pyx_arg_flags); { - __pyx_v_flags = __Pyx_PyInt_As_unsigned_long(__pyx_arg_flags); if (unlikely((__pyx_v_flags == (unsigned long)-1) && PyErr_Occurred())) __PYX_ERR(0, 346, __pyx_L3_error) + __pyx_v_flags = __Pyx_PyInt_As_unsigned_long(__pyx_arg_flags); if (unlikely((__pyx_v_flags == (unsigned long)-1) && PyErr_Occurred())) __PYX_ERR(0, 348, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -5556,7 +5537,7 @@ static int __pyx_pf_4ssh2_4sftp_14SFTPAttributes_5flags_2__set__(struct __pyx_ob __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__", 0); - /* "ssh2/sftp.pyx":347 + /* "ssh2/sftp.pyx":349 * @flags.setter * def flags(self, unsigned long flags): * self._attrs.flags = flags # <<<<<<<<<<<<<< @@ -5565,7 +5546,7 @@ static int __pyx_pf_4ssh2_4sftp_14SFTPAttributes_5flags_2__set__(struct __pyx_ob */ __pyx_v_self->_attrs->flags = __pyx_v_flags; - /* "ssh2/sftp.pyx":346 + /* "ssh2/sftp.pyx":348 * * @flags.setter * def flags(self, unsigned long flags): # <<<<<<<<<<<<<< @@ -5579,7 +5560,7 @@ static int __pyx_pf_4ssh2_4sftp_14SFTPAttributes_5flags_2__set__(struct __pyx_ob return __pyx_r; } -/* "ssh2/sftp.pyx":350 +/* "ssh2/sftp.pyx":352 * * @property * def filesize(self): # <<<<<<<<<<<<<< @@ -5606,7 +5587,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_14SFTPAttributes_8filesize___get__(struct PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__", 0); - /* "ssh2/sftp.pyx":351 + /* "ssh2/sftp.pyx":353 * @property * def filesize(self): * return self._attrs.filesize # <<<<<<<<<<<<<< @@ -5614,13 +5595,13 @@ static PyObject *__pyx_pf_4ssh2_4sftp_14SFTPAttributes_8filesize___get__(struct * @filesize.setter */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_uint64_t(__pyx_v_self->_attrs->filesize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 351, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint64_t(__pyx_v_self->_attrs->filesize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 353, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/sftp.pyx":350 + /* "ssh2/sftp.pyx":352 * * @property * def filesize(self): # <<<<<<<<<<<<<< @@ -5639,7 +5620,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_14SFTPAttributes_8filesize___get__(struct return __pyx_r; } -/* "ssh2/sftp.pyx":354 +/* "ssh2/sftp.pyx":356 * * @filesize.setter * def filesize(self, uint64_t filesize): # <<<<<<<<<<<<<< @@ -5655,7 +5636,7 @@ static int __pyx_pw_4ssh2_4sftp_14SFTPAttributes_8filesize_3__set__(PyObject *__ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); assert(__pyx_arg_filesize); { - __pyx_v_filesize = __Pyx_PyInt_As_uint64_t(__pyx_arg_filesize); if (unlikely((__pyx_v_filesize == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 354, __pyx_L3_error) + __pyx_v_filesize = __Pyx_PyInt_As_uint64_t(__pyx_arg_filesize); if (unlikely((__pyx_v_filesize == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 356, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -5675,7 +5656,7 @@ static int __pyx_pf_4ssh2_4sftp_14SFTPAttributes_8filesize_2__set__(struct __pyx __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__", 0); - /* "ssh2/sftp.pyx":355 + /* "ssh2/sftp.pyx":357 * @filesize.setter * def filesize(self, uint64_t filesize): * self._attrs.filesize = filesize # <<<<<<<<<<<<<< @@ -5684,7 +5665,7 @@ static int __pyx_pf_4ssh2_4sftp_14SFTPAttributes_8filesize_2__set__(struct __pyx */ __pyx_v_self->_attrs->filesize = __pyx_v_filesize; - /* "ssh2/sftp.pyx":354 + /* "ssh2/sftp.pyx":356 * * @filesize.setter * def filesize(self, uint64_t filesize): # <<<<<<<<<<<<<< @@ -5698,7 +5679,7 @@ static int __pyx_pf_4ssh2_4sftp_14SFTPAttributes_8filesize_2__set__(struct __pyx return __pyx_r; } -/* "ssh2/sftp.pyx":358 +/* "ssh2/sftp.pyx":360 * * @property * def uid(self): # <<<<<<<<<<<<<< @@ -5725,7 +5706,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_14SFTPAttributes_3uid___get__(struct __pyx PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__", 0); - /* "ssh2/sftp.pyx":359 + /* "ssh2/sftp.pyx":361 * @property * def uid(self): * return self._attrs.uid # <<<<<<<<<<<<<< @@ -5733,13 +5714,13 @@ static PyObject *__pyx_pf_4ssh2_4sftp_14SFTPAttributes_3uid___get__(struct __pyx * @uid.setter */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_unsigned_long(__pyx_v_self->_attrs->uid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 359, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_unsigned_long(__pyx_v_self->_attrs->uid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/sftp.pyx":358 + /* "ssh2/sftp.pyx":360 * * @property * def uid(self): # <<<<<<<<<<<<<< @@ -5758,7 +5739,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_14SFTPAttributes_3uid___get__(struct __pyx return __pyx_r; } -/* "ssh2/sftp.pyx":362 +/* "ssh2/sftp.pyx":364 * * @uid.setter * def uid(self, unsigned long uid): # <<<<<<<<<<<<<< @@ -5774,7 +5755,7 @@ static int __pyx_pw_4ssh2_4sftp_14SFTPAttributes_3uid_3__set__(PyObject *__pyx_v __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); assert(__pyx_arg_uid); { - __pyx_v_uid = __Pyx_PyInt_As_unsigned_long(__pyx_arg_uid); if (unlikely((__pyx_v_uid == (unsigned long)-1) && PyErr_Occurred())) __PYX_ERR(0, 362, __pyx_L3_error) + __pyx_v_uid = __Pyx_PyInt_As_unsigned_long(__pyx_arg_uid); if (unlikely((__pyx_v_uid == (unsigned long)-1) && PyErr_Occurred())) __PYX_ERR(0, 364, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -5794,7 +5775,7 @@ static int __pyx_pf_4ssh2_4sftp_14SFTPAttributes_3uid_2__set__(struct __pyx_obj_ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__", 0); - /* "ssh2/sftp.pyx":363 + /* "ssh2/sftp.pyx":365 * @uid.setter * def uid(self, unsigned long uid): * self._attrs.uid = uid # <<<<<<<<<<<<<< @@ -5803,7 +5784,7 @@ static int __pyx_pf_4ssh2_4sftp_14SFTPAttributes_3uid_2__set__(struct __pyx_obj_ */ __pyx_v_self->_attrs->uid = __pyx_v_uid; - /* "ssh2/sftp.pyx":362 + /* "ssh2/sftp.pyx":364 * * @uid.setter * def uid(self, unsigned long uid): # <<<<<<<<<<<<<< @@ -5817,7 +5798,7 @@ static int __pyx_pf_4ssh2_4sftp_14SFTPAttributes_3uid_2__set__(struct __pyx_obj_ return __pyx_r; } -/* "ssh2/sftp.pyx":366 +/* "ssh2/sftp.pyx":368 * * @property * def gid(self): # <<<<<<<<<<<<<< @@ -5844,7 +5825,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_14SFTPAttributes_3gid___get__(struct __pyx PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__", 0); - /* "ssh2/sftp.pyx":367 + /* "ssh2/sftp.pyx":369 * @property * def gid(self): * return self._attrs.gid # <<<<<<<<<<<<<< @@ -5852,13 +5833,13 @@ static PyObject *__pyx_pf_4ssh2_4sftp_14SFTPAttributes_3gid___get__(struct __pyx * @gid.setter */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_unsigned_long(__pyx_v_self->_attrs->gid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 367, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_unsigned_long(__pyx_v_self->_attrs->gid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 369, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/sftp.pyx":366 + /* "ssh2/sftp.pyx":368 * * @property * def gid(self): # <<<<<<<<<<<<<< @@ -5877,7 +5858,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_14SFTPAttributes_3gid___get__(struct __pyx return __pyx_r; } -/* "ssh2/sftp.pyx":370 +/* "ssh2/sftp.pyx":372 * * @gid.setter * def gid(self, unsigned long gid): # <<<<<<<<<<<<<< @@ -5893,7 +5874,7 @@ static int __pyx_pw_4ssh2_4sftp_14SFTPAttributes_3gid_3__set__(PyObject *__pyx_v __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); assert(__pyx_arg_gid); { - __pyx_v_gid = __Pyx_PyInt_As_unsigned_long(__pyx_arg_gid); if (unlikely((__pyx_v_gid == (unsigned long)-1) && PyErr_Occurred())) __PYX_ERR(0, 370, __pyx_L3_error) + __pyx_v_gid = __Pyx_PyInt_As_unsigned_long(__pyx_arg_gid); if (unlikely((__pyx_v_gid == (unsigned long)-1) && PyErr_Occurred())) __PYX_ERR(0, 372, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -5913,7 +5894,7 @@ static int __pyx_pf_4ssh2_4sftp_14SFTPAttributes_3gid_2__set__(struct __pyx_obj_ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__", 0); - /* "ssh2/sftp.pyx":371 + /* "ssh2/sftp.pyx":373 * @gid.setter * def gid(self, unsigned long gid): * self._attrs.gid = gid # <<<<<<<<<<<<<< @@ -5922,7 +5903,7 @@ static int __pyx_pf_4ssh2_4sftp_14SFTPAttributes_3gid_2__set__(struct __pyx_obj_ */ __pyx_v_self->_attrs->gid = __pyx_v_gid; - /* "ssh2/sftp.pyx":370 + /* "ssh2/sftp.pyx":372 * * @gid.setter * def gid(self, unsigned long gid): # <<<<<<<<<<<<<< @@ -5936,7 +5917,7 @@ static int __pyx_pf_4ssh2_4sftp_14SFTPAttributes_3gid_2__set__(struct __pyx_obj_ return __pyx_r; } -/* "ssh2/sftp.pyx":374 +/* "ssh2/sftp.pyx":376 * * @property * def permissions(self): # <<<<<<<<<<<<<< @@ -5963,7 +5944,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_14SFTPAttributes_11permissions___get__(str PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__", 0); - /* "ssh2/sftp.pyx":375 + /* "ssh2/sftp.pyx":377 * @property * def permissions(self): * return self._attrs.permissions # <<<<<<<<<<<<<< @@ -5971,13 +5952,13 @@ static PyObject *__pyx_pf_4ssh2_4sftp_14SFTPAttributes_11permissions___get__(str * @permissions.setter */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_unsigned_long(__pyx_v_self->_attrs->permissions); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 375, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_unsigned_long(__pyx_v_self->_attrs->permissions); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 377, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/sftp.pyx":374 + /* "ssh2/sftp.pyx":376 * * @property * def permissions(self): # <<<<<<<<<<<<<< @@ -5996,7 +5977,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_14SFTPAttributes_11permissions___get__(str return __pyx_r; } -/* "ssh2/sftp.pyx":378 +/* "ssh2/sftp.pyx":380 * * @permissions.setter * def permissions(self, unsigned long permissions): # <<<<<<<<<<<<<< @@ -6012,7 +5993,7 @@ static int __pyx_pw_4ssh2_4sftp_14SFTPAttributes_11permissions_3__set__(PyObject __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); assert(__pyx_arg_permissions); { - __pyx_v_permissions = __Pyx_PyInt_As_unsigned_long(__pyx_arg_permissions); if (unlikely((__pyx_v_permissions == (unsigned long)-1) && PyErr_Occurred())) __PYX_ERR(0, 378, __pyx_L3_error) + __pyx_v_permissions = __Pyx_PyInt_As_unsigned_long(__pyx_arg_permissions); if (unlikely((__pyx_v_permissions == (unsigned long)-1) && PyErr_Occurred())) __PYX_ERR(0, 380, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -6032,7 +6013,7 @@ static int __pyx_pf_4ssh2_4sftp_14SFTPAttributes_11permissions_2__set__(struct _ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__", 0); - /* "ssh2/sftp.pyx":379 + /* "ssh2/sftp.pyx":381 * @permissions.setter * def permissions(self, unsigned long permissions): * self._attrs.permissions = permissions # <<<<<<<<<<<<<< @@ -6041,7 +6022,7 @@ static int __pyx_pf_4ssh2_4sftp_14SFTPAttributes_11permissions_2__set__(struct _ */ __pyx_v_self->_attrs->permissions = __pyx_v_permissions; - /* "ssh2/sftp.pyx":378 + /* "ssh2/sftp.pyx":380 * * @permissions.setter * def permissions(self, unsigned long permissions): # <<<<<<<<<<<<<< @@ -6055,7 +6036,7 @@ static int __pyx_pf_4ssh2_4sftp_14SFTPAttributes_11permissions_2__set__(struct _ return __pyx_r; } -/* "ssh2/sftp.pyx":382 +/* "ssh2/sftp.pyx":384 * * @property * def atime(self): # <<<<<<<<<<<<<< @@ -6082,7 +6063,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_14SFTPAttributes_5atime___get__(struct __p PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__", 0); - /* "ssh2/sftp.pyx":383 + /* "ssh2/sftp.pyx":385 * @property * def atime(self): * return self._attrs.atime # <<<<<<<<<<<<<< @@ -6090,13 +6071,13 @@ static PyObject *__pyx_pf_4ssh2_4sftp_14SFTPAttributes_5atime___get__(struct __p * @atime.setter */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_unsigned_long(__pyx_v_self->_attrs->atime); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 383, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_unsigned_long(__pyx_v_self->_attrs->atime); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 385, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/sftp.pyx":382 + /* "ssh2/sftp.pyx":384 * * @property * def atime(self): # <<<<<<<<<<<<<< @@ -6115,7 +6096,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_14SFTPAttributes_5atime___get__(struct __p return __pyx_r; } -/* "ssh2/sftp.pyx":386 +/* "ssh2/sftp.pyx":388 * * @atime.setter * def atime(self, unsigned long atime): # <<<<<<<<<<<<<< @@ -6131,7 +6112,7 @@ static int __pyx_pw_4ssh2_4sftp_14SFTPAttributes_5atime_3__set__(PyObject *__pyx __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); assert(__pyx_arg_atime); { - __pyx_v_atime = __Pyx_PyInt_As_unsigned_long(__pyx_arg_atime); if (unlikely((__pyx_v_atime == (unsigned long)-1) && PyErr_Occurred())) __PYX_ERR(0, 386, __pyx_L3_error) + __pyx_v_atime = __Pyx_PyInt_As_unsigned_long(__pyx_arg_atime); if (unlikely((__pyx_v_atime == (unsigned long)-1) && PyErr_Occurred())) __PYX_ERR(0, 388, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -6151,7 +6132,7 @@ static int __pyx_pf_4ssh2_4sftp_14SFTPAttributes_5atime_2__set__(struct __pyx_ob __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__", 0); - /* "ssh2/sftp.pyx":387 + /* "ssh2/sftp.pyx":389 * @atime.setter * def atime(self, unsigned long atime): * self._attrs.atime = atime # <<<<<<<<<<<<<< @@ -6160,7 +6141,7 @@ static int __pyx_pf_4ssh2_4sftp_14SFTPAttributes_5atime_2__set__(struct __pyx_ob */ __pyx_v_self->_attrs->atime = __pyx_v_atime; - /* "ssh2/sftp.pyx":386 + /* "ssh2/sftp.pyx":388 * * @atime.setter * def atime(self, unsigned long atime): # <<<<<<<<<<<<<< @@ -6174,7 +6155,7 @@ static int __pyx_pf_4ssh2_4sftp_14SFTPAttributes_5atime_2__set__(struct __pyx_ob return __pyx_r; } -/* "ssh2/sftp.pyx":390 +/* "ssh2/sftp.pyx":392 * * @property * def mtime(self): # <<<<<<<<<<<<<< @@ -6201,7 +6182,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_14SFTPAttributes_5mtime___get__(struct __p PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__", 0); - /* "ssh2/sftp.pyx":391 + /* "ssh2/sftp.pyx":393 * @property * def mtime(self): * return self._attrs.mtime # <<<<<<<<<<<<<< @@ -6209,13 +6190,13 @@ static PyObject *__pyx_pf_4ssh2_4sftp_14SFTPAttributes_5mtime___get__(struct __p * @mtime.setter */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_unsigned_long(__pyx_v_self->_attrs->mtime); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 391, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_unsigned_long(__pyx_v_self->_attrs->mtime); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 393, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/sftp.pyx":390 + /* "ssh2/sftp.pyx":392 * * @property * def mtime(self): # <<<<<<<<<<<<<< @@ -6234,7 +6215,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_14SFTPAttributes_5mtime___get__(struct __p return __pyx_r; } -/* "ssh2/sftp.pyx":394 +/* "ssh2/sftp.pyx":396 * * @mtime.setter * def mtime(self, unsigned long mtime): # <<<<<<<<<<<<<< @@ -6250,7 +6231,7 @@ static int __pyx_pw_4ssh2_4sftp_14SFTPAttributes_5mtime_3__set__(PyObject *__pyx __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); assert(__pyx_arg_mtime); { - __pyx_v_mtime = __Pyx_PyInt_As_unsigned_long(__pyx_arg_mtime); if (unlikely((__pyx_v_mtime == (unsigned long)-1) && PyErr_Occurred())) __PYX_ERR(0, 394, __pyx_L3_error) + __pyx_v_mtime = __Pyx_PyInt_As_unsigned_long(__pyx_arg_mtime); if (unlikely((__pyx_v_mtime == (unsigned long)-1) && PyErr_Occurred())) __PYX_ERR(0, 396, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -6270,7 +6251,7 @@ static int __pyx_pf_4ssh2_4sftp_14SFTPAttributes_5mtime_2__set__(struct __pyx_ob __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__", 0); - /* "ssh2/sftp.pyx":395 + /* "ssh2/sftp.pyx":397 * @mtime.setter * def mtime(self, unsigned long mtime): * self._attrs.mtime = mtime # <<<<<<<<<<<<<< @@ -6279,7 +6260,7 @@ static int __pyx_pf_4ssh2_4sftp_14SFTPAttributes_5mtime_2__set__(struct __pyx_ob */ __pyx_v_self->_attrs->mtime = __pyx_v_mtime; - /* "ssh2/sftp.pyx":394 + /* "ssh2/sftp.pyx":396 * * @mtime.setter * def mtime(self, unsigned long mtime): # <<<<<<<<<<<<<< @@ -6402,7 +6383,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_14SFTPAttributes_6__setstate_cython__(CYTH return __pyx_r; } -/* "ssh2/sftp.pyx":403 +/* "ssh2/sftp.pyx":405 * cdef bint closed * * def __cinit__(self, sftp): # <<<<<<<<<<<<<< @@ -6436,7 +6417,7 @@ static int __pyx_pw_4ssh2_4sftp_10SFTPHandle_1__cinit__(PyObject *__pyx_v_self, else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 403, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 405, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; @@ -6447,7 +6428,7 @@ static int __pyx_pw_4ssh2_4sftp_10SFTPHandle_1__cinit__(PyObject *__pyx_v_self, } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 403, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 405, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.sftp.SFTPHandle.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -6466,7 +6447,7 @@ static int __pyx_pf_4ssh2_4sftp_10SFTPHandle___cinit__(struct __pyx_obj_4ssh2_4s PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "ssh2/sftp.pyx":404 + /* "ssh2/sftp.pyx":406 * * def __cinit__(self, sftp): * self._handle = NULL # <<<<<<<<<<<<<< @@ -6475,14 +6456,14 @@ static int __pyx_pf_4ssh2_4sftp_10SFTPHandle___cinit__(struct __pyx_obj_4ssh2_4s */ __pyx_v_self->_handle = NULL; - /* "ssh2/sftp.pyx":405 + /* "ssh2/sftp.pyx":407 * def __cinit__(self, sftp): * self._handle = NULL * self._sftp = sftp # <<<<<<<<<<<<<< * self.closed = 0 * */ - if (!(likely(((__pyx_v_sftp) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_sftp, __pyx_ptype_4ssh2_4sftp_SFTP))))) __PYX_ERR(0, 405, __pyx_L1_error) + if (!(likely(((__pyx_v_sftp) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_sftp, __pyx_ptype_4ssh2_4sftp_SFTP))))) __PYX_ERR(0, 407, __pyx_L1_error) __pyx_t_1 = __pyx_v_sftp; __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); @@ -6491,7 +6472,7 @@ static int __pyx_pf_4ssh2_4sftp_10SFTPHandle___cinit__(struct __pyx_obj_4ssh2_4s __pyx_v_self->_sftp = ((struct __pyx_obj_4ssh2_4sftp_SFTP *)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/sftp.pyx":406 + /* "ssh2/sftp.pyx":408 * self._handle = NULL * self._sftp = sftp * self.closed = 0 # <<<<<<<<<<<<<< @@ -6500,7 +6481,7 @@ static int __pyx_pf_4ssh2_4sftp_10SFTPHandle___cinit__(struct __pyx_obj_4ssh2_4s */ __pyx_v_self->closed = 0; - /* "ssh2/sftp.pyx":403 + /* "ssh2/sftp.pyx":405 * cdef bint closed * * def __cinit__(self, sftp): # <<<<<<<<<<<<<< @@ -6520,7 +6501,7 @@ static int __pyx_pf_4ssh2_4sftp_10SFTPHandle___cinit__(struct __pyx_obj_4ssh2_4s return __pyx_r; } -/* "ssh2/sftp.pyx":408 +/* "ssh2/sftp.pyx":410 * self.closed = 0 * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -6544,7 +6525,7 @@ static void __pyx_pf_4ssh2_4sftp_10SFTPHandle_2__dealloc__(struct __pyx_obj_4ssh int __pyx_t_1; __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "ssh2/sftp.pyx":409 + /* "ssh2/sftp.pyx":411 * * def __dealloc__(self): * if self.closed == 0: # <<<<<<<<<<<<<< @@ -6554,7 +6535,7 @@ static void __pyx_pf_4ssh2_4sftp_10SFTPHandle_2__dealloc__(struct __pyx_obj_4ssh __pyx_t_1 = ((__pyx_v_self->closed == 0) != 0); if (__pyx_t_1) { - /* "ssh2/sftp.pyx":410 + /* "ssh2/sftp.pyx":412 * def __dealloc__(self): * if self.closed == 0: * with nogil: # <<<<<<<<<<<<<< @@ -6569,7 +6550,7 @@ static void __pyx_pf_4ssh2_4sftp_10SFTPHandle_2__dealloc__(struct __pyx_obj_4ssh #endif /*try:*/ { - /* "ssh2/sftp.pyx":411 + /* "ssh2/sftp.pyx":413 * if self.closed == 0: * with nogil: * c_sftp.libssh2_sftp_close_handle(self._handle) # <<<<<<<<<<<<<< @@ -6579,7 +6560,7 @@ static void __pyx_pf_4ssh2_4sftp_10SFTPHandle_2__dealloc__(struct __pyx_obj_4ssh libssh2_sftp_close_handle(__pyx_v_self->_handle); } - /* "ssh2/sftp.pyx":410 + /* "ssh2/sftp.pyx":412 * def __dealloc__(self): * if self.closed == 0: * with nogil: # <<<<<<<<<<<<<< @@ -6598,7 +6579,7 @@ static void __pyx_pf_4ssh2_4sftp_10SFTPHandle_2__dealloc__(struct __pyx_obj_4ssh } } - /* "ssh2/sftp.pyx":412 + /* "ssh2/sftp.pyx":414 * with nogil: * c_sftp.libssh2_sftp_close_handle(self._handle) * self.closed = 1 # <<<<<<<<<<<<<< @@ -6607,7 +6588,7 @@ static void __pyx_pf_4ssh2_4sftp_10SFTPHandle_2__dealloc__(struct __pyx_obj_4ssh */ __pyx_v_self->closed = 1; - /* "ssh2/sftp.pyx":409 + /* "ssh2/sftp.pyx":411 * * def __dealloc__(self): * if self.closed == 0: # <<<<<<<<<<<<<< @@ -6616,7 +6597,7 @@ static void __pyx_pf_4ssh2_4sftp_10SFTPHandle_2__dealloc__(struct __pyx_obj_4ssh */ } - /* "ssh2/sftp.pyx":408 + /* "ssh2/sftp.pyx":410 * self.closed = 0 * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -6628,7 +6609,7 @@ static void __pyx_pf_4ssh2_4sftp_10SFTPHandle_2__dealloc__(struct __pyx_obj_4ssh __Pyx_RefNannyFinishContext(); } -/* "ssh2/sftp.pyx":414 +/* "ssh2/sftp.pyx":416 * self.closed = 1 * * def __iter__(self): # <<<<<<<<<<<<<< @@ -6654,7 +6635,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_4__iter__(struct __pyx_obj_4s __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__iter__", 0); - /* "ssh2/sftp.pyx":415 + /* "ssh2/sftp.pyx":417 * * def __iter__(self): * return self # <<<<<<<<<<<<<< @@ -6666,7 +6647,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_4__iter__(struct __pyx_obj_4s __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; - /* "ssh2/sftp.pyx":414 + /* "ssh2/sftp.pyx":416 * self.closed = 1 * * def __iter__(self): # <<<<<<<<<<<<<< @@ -6681,7 +6662,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_4__iter__(struct __pyx_obj_4s return __pyx_r; } -/* "ssh2/sftp.pyx":417 +/* "ssh2/sftp.pyx":419 * return self * * def __next__(self): # <<<<<<<<<<<<<< @@ -6713,14 +6694,14 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_6__next__(struct __pyx_obj_4s int __pyx_t_5; __Pyx_RefNannySetupContext("__next__", 0); - /* "ssh2/sftp.pyx":418 + /* "ssh2/sftp.pyx":420 * * def __next__(self): * cdef bytes data = self.read() # <<<<<<<<<<<<<< * if len(data) == 0: * raise StopIteration */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_read); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 418, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_read); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 420, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { @@ -6733,18 +6714,18 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_6__next__(struct __pyx_obj_4s } } if (__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 418, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 420, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 418, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 420, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 418, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 420, __pyx_L1_error) __pyx_v_data = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/sftp.pyx":419 + /* "ssh2/sftp.pyx":421 * def __next__(self): * cdef bytes data = self.read() * if len(data) == 0: # <<<<<<<<<<<<<< @@ -6753,13 +6734,13 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_6__next__(struct __pyx_obj_4s */ if (unlikely(__pyx_v_data == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 419, __pyx_L1_error) + __PYX_ERR(0, 421, __pyx_L1_error) } - __pyx_t_4 = PyBytes_GET_SIZE(__pyx_v_data); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 419, __pyx_L1_error) + __pyx_t_4 = PyBytes_GET_SIZE(__pyx_v_data); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 421, __pyx_L1_error) __pyx_t_5 = ((__pyx_t_4 == 0) != 0); if (__pyx_t_5) { - /* "ssh2/sftp.pyx":420 + /* "ssh2/sftp.pyx":422 * cdef bytes data = self.read() * if len(data) == 0: * raise StopIteration # <<<<<<<<<<<<<< @@ -6767,9 +6748,9 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_6__next__(struct __pyx_obj_4s * */ __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0); - __PYX_ERR(0, 420, __pyx_L1_error) + __PYX_ERR(0, 422, __pyx_L1_error) - /* "ssh2/sftp.pyx":419 + /* "ssh2/sftp.pyx":421 * def __next__(self): * cdef bytes data = self.read() * if len(data) == 0: # <<<<<<<<<<<<<< @@ -6778,7 +6759,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_6__next__(struct __pyx_obj_4s */ } - /* "ssh2/sftp.pyx":421 + /* "ssh2/sftp.pyx":423 * if len(data) == 0: * raise StopIteration * return data # <<<<<<<<<<<<<< @@ -6790,7 +6771,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_6__next__(struct __pyx_obj_4s __pyx_r = __pyx_v_data; goto __pyx_L0; - /* "ssh2/sftp.pyx":417 + /* "ssh2/sftp.pyx":419 * return self * * def __next__(self): # <<<<<<<<<<<<<< @@ -6812,7 +6793,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_6__next__(struct __pyx_obj_4s return __pyx_r; } -/* "ssh2/sftp.pyx":423 +/* "ssh2/sftp.pyx":425 * return data * * def __enter__(self): # <<<<<<<<<<<<<< @@ -6839,7 +6820,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_8__enter__(struct __pyx_obj_4 __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__enter__", 0); - /* "ssh2/sftp.pyx":424 + /* "ssh2/sftp.pyx":426 * * def __enter__(self): * return self # <<<<<<<<<<<<<< @@ -6851,7 +6832,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_8__enter__(struct __pyx_obj_4 __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; - /* "ssh2/sftp.pyx":423 + /* "ssh2/sftp.pyx":425 * return data * * def __enter__(self): # <<<<<<<<<<<<<< @@ -6866,7 +6847,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_8__enter__(struct __pyx_obj_4 return __pyx_r; } -/* "ssh2/sftp.pyx":426 +/* "ssh2/sftp.pyx":428 * return self * * def __exit__(self, *args): # <<<<<<<<<<<<<< @@ -6901,14 +6882,14 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_10__exit__(struct __pyx_obj_4 PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("__exit__", 0); - /* "ssh2/sftp.pyx":427 + /* "ssh2/sftp.pyx":429 * * def __exit__(self, *args): * self.close() # <<<<<<<<<<<<<< * * def close(self): */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 427, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 429, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { @@ -6921,16 +6902,16 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_10__exit__(struct __pyx_obj_4 } } if (__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 427, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 429, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 427, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 429, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/sftp.pyx":426 + /* "ssh2/sftp.pyx":428 * return self * * def __exit__(self, *args): # <<<<<<<<<<<<<< @@ -6953,7 +6934,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_10__exit__(struct __pyx_obj_4 return __pyx_r; } -/* "ssh2/sftp.pyx":429 +/* "ssh2/sftp.pyx":431 * self.close() * * def close(self): # <<<<<<<<<<<<<< @@ -6983,7 +6964,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_12close(struct __pyx_obj_4ssh PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("close", 0); - /* "ssh2/sftp.pyx":431 + /* "ssh2/sftp.pyx":433 * def close(self): * cdef int rc * if self.closed == 0: # <<<<<<<<<<<<<< @@ -6993,7 +6974,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_12close(struct __pyx_obj_4ssh __pyx_t_1 = ((__pyx_v_self->closed == 0) != 0); if (__pyx_t_1) { - /* "ssh2/sftp.pyx":432 + /* "ssh2/sftp.pyx":434 * cdef int rc * if self.closed == 0: * with nogil: # <<<<<<<<<<<<<< @@ -7008,7 +6989,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_12close(struct __pyx_obj_4ssh #endif /*try:*/ { - /* "ssh2/sftp.pyx":433 + /* "ssh2/sftp.pyx":435 * if self.closed == 0: * with nogil: * rc = c_sftp.libssh2_sftp_close_handle(self._handle) # <<<<<<<<<<<<<< @@ -7018,7 +6999,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_12close(struct __pyx_obj_4ssh __pyx_v_rc = libssh2_sftp_close_handle(__pyx_v_self->_handle); } - /* "ssh2/sftp.pyx":432 + /* "ssh2/sftp.pyx":434 * cdef int rc * if self.closed == 0: * with nogil: # <<<<<<<<<<<<<< @@ -7037,7 +7018,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_12close(struct __pyx_obj_4ssh } } - /* "ssh2/sftp.pyx":434 + /* "ssh2/sftp.pyx":436 * with nogil: * rc = c_sftp.libssh2_sftp_close_handle(self._handle) * self.closed = 1 # <<<<<<<<<<<<<< @@ -7046,7 +7027,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_12close(struct __pyx_obj_4ssh */ __pyx_v_self->closed = 1; - /* "ssh2/sftp.pyx":431 + /* "ssh2/sftp.pyx":433 * def close(self): * cdef int rc * if self.closed == 0: # <<<<<<<<<<<<<< @@ -7056,7 +7037,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_12close(struct __pyx_obj_4ssh goto __pyx_L3; } - /* "ssh2/sftp.pyx":436 + /* "ssh2/sftp.pyx":438 * self.closed = 1 * else: * return # <<<<<<<<<<<<<< @@ -7070,7 +7051,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_12close(struct __pyx_obj_4ssh } __pyx_L3:; - /* "ssh2/sftp.pyx":437 + /* "ssh2/sftp.pyx":439 * else: * return * return rc # <<<<<<<<<<<<<< @@ -7078,13 +7059,13 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_12close(struct __pyx_obj_4ssh * def read(self, size_t buffer_maxlen=c_ssh2._LIBSSH2_CHANNEL_WINDOW_DEFAULT): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 437, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 439, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "ssh2/sftp.pyx":429 + /* "ssh2/sftp.pyx":431 * self.close() * * def close(self): # <<<<<<<<<<<<<< @@ -7103,7 +7084,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_12close(struct __pyx_obj_4ssh return __pyx_r; } -/* "ssh2/sftp.pyx":439 +/* "ssh2/sftp.pyx":441 * return rc * * def read(self, size_t buffer_maxlen=c_ssh2._LIBSSH2_CHANNEL_WINDOW_DEFAULT): # <<<<<<<<<<<<<< @@ -7140,7 +7121,7 @@ static PyObject *__pyx_pw_4ssh2_4sftp_10SFTPHandle_15read(PyObject *__pyx_v_self } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "read") < 0)) __PYX_ERR(0, 439, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "read") < 0)) __PYX_ERR(0, 441, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -7151,14 +7132,14 @@ static PyObject *__pyx_pw_4ssh2_4sftp_10SFTPHandle_15read(PyObject *__pyx_v_self } } if (values[0]) { - __pyx_v_buffer_maxlen = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_buffer_maxlen == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 439, __pyx_L3_error) + __pyx_v_buffer_maxlen = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_buffer_maxlen == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 441, __pyx_L3_error) } else { __pyx_v_buffer_maxlen = __pyx_k__5; } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("read", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 439, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("read", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 441, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.sftp.SFTPHandle.read", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -7190,7 +7171,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_14read(struct __pyx_obj_4ssh2 PyObject *__pyx_t_11 = NULL; __Pyx_RefNannySetupContext("read", 0); - /* "ssh2/sftp.pyx":443 + /* "ssh2/sftp.pyx":445 * cdef bytes buf * cdef char *cbuf * with nogil: # <<<<<<<<<<<<<< @@ -7205,7 +7186,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_14read(struct __pyx_obj_4ssh2 #endif /*try:*/ { - /* "ssh2/sftp.pyx":444 + /* "ssh2/sftp.pyx":446 * cdef char *cbuf * with nogil: * cbuf = malloc(sizeof(char)*buffer_maxlen) # <<<<<<<<<<<<<< @@ -7214,7 +7195,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_14read(struct __pyx_obj_4ssh2 */ __pyx_v_cbuf = ((char *)malloc(((sizeof(char)) * __pyx_v_buffer_maxlen))); - /* "ssh2/sftp.pyx":445 + /* "ssh2/sftp.pyx":447 * with nogil: * cbuf = malloc(sizeof(char)*buffer_maxlen) * if cbuf is NULL: # <<<<<<<<<<<<<< @@ -7224,7 +7205,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_14read(struct __pyx_obj_4ssh2 __pyx_t_1 = ((__pyx_v_cbuf == NULL) != 0); if (__pyx_t_1) { - /* "ssh2/sftp.pyx":446 + /* "ssh2/sftp.pyx":448 * cbuf = malloc(sizeof(char)*buffer_maxlen) * if cbuf is NULL: * with gil: # <<<<<<<<<<<<<< @@ -7237,17 +7218,17 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_14read(struct __pyx_obj_4ssh2 #endif /*try:*/ { - /* "ssh2/sftp.pyx":447 + /* "ssh2/sftp.pyx":449 * if cbuf is NULL: * with gil: * raise MemoryError # <<<<<<<<<<<<<< * rc = c_sftp.libssh2_sftp_read( * self._handle, cbuf, buffer_maxlen) */ - PyErr_NoMemory(); __PYX_ERR(0, 447, __pyx_L8_error) + PyErr_NoMemory(); __PYX_ERR(0, 449, __pyx_L8_error) } - /* "ssh2/sftp.pyx":446 + /* "ssh2/sftp.pyx":448 * cbuf = malloc(sizeof(char)*buffer_maxlen) * if cbuf is NULL: * with gil: # <<<<<<<<<<<<<< @@ -7264,7 +7245,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_14read(struct __pyx_obj_4ssh2 } } - /* "ssh2/sftp.pyx":445 + /* "ssh2/sftp.pyx":447 * with nogil: * cbuf = malloc(sizeof(char)*buffer_maxlen) * if cbuf is NULL: # <<<<<<<<<<<<<< @@ -7273,7 +7254,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_14read(struct __pyx_obj_4ssh2 */ } - /* "ssh2/sftp.pyx":448 + /* "ssh2/sftp.pyx":450 * with gil: * raise MemoryError * rc = c_sftp.libssh2_sftp_read( # <<<<<<<<<<<<<< @@ -7283,7 +7264,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_14read(struct __pyx_obj_4ssh2 __pyx_v_rc = libssh2_sftp_read(__pyx_v_self->_handle, __pyx_v_cbuf, __pyx_v_buffer_maxlen); } - /* "ssh2/sftp.pyx":443 + /* "ssh2/sftp.pyx":445 * cdef bytes buf * cdef char *cbuf * with nogil: # <<<<<<<<<<<<<< @@ -7309,7 +7290,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_14read(struct __pyx_obj_4ssh2 } } - /* "ssh2/sftp.pyx":450 + /* "ssh2/sftp.pyx":452 * rc = c_sftp.libssh2_sftp_read( * self._handle, cbuf, buffer_maxlen) * try: # <<<<<<<<<<<<<< @@ -7318,7 +7299,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_14read(struct __pyx_obj_4ssh2 */ /*try:*/ { - /* "ssh2/sftp.pyx":451 + /* "ssh2/sftp.pyx":453 * self._handle, cbuf, buffer_maxlen) * try: * if rc > 0: # <<<<<<<<<<<<<< @@ -7328,19 +7309,19 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_14read(struct __pyx_obj_4ssh2 __pyx_t_1 = ((__pyx_v_rc > 0) != 0); if (__pyx_t_1) { - /* "ssh2/sftp.pyx":452 + /* "ssh2/sftp.pyx":454 * try: * if rc > 0: * buf = cbuf[:rc] # <<<<<<<<<<<<<< * else: * buf = b'' */ - __pyx_t_2 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_cbuf + 0, __pyx_v_rc - 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 452, __pyx_L11_error) + __pyx_t_2 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_cbuf + 0, __pyx_v_rc - 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 454, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_buf = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "ssh2/sftp.pyx":451 + /* "ssh2/sftp.pyx":453 * self._handle, cbuf, buffer_maxlen) * try: * if rc > 0: # <<<<<<<<<<<<<< @@ -7350,7 +7331,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_14read(struct __pyx_obj_4ssh2 goto __pyx_L13; } - /* "ssh2/sftp.pyx":454 + /* "ssh2/sftp.pyx":456 * buf = cbuf[:rc] * else: * buf = b'' # <<<<<<<<<<<<<< @@ -7364,7 +7345,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_14read(struct __pyx_obj_4ssh2 __pyx_L13:; } - /* "ssh2/sftp.pyx":456 + /* "ssh2/sftp.pyx":458 * buf = b'' * finally: * free(cbuf) # <<<<<<<<<<<<<< @@ -7412,7 +7393,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_14read(struct __pyx_obj_4ssh2 __pyx_L12:; } - /* "ssh2/sftp.pyx":457 + /* "ssh2/sftp.pyx":459 * finally: * free(cbuf) * return buf # <<<<<<<<<<<<<< @@ -7424,7 +7405,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_14read(struct __pyx_obj_4ssh2 __pyx_r = __pyx_v_buf; goto __pyx_L0; - /* "ssh2/sftp.pyx":439 + /* "ssh2/sftp.pyx":441 * return rc * * def read(self, size_t buffer_maxlen=c_ssh2._LIBSSH2_CHANNEL_WINDOW_DEFAULT): # <<<<<<<<<<<<<< @@ -7444,7 +7425,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_14read(struct __pyx_obj_4ssh2 return __pyx_r; } -/* "ssh2/sftp.pyx":459 +/* "ssh2/sftp.pyx":461 * return buf * * def readdir_ex(self, char *buffer, size_t buffer_maxlen, # <<<<<<<<<<<<<< @@ -7493,29 +7474,29 @@ static PyObject *__pyx_pw_4ssh2_4sftp_10SFTPHandle_17readdir_ex(PyObject *__pyx_ case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_buffer_maxlen)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("readdir_ex", 1, 5, 5, 1); __PYX_ERR(0, 459, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("readdir_ex", 1, 5, 5, 1); __PYX_ERR(0, 461, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_longentry)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("readdir_ex", 1, 5, 5, 2); __PYX_ERR(0, 459, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("readdir_ex", 1, 5, 5, 2); __PYX_ERR(0, 461, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_longentry_maxlen)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("readdir_ex", 1, 5, 5, 3); __PYX_ERR(0, 459, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("readdir_ex", 1, 5, 5, 3); __PYX_ERR(0, 461, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_attrs)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("readdir_ex", 1, 5, 5, 4); __PYX_ERR(0, 459, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("readdir_ex", 1, 5, 5, 4); __PYX_ERR(0, 461, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "readdir_ex") < 0)) __PYX_ERR(0, 459, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "readdir_ex") < 0)) __PYX_ERR(0, 461, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 5) { goto __pyx_L5_argtuple_error; @@ -7526,21 +7507,21 @@ static PyObject *__pyx_pw_4ssh2_4sftp_10SFTPHandle_17readdir_ex(PyObject *__pyx_ values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[4] = PyTuple_GET_ITEM(__pyx_args, 4); } - __pyx_v_buffer = __Pyx_PyObject_AsWritableString(values[0]); if (unlikely((!__pyx_v_buffer) && PyErr_Occurred())) __PYX_ERR(0, 459, __pyx_L3_error) - __pyx_v_buffer_maxlen = __Pyx_PyInt_As_size_t(values[1]); if (unlikely((__pyx_v_buffer_maxlen == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 459, __pyx_L3_error) - __pyx_v_longentry = __Pyx_PyObject_AsWritableString(values[2]); if (unlikely((!__pyx_v_longentry) && PyErr_Occurred())) __PYX_ERR(0, 460, __pyx_L3_error) - __pyx_v_longentry_maxlen = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_longentry_maxlen == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 461, __pyx_L3_error) + __pyx_v_buffer = __Pyx_PyObject_AsWritableString(values[0]); if (unlikely((!__pyx_v_buffer) && PyErr_Occurred())) __PYX_ERR(0, 461, __pyx_L3_error) + __pyx_v_buffer_maxlen = __Pyx_PyInt_As_size_t(values[1]); if (unlikely((__pyx_v_buffer_maxlen == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 461, __pyx_L3_error) + __pyx_v_longentry = __Pyx_PyObject_AsWritableString(values[2]); if (unlikely((!__pyx_v_longentry) && PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L3_error) + __pyx_v_longentry_maxlen = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_longentry_maxlen == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 463, __pyx_L3_error) __pyx_v_attrs = ((struct __pyx_obj_4ssh2_4sftp_SFTPAttributes *)values[4]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("readdir_ex", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 459, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("readdir_ex", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 461, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.sftp.SFTPHandle.readdir_ex", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_attrs), __pyx_ptype_4ssh2_4sftp_SFTPAttributes, 1, "attrs", 0))) __PYX_ERR(0, 462, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_attrs), __pyx_ptype_4ssh2_4sftp_SFTPAttributes, 1, "attrs", 0))) __PYX_ERR(0, 464, __pyx_L1_error) __pyx_r = __pyx_pf_4ssh2_4sftp_10SFTPHandle_16readdir_ex(((struct __pyx_obj_4ssh2_4sftp_SFTPHandle *)__pyx_v_self), __pyx_v_buffer, __pyx_v_buffer_maxlen, __pyx_v_longentry, __pyx_v_longentry_maxlen, __pyx_v_attrs); /* function exit code */ @@ -7557,7 +7538,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_16readdir_ex(CYTHON_UNUSED st __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("readdir_ex", 0); - /* "ssh2/sftp.pyx":464 + /* "ssh2/sftp.pyx":466 * SFTPAttributes attrs): * cdef char *cbuf * raise NotImplementedError # <<<<<<<<<<<<<< @@ -7565,9 +7546,9 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_16readdir_ex(CYTHON_UNUSED st * def readdir(self, SFTPAttributes attrs, */ __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); - __PYX_ERR(0, 464, __pyx_L1_error) + __PYX_ERR(0, 466, __pyx_L1_error) - /* "ssh2/sftp.pyx":459 + /* "ssh2/sftp.pyx":461 * return buf * * def readdir_ex(self, char *buffer, size_t buffer_maxlen, # <<<<<<<<<<<<<< @@ -7584,7 +7565,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_16readdir_ex(CYTHON_UNUSED st return __pyx_r; } -/* "ssh2/sftp.pyx":466 +/* "ssh2/sftp.pyx":468 * raise NotImplementedError * * def readdir(self, SFTPAttributes attrs, # <<<<<<<<<<<<<< @@ -7628,7 +7609,7 @@ static PyObject *__pyx_pw_4ssh2_4sftp_10SFTPHandle_19readdir(PyObject *__pyx_v_s } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "readdir") < 0)) __PYX_ERR(0, 466, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "readdir") < 0)) __PYX_ERR(0, 468, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -7641,20 +7622,20 @@ static PyObject *__pyx_pw_4ssh2_4sftp_10SFTPHandle_19readdir(PyObject *__pyx_v_s } __pyx_v_attrs = ((struct __pyx_obj_4ssh2_4sftp_SFTPAttributes *)values[0]); if (values[1]) { - __pyx_v_buffer_maxlen = __Pyx_PyInt_As_size_t(values[1]); if (unlikely((__pyx_v_buffer_maxlen == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 467, __pyx_L3_error) + __pyx_v_buffer_maxlen = __Pyx_PyInt_As_size_t(values[1]); if (unlikely((__pyx_v_buffer_maxlen == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 469, __pyx_L3_error) } else { __pyx_v_buffer_maxlen = __pyx_k__7; } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("readdir", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 466, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("readdir", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 468, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.sftp.SFTPHandle.readdir", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_attrs), __pyx_ptype_4ssh2_4sftp_SFTPAttributes, 1, "attrs", 0))) __PYX_ERR(0, 466, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_attrs), __pyx_ptype_4ssh2_4sftp_SFTPAttributes, 1, "attrs", 0))) __PYX_ERR(0, 468, __pyx_L1_error) __pyx_r = __pyx_pf_4ssh2_4sftp_10SFTPHandle_18readdir(((struct __pyx_obj_4ssh2_4sftp_SFTPHandle *)__pyx_v_self), __pyx_v_attrs, __pyx_v_buffer_maxlen); /* function exit code */ @@ -7671,7 +7652,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_18readdir(CYTHON_UNUSED struc __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("readdir", 0); - /* "ssh2/sftp.pyx":469 + /* "ssh2/sftp.pyx":471 * size_t buffer_maxlen=c_ssh2._LIBSSH2_CHANNEL_WINDOW_DEFAULT): * cdef char *cbuf * raise NotImplementedError # <<<<<<<<<<<<<< @@ -7679,9 +7660,9 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_18readdir(CYTHON_UNUSED struc * def write(self, bytes buf): */ __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); - __PYX_ERR(0, 469, __pyx_L1_error) + __PYX_ERR(0, 471, __pyx_L1_error) - /* "ssh2/sftp.pyx":466 + /* "ssh2/sftp.pyx":468 * raise NotImplementedError * * def readdir(self, SFTPAttributes attrs, # <<<<<<<<<<<<<< @@ -7698,7 +7679,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_18readdir(CYTHON_UNUSED struc return __pyx_r; } -/* "ssh2/sftp.pyx":471 +/* "ssh2/sftp.pyx":473 * raise NotImplementedError * * def write(self, bytes buf): # <<<<<<<<<<<<<< @@ -7713,7 +7694,7 @@ static PyObject *__pyx_pw_4ssh2_4sftp_10SFTPHandle_21write(PyObject *__pyx_v_sel PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("write (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_buf), (&PyBytes_Type), 1, "buf", 1))) __PYX_ERR(0, 471, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_buf), (&PyBytes_Type), 1, "buf", 1))) __PYX_ERR(0, 473, __pyx_L1_error) __pyx_r = __pyx_pf_4ssh2_4sftp_10SFTPHandle_20write(((struct __pyx_obj_4ssh2_4sftp_SFTPHandle *)__pyx_v_self), ((PyObject*)__pyx_v_buf)); /* function exit code */ @@ -7736,7 +7717,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_20write(struct __pyx_obj_4ssh PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("write", 0); - /* "ssh2/sftp.pyx":472 + /* "ssh2/sftp.pyx":474 * * def write(self, bytes buf): * cdef size_t _size = len(buf) # <<<<<<<<<<<<<< @@ -7745,22 +7726,22 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_20write(struct __pyx_obj_4ssh */ if (unlikely(__pyx_v_buf == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 472, __pyx_L1_error) + __PYX_ERR(0, 474, __pyx_L1_error) } - __pyx_t_1 = PyBytes_GET_SIZE(__pyx_v_buf); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_1 = PyBytes_GET_SIZE(__pyx_v_buf); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 474, __pyx_L1_error) __pyx_v__size = __pyx_t_1; - /* "ssh2/sftp.pyx":473 + /* "ssh2/sftp.pyx":475 * def write(self, bytes buf): * cdef size_t _size = len(buf) * cdef char *cbuf = buf # <<<<<<<<<<<<<< * cdef ssize_t rc * with nogil: */ - __pyx_t_2 = __Pyx_PyObject_AsWritableString(__pyx_v_buf); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 473, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_AsWritableString(__pyx_v_buf); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 475, __pyx_L1_error) __pyx_v_cbuf = __pyx_t_2; - /* "ssh2/sftp.pyx":475 + /* "ssh2/sftp.pyx":477 * cdef char *cbuf = buf * cdef ssize_t rc * with nogil: # <<<<<<<<<<<<<< @@ -7775,7 +7756,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_20write(struct __pyx_obj_4ssh #endif /*try:*/ { - /* "ssh2/sftp.pyx":476 + /* "ssh2/sftp.pyx":478 * cdef ssize_t rc * with nogil: * rc = c_sftp.libssh2_sftp_write(self._handle, cbuf, _size) # <<<<<<<<<<<<<< @@ -7785,7 +7766,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_20write(struct __pyx_obj_4ssh __pyx_v_rc = libssh2_sftp_write(__pyx_v_self->_handle, __pyx_v_cbuf, __pyx_v__size); } - /* "ssh2/sftp.pyx":475 + /* "ssh2/sftp.pyx":477 * cdef char *cbuf = buf * cdef ssize_t rc * with nogil: # <<<<<<<<<<<<<< @@ -7804,7 +7785,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_20write(struct __pyx_obj_4ssh } } - /* "ssh2/sftp.pyx":477 + /* "ssh2/sftp.pyx":479 * with nogil: * rc = c_sftp.libssh2_sftp_write(self._handle, cbuf, _size) * return rc # <<<<<<<<<<<<<< @@ -7812,13 +7793,13 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_20write(struct __pyx_obj_4ssh * def fsync(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_rc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 477, __pyx_L1_error) + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_rc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 479, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - /* "ssh2/sftp.pyx":471 + /* "ssh2/sftp.pyx":473 * raise NotImplementedError * * def write(self, bytes buf): # <<<<<<<<<<<<<< @@ -7837,7 +7818,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_20write(struct __pyx_obj_4ssh return __pyx_r; } -/* "ssh2/sftp.pyx":479 +/* "ssh2/sftp.pyx":481 * return rc * * def fsync(self): # <<<<<<<<<<<<<< @@ -7864,7 +7845,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_22fsync(CYTHON_UNUSED struct __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("fsync", 0); - /* "ssh2/sftp.pyx":480 + /* "ssh2/sftp.pyx":482 * * def fsync(self): * raise NotImplementedError # <<<<<<<<<<<<<< @@ -7872,9 +7853,9 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_22fsync(CYTHON_UNUSED struct * def seek(self, size_t offset): */ __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); - __PYX_ERR(0, 480, __pyx_L1_error) + __PYX_ERR(0, 482, __pyx_L1_error) - /* "ssh2/sftp.pyx":479 + /* "ssh2/sftp.pyx":481 * return rc * * def fsync(self): # <<<<<<<<<<<<<< @@ -7891,7 +7872,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_22fsync(CYTHON_UNUSED struct return __pyx_r; } -/* "ssh2/sftp.pyx":482 +/* "ssh2/sftp.pyx":484 * raise NotImplementedError * * def seek(self, size_t offset): # <<<<<<<<<<<<<< @@ -7908,7 +7889,7 @@ static PyObject *__pyx_pw_4ssh2_4sftp_10SFTPHandle_25seek(PyObject *__pyx_v_self __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("seek (wrapper)", 0); assert(__pyx_arg_offset); { - __pyx_v_offset = __Pyx_PyInt_As_size_t(__pyx_arg_offset); if (unlikely((__pyx_v_offset == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 482, __pyx_L3_error) + __pyx_v_offset = __Pyx_PyInt_As_size_t(__pyx_arg_offset); if (unlikely((__pyx_v_offset == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 484, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -7928,7 +7909,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_24seek(struct __pyx_obj_4ssh2 __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("seek", 0); - /* "ssh2/sftp.pyx":483 + /* "ssh2/sftp.pyx":485 * * def seek(self, size_t offset): * with nogil: # <<<<<<<<<<<<<< @@ -7943,7 +7924,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_24seek(struct __pyx_obj_4ssh2 #endif /*try:*/ { - /* "ssh2/sftp.pyx":484 + /* "ssh2/sftp.pyx":486 * def seek(self, size_t offset): * with nogil: * c_sftp.libssh2_sftp_seek(self._handle, offset) # <<<<<<<<<<<<<< @@ -7953,7 +7934,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_24seek(struct __pyx_obj_4ssh2 libssh2_sftp_seek(__pyx_v_self->_handle, __pyx_v_offset); } - /* "ssh2/sftp.pyx":483 + /* "ssh2/sftp.pyx":485 * * def seek(self, size_t offset): * with nogil: # <<<<<<<<<<<<<< @@ -7972,7 +7953,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_24seek(struct __pyx_obj_4ssh2 } } - /* "ssh2/sftp.pyx":482 + /* "ssh2/sftp.pyx":484 * raise NotImplementedError * * def seek(self, size_t offset): # <<<<<<<<<<<<<< @@ -7987,7 +7968,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_24seek(struct __pyx_obj_4ssh2 return __pyx_r; } -/* "ssh2/sftp.pyx":486 +/* "ssh2/sftp.pyx":488 * c_sftp.libssh2_sftp_seek(self._handle, offset) * * def seek64(self, uint64_t offset): # <<<<<<<<<<<<<< @@ -8004,7 +7985,7 @@ static PyObject *__pyx_pw_4ssh2_4sftp_10SFTPHandle_27seek64(PyObject *__pyx_v_se __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("seek64 (wrapper)", 0); assert(__pyx_arg_offset); { - __pyx_v_offset = __Pyx_PyInt_As_uint64_t(__pyx_arg_offset); if (unlikely((__pyx_v_offset == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 486, __pyx_L3_error) + __pyx_v_offset = __Pyx_PyInt_As_uint64_t(__pyx_arg_offset); if (unlikely((__pyx_v_offset == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 488, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -8024,7 +8005,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_26seek64(struct __pyx_obj_4ss __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("seek64", 0); - /* "ssh2/sftp.pyx":487 + /* "ssh2/sftp.pyx":489 * * def seek64(self, uint64_t offset): * with nogil: # <<<<<<<<<<<<<< @@ -8039,7 +8020,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_26seek64(struct __pyx_obj_4ss #endif /*try:*/ { - /* "ssh2/sftp.pyx":488 + /* "ssh2/sftp.pyx":490 * def seek64(self, uint64_t offset): * with nogil: * c_sftp.libssh2_sftp_seek64(self._handle, offset) # <<<<<<<<<<<<<< @@ -8049,7 +8030,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_26seek64(struct __pyx_obj_4ss libssh2_sftp_seek64(__pyx_v_self->_handle, __pyx_v_offset); } - /* "ssh2/sftp.pyx":487 + /* "ssh2/sftp.pyx":489 * * def seek64(self, uint64_t offset): * with nogil: # <<<<<<<<<<<<<< @@ -8068,7 +8049,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_26seek64(struct __pyx_obj_4ss } } - /* "ssh2/sftp.pyx":486 + /* "ssh2/sftp.pyx":488 * c_sftp.libssh2_sftp_seek(self._handle, offset) * * def seek64(self, uint64_t offset): # <<<<<<<<<<<<<< @@ -8083,7 +8064,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_26seek64(struct __pyx_obj_4ss return __pyx_r; } -/* "ssh2/sftp.pyx":490 +/* "ssh2/sftp.pyx":492 * c_sftp.libssh2_sftp_seek64(self._handle, offset) * * def rewind(self): # <<<<<<<<<<<<<< @@ -8110,7 +8091,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_28rewind(struct __pyx_obj_4ss __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("rewind", 0); - /* "ssh2/sftp.pyx":491 + /* "ssh2/sftp.pyx":493 * * def rewind(self): * with nogil: # <<<<<<<<<<<<<< @@ -8125,7 +8106,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_28rewind(struct __pyx_obj_4ss #endif /*try:*/ { - /* "ssh2/sftp.pyx":492 + /* "ssh2/sftp.pyx":494 * def rewind(self): * with nogil: * c_sftp.libssh2_sftp_rewind(self._handle) # <<<<<<<<<<<<<< @@ -8135,7 +8116,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_28rewind(struct __pyx_obj_4ss libssh2_sftp_rewind(__pyx_v_self->_handle); } - /* "ssh2/sftp.pyx":491 + /* "ssh2/sftp.pyx":493 * * def rewind(self): * with nogil: # <<<<<<<<<<<<<< @@ -8154,7 +8135,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_28rewind(struct __pyx_obj_4ss } } - /* "ssh2/sftp.pyx":490 + /* "ssh2/sftp.pyx":492 * c_sftp.libssh2_sftp_seek64(self._handle, offset) * * def rewind(self): # <<<<<<<<<<<<<< @@ -8169,7 +8150,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_28rewind(struct __pyx_obj_4ss return __pyx_r; } -/* "ssh2/sftp.pyx":494 +/* "ssh2/sftp.pyx":496 * c_sftp.libssh2_sftp_rewind(self._handle) * * def tell(self): # <<<<<<<<<<<<<< @@ -8198,7 +8179,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_30tell(struct __pyx_obj_4ssh2 PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("tell", 0); - /* "ssh2/sftp.pyx":496 + /* "ssh2/sftp.pyx":498 * def tell(self): * cdef size_t rc * with nogil: # <<<<<<<<<<<<<< @@ -8213,7 +8194,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_30tell(struct __pyx_obj_4ssh2 #endif /*try:*/ { - /* "ssh2/sftp.pyx":497 + /* "ssh2/sftp.pyx":499 * cdef size_t rc * with nogil: * rc = c_sftp.libssh2_sftp_tell(self._handle) # <<<<<<<<<<<<<< @@ -8223,7 +8204,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_30tell(struct __pyx_obj_4ssh2 __pyx_v_rc = libssh2_sftp_tell(__pyx_v_self->_handle); } - /* "ssh2/sftp.pyx":496 + /* "ssh2/sftp.pyx":498 * def tell(self): * cdef size_t rc * with nogil: # <<<<<<<<<<<<<< @@ -8242,7 +8223,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_30tell(struct __pyx_obj_4ssh2 } } - /* "ssh2/sftp.pyx":498 + /* "ssh2/sftp.pyx":500 * with nogil: * rc = c_sftp.libssh2_sftp_tell(self._handle) * return rc # <<<<<<<<<<<<<< @@ -8250,13 +8231,13 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_30tell(struct __pyx_obj_4ssh2 * def tell64(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 498, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 500, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/sftp.pyx":494 + /* "ssh2/sftp.pyx":496 * c_sftp.libssh2_sftp_rewind(self._handle) * * def tell(self): # <<<<<<<<<<<<<< @@ -8275,7 +8256,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_30tell(struct __pyx_obj_4ssh2 return __pyx_r; } -/* "ssh2/sftp.pyx":500 +/* "ssh2/sftp.pyx":502 * return rc * * def tell64(self): # <<<<<<<<<<<<<< @@ -8304,7 +8285,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_32tell64(struct __pyx_obj_4ss PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("tell64", 0); - /* "ssh2/sftp.pyx":502 + /* "ssh2/sftp.pyx":504 * def tell64(self): * cdef uint64_t rc * with nogil: # <<<<<<<<<<<<<< @@ -8319,7 +8300,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_32tell64(struct __pyx_obj_4ss #endif /*try:*/ { - /* "ssh2/sftp.pyx":503 + /* "ssh2/sftp.pyx":505 * cdef uint64_t rc * with nogil: * rc = c_sftp.libssh2_sftp_tell(self._handle) # <<<<<<<<<<<<<< @@ -8329,7 +8310,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_32tell64(struct __pyx_obj_4ss __pyx_v_rc = libssh2_sftp_tell(__pyx_v_self->_handle); } - /* "ssh2/sftp.pyx":502 + /* "ssh2/sftp.pyx":504 * def tell64(self): * cdef uint64_t rc * with nogil: # <<<<<<<<<<<<<< @@ -8348,7 +8329,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_32tell64(struct __pyx_obj_4ss } } - /* "ssh2/sftp.pyx":504 + /* "ssh2/sftp.pyx":506 * with nogil: * rc = c_sftp.libssh2_sftp_tell(self._handle) * return rc # <<<<<<<<<<<<<< @@ -8356,13 +8337,13 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_32tell64(struct __pyx_obj_4ss * def fstat_ex(self, SFTPAttributes attrs, int setstat): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_uint64_t(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 504, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint64_t(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 506, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/sftp.pyx":500 + /* "ssh2/sftp.pyx":502 * return rc * * def tell64(self): # <<<<<<<<<<<<<< @@ -8381,7 +8362,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_32tell64(struct __pyx_obj_4ss return __pyx_r; } -/* "ssh2/sftp.pyx":506 +/* "ssh2/sftp.pyx":508 * return rc * * def fstat_ex(self, SFTPAttributes attrs, int setstat): # <<<<<<<<<<<<<< @@ -8421,11 +8402,11 @@ static PyObject *__pyx_pw_4ssh2_4sftp_10SFTPHandle_35fstat_ex(PyObject *__pyx_v_ case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_setstat)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("fstat_ex", 1, 2, 2, 1); __PYX_ERR(0, 506, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("fstat_ex", 1, 2, 2, 1); __PYX_ERR(0, 508, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fstat_ex") < 0)) __PYX_ERR(0, 506, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fstat_ex") < 0)) __PYX_ERR(0, 508, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -8434,17 +8415,17 @@ static PyObject *__pyx_pw_4ssh2_4sftp_10SFTPHandle_35fstat_ex(PyObject *__pyx_v_ values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_attrs = ((struct __pyx_obj_4ssh2_4sftp_SFTPAttributes *)values[0]); - __pyx_v_setstat = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_setstat == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 506, __pyx_L3_error) + __pyx_v_setstat = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_setstat == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 508, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("fstat_ex", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 506, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("fstat_ex", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 508, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.sftp.SFTPHandle.fstat_ex", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_attrs), __pyx_ptype_4ssh2_4sftp_SFTPAttributes, 1, "attrs", 0))) __PYX_ERR(0, 506, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_attrs), __pyx_ptype_4ssh2_4sftp_SFTPAttributes, 1, "attrs", 0))) __PYX_ERR(0, 508, __pyx_L1_error) __pyx_r = __pyx_pf_4ssh2_4sftp_10SFTPHandle_34fstat_ex(((struct __pyx_obj_4ssh2_4sftp_SFTPHandle *)__pyx_v_self), __pyx_v_attrs, __pyx_v_setstat); /* function exit code */ @@ -8463,7 +8444,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_34fstat_ex(struct __pyx_obj_4 PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("fstat_ex", 0); - /* "ssh2/sftp.pyx":508 + /* "ssh2/sftp.pyx":510 * def fstat_ex(self, SFTPAttributes attrs, int setstat): * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -8478,7 +8459,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_34fstat_ex(struct __pyx_obj_4 #endif /*try:*/ { - /* "ssh2/sftp.pyx":509 + /* "ssh2/sftp.pyx":511 * cdef int rc * with nogil: * rc = c_sftp.libssh2_sftp_fstat_ex( # <<<<<<<<<<<<<< @@ -8488,7 +8469,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_34fstat_ex(struct __pyx_obj_4 __pyx_v_rc = libssh2_sftp_fstat_ex(__pyx_v_self->_handle, __pyx_v_attrs->_attrs, __pyx_v_setstat); } - /* "ssh2/sftp.pyx":508 + /* "ssh2/sftp.pyx":510 * def fstat_ex(self, SFTPAttributes attrs, int setstat): * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -8507,7 +8488,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_34fstat_ex(struct __pyx_obj_4 } } - /* "ssh2/sftp.pyx":511 + /* "ssh2/sftp.pyx":513 * rc = c_sftp.libssh2_sftp_fstat_ex( * self._handle, attrs._attrs, setstat) * return rc # <<<<<<<<<<<<<< @@ -8515,13 +8496,13 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_34fstat_ex(struct __pyx_obj_4 * def fstat(self, SFTPAttributes attrs): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 511, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 513, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/sftp.pyx":506 + /* "ssh2/sftp.pyx":508 * return rc * * def fstat_ex(self, SFTPAttributes attrs, int setstat): # <<<<<<<<<<<<<< @@ -8540,7 +8521,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_34fstat_ex(struct __pyx_obj_4 return __pyx_r; } -/* "ssh2/sftp.pyx":513 +/* "ssh2/sftp.pyx":515 * return rc * * def fstat(self, SFTPAttributes attrs): # <<<<<<<<<<<<<< @@ -8555,7 +8536,7 @@ static PyObject *__pyx_pw_4ssh2_4sftp_10SFTPHandle_37fstat(PyObject *__pyx_v_sel PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("fstat (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_attrs), __pyx_ptype_4ssh2_4sftp_SFTPAttributes, 1, "attrs", 0))) __PYX_ERR(0, 513, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_attrs), __pyx_ptype_4ssh2_4sftp_SFTPAttributes, 1, "attrs", 0))) __PYX_ERR(0, 515, __pyx_L1_error) __pyx_r = __pyx_pf_4ssh2_4sftp_10SFTPHandle_36fstat(((struct __pyx_obj_4ssh2_4sftp_SFTPHandle *)__pyx_v_self), ((struct __pyx_obj_4ssh2_4sftp_SFTPAttributes *)__pyx_v_attrs)); /* function exit code */ @@ -8574,7 +8555,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_36fstat(struct __pyx_obj_4ssh PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("fstat", 0); - /* "ssh2/sftp.pyx":515 + /* "ssh2/sftp.pyx":517 * def fstat(self, SFTPAttributes attrs): * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -8589,7 +8570,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_36fstat(struct __pyx_obj_4ssh #endif /*try:*/ { - /* "ssh2/sftp.pyx":516 + /* "ssh2/sftp.pyx":518 * cdef int rc * with nogil: * rc = c_sftp.libssh2_sftp_fstat(self._handle, attrs._attrs) # <<<<<<<<<<<<<< @@ -8599,7 +8580,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_36fstat(struct __pyx_obj_4ssh __pyx_v_rc = libssh2_sftp_fstat(__pyx_v_self->_handle, __pyx_v_attrs->_attrs); } - /* "ssh2/sftp.pyx":515 + /* "ssh2/sftp.pyx":517 * def fstat(self, SFTPAttributes attrs): * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -8618,7 +8599,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_36fstat(struct __pyx_obj_4ssh } } - /* "ssh2/sftp.pyx":517 + /* "ssh2/sftp.pyx":519 * with nogil: * rc = c_sftp.libssh2_sftp_fstat(self._handle, attrs._attrs) * return rc # <<<<<<<<<<<<<< @@ -8626,13 +8607,13 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_36fstat(struct __pyx_obj_4ssh * def fsetstat(self, SFTPAttributes attrs): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 517, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 519, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/sftp.pyx":513 + /* "ssh2/sftp.pyx":515 * return rc * * def fstat(self, SFTPAttributes attrs): # <<<<<<<<<<<<<< @@ -8651,7 +8632,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_36fstat(struct __pyx_obj_4ssh return __pyx_r; } -/* "ssh2/sftp.pyx":519 +/* "ssh2/sftp.pyx":521 * return rc * * def fsetstat(self, SFTPAttributes attrs): # <<<<<<<<<<<<<< @@ -8666,7 +8647,7 @@ static PyObject *__pyx_pw_4ssh2_4sftp_10SFTPHandle_39fsetstat(PyObject *__pyx_v_ PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("fsetstat (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_attrs), __pyx_ptype_4ssh2_4sftp_SFTPAttributes, 1, "attrs", 0))) __PYX_ERR(0, 519, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_attrs), __pyx_ptype_4ssh2_4sftp_SFTPAttributes, 1, "attrs", 0))) __PYX_ERR(0, 521, __pyx_L1_error) __pyx_r = __pyx_pf_4ssh2_4sftp_10SFTPHandle_38fsetstat(((struct __pyx_obj_4ssh2_4sftp_SFTPHandle *)__pyx_v_self), ((struct __pyx_obj_4ssh2_4sftp_SFTPAttributes *)__pyx_v_attrs)); /* function exit code */ @@ -8685,7 +8666,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_38fsetstat(struct __pyx_obj_4 PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("fsetstat", 0); - /* "ssh2/sftp.pyx":521 + /* "ssh2/sftp.pyx":523 * def fsetstat(self, SFTPAttributes attrs): * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -8700,7 +8681,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_38fsetstat(struct __pyx_obj_4 #endif /*try:*/ { - /* "ssh2/sftp.pyx":522 + /* "ssh2/sftp.pyx":524 * cdef int rc * with nogil: * rc = c_sftp.libssh2_sftp_fsetstat(self._handle, attrs._attrs) # <<<<<<<<<<<<<< @@ -8709,7 +8690,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_38fsetstat(struct __pyx_obj_4 __pyx_v_rc = libssh2_sftp_fsetstat(__pyx_v_self->_handle, __pyx_v_attrs->_attrs); } - /* "ssh2/sftp.pyx":521 + /* "ssh2/sftp.pyx":523 * def fsetstat(self, SFTPAttributes attrs): * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -8728,19 +8709,19 @@ static PyObject *__pyx_pf_4ssh2_4sftp_10SFTPHandle_38fsetstat(struct __pyx_obj_4 } } - /* "ssh2/sftp.pyx":523 + /* "ssh2/sftp.pyx":525 * with nogil: * rc = c_sftp.libssh2_sftp_fsetstat(self._handle, attrs._attrs) * return rc # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 523, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/sftp.pyx":519 + /* "ssh2/sftp.pyx":521 * return rc * * def fsetstat(self, SFTPAttributes attrs): # <<<<<<<<<<<<<< @@ -9428,10 +9409,10 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {0, 0, 0, 0, 0, 0, 0} }; static int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) __PYX_ERR(0, 184, __pyx_L1_error) - __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(0, 285, __pyx_L1_error) + __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) __PYX_ERR(0, 186, __pyx_L1_error) + __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(0, 287, __pyx_L1_error) __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error) - __pyx_builtin_StopIteration = __Pyx_GetBuiltinName(__pyx_n_s_StopIteration); if (!__pyx_builtin_StopIteration) __PYX_ERR(0, 420, __pyx_L1_error) + __pyx_builtin_StopIteration = __Pyx_GetBuiltinName(__pyx_n_s_StopIteration); if (!__pyx_builtin_StopIteration) __PYX_ERR(0, 422, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; @@ -9600,20 +9581,20 @@ PyMODINIT_FUNC PyInit_sftp(void) if (__Pyx_ExportFunction("PySFTPHandle", (void (*)(void))__pyx_f_4ssh2_4sftp_PySFTPHandle, "PyObject *(LIBSSH2_SFTP_HANDLE *, struct __pyx_obj_4ssh2_4sftp_SFTP *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PySFTP", (void (*)(void))__pyx_f_4ssh2_4sftp_PySFTP, "PyObject *(LIBSSH2_SFTP *, struct __pyx_obj_4ssh2_7session_Session *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Type init code ---*/ - if (PyType_Ready(&__pyx_type_4ssh2_4sftp_SFTP) < 0) __PYX_ERR(0, 69, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_4ssh2_4sftp_SFTP) < 0) __PYX_ERR(0, 71, __pyx_L1_error) __pyx_type_4ssh2_4sftp_SFTP.tp_print = 0; - if (PyObject_SetAttrString(__pyx_m, "SFTP", (PyObject *)&__pyx_type_4ssh2_4sftp_SFTP) < 0) __PYX_ERR(0, 69, __pyx_L1_error) - if (__Pyx_setup_reduce((PyObject*)&__pyx_type_4ssh2_4sftp_SFTP) < 0) __PYX_ERR(0, 69, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "SFTP", (PyObject *)&__pyx_type_4ssh2_4sftp_SFTP) < 0) __PYX_ERR(0, 71, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_4ssh2_4sftp_SFTP) < 0) __PYX_ERR(0, 71, __pyx_L1_error) __pyx_ptype_4ssh2_4sftp_SFTP = &__pyx_type_4ssh2_4sftp_SFTP; - if (PyType_Ready(&__pyx_type_4ssh2_4sftp_SFTPAttributes) < 0) __PYX_ERR(0, 319, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_4ssh2_4sftp_SFTPAttributes) < 0) __PYX_ERR(0, 321, __pyx_L1_error) __pyx_type_4ssh2_4sftp_SFTPAttributes.tp_print = 0; - if (PyObject_SetAttrString(__pyx_m, "SFTPAttributes", (PyObject *)&__pyx_type_4ssh2_4sftp_SFTPAttributes) < 0) __PYX_ERR(0, 319, __pyx_L1_error) - if (__Pyx_setup_reduce((PyObject*)&__pyx_type_4ssh2_4sftp_SFTPAttributes) < 0) __PYX_ERR(0, 319, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "SFTPAttributes", (PyObject *)&__pyx_type_4ssh2_4sftp_SFTPAttributes) < 0) __PYX_ERR(0, 321, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_4ssh2_4sftp_SFTPAttributes) < 0) __PYX_ERR(0, 321, __pyx_L1_error) __pyx_ptype_4ssh2_4sftp_SFTPAttributes = &__pyx_type_4ssh2_4sftp_SFTPAttributes; - if (PyType_Ready(&__pyx_type_4ssh2_4sftp_SFTPHandle) < 0) __PYX_ERR(0, 398, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_4ssh2_4sftp_SFTPHandle) < 0) __PYX_ERR(0, 400, __pyx_L1_error) __pyx_type_4ssh2_4sftp_SFTPHandle.tp_print = 0; - if (PyObject_SetAttrString(__pyx_m, "SFTPHandle", (PyObject *)&__pyx_type_4ssh2_4sftp_SFTPHandle) < 0) __PYX_ERR(0, 398, __pyx_L1_error) - if (__Pyx_setup_reduce((PyObject*)&__pyx_type_4ssh2_4sftp_SFTPHandle) < 0) __PYX_ERR(0, 398, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "SFTPHandle", (PyObject *)&__pyx_type_4ssh2_4sftp_SFTPHandle) < 0) __PYX_ERR(0, 400, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_4ssh2_4sftp_SFTPHandle) < 0) __PYX_ERR(0, 400, __pyx_L1_error) __pyx_ptype_4ssh2_4sftp_SFTPHandle = &__pyx_type_4ssh2_4sftp_SFTPHandle; /*--- Type import code ---*/ __pyx_ptype_4ssh2_7session_Session = __Pyx_ImportType("ssh2.session", "Session", sizeof(struct __pyx_obj_4ssh2_7session_Session), 1); if (unlikely(!__pyx_ptype_4ssh2_7session_Session)) __PYX_ERR(2, 20, __pyx_L1_error) @@ -9644,223 +9625,223 @@ PyMODINIT_FUNC PyInit_sftp(void) if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif - /* "ssh2/sftp.pyx":32 + /* "ssh2/sftp.pyx":34 * * # File Transfer Flags * LIBSSH2_FXF_READ = c_sftp.LIBSSH2_FXF_READ # <<<<<<<<<<<<<< * LIBSSH2_FXF_WRITE = c_sftp.LIBSSH2_FXF_WRITE * LIBSSH2_FXF_APPEND = c_sftp.LIBSSH2_FXF_APPEND */ - __pyx_t_3 = __Pyx_PyInt_From_int(LIBSSH2_FXF_READ); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 32, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(LIBSSH2_FXF_READ); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_FXF_READ, __pyx_t_3) < 0) __PYX_ERR(0, 32, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_FXF_READ, __pyx_t_3) < 0) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "ssh2/sftp.pyx":33 + /* "ssh2/sftp.pyx":35 * # File Transfer Flags * LIBSSH2_FXF_READ = c_sftp.LIBSSH2_FXF_READ * LIBSSH2_FXF_WRITE = c_sftp.LIBSSH2_FXF_WRITE # <<<<<<<<<<<<<< * LIBSSH2_FXF_APPEND = c_sftp.LIBSSH2_FXF_APPEND * LIBSSH2_FXF_CREAT = c_sftp.LIBSSH2_FXF_CREAT */ - __pyx_t_3 = __Pyx_PyInt_From_int(LIBSSH2_FXF_WRITE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 33, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(LIBSSH2_FXF_WRITE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_FXF_WRITE, __pyx_t_3) < 0) __PYX_ERR(0, 33, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_FXF_WRITE, __pyx_t_3) < 0) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "ssh2/sftp.pyx":34 + /* "ssh2/sftp.pyx":36 * LIBSSH2_FXF_READ = c_sftp.LIBSSH2_FXF_READ * LIBSSH2_FXF_WRITE = c_sftp.LIBSSH2_FXF_WRITE * LIBSSH2_FXF_APPEND = c_sftp.LIBSSH2_FXF_APPEND # <<<<<<<<<<<<<< * LIBSSH2_FXF_CREAT = c_sftp.LIBSSH2_FXF_CREAT * LIBSSH2_FXF_TRUNC = c_sftp.LIBSSH2_FXF_TRUNC */ - __pyx_t_3 = __Pyx_PyInt_From_int(LIBSSH2_FXF_APPEND); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 34, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(LIBSSH2_FXF_APPEND); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_FXF_APPEND, __pyx_t_3) < 0) __PYX_ERR(0, 34, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_FXF_APPEND, __pyx_t_3) < 0) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "ssh2/sftp.pyx":35 + /* "ssh2/sftp.pyx":37 * LIBSSH2_FXF_WRITE = c_sftp.LIBSSH2_FXF_WRITE * LIBSSH2_FXF_APPEND = c_sftp.LIBSSH2_FXF_APPEND * LIBSSH2_FXF_CREAT = c_sftp.LIBSSH2_FXF_CREAT # <<<<<<<<<<<<<< * LIBSSH2_FXF_TRUNC = c_sftp.LIBSSH2_FXF_TRUNC * LIBSSH2_FXF_EXCL = c_sftp.LIBSSH2_FXF_EXCL */ - __pyx_t_3 = __Pyx_PyInt_From_int(LIBSSH2_FXF_CREAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 35, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(LIBSSH2_FXF_CREAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_FXF_CREAT, __pyx_t_3) < 0) __PYX_ERR(0, 35, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_FXF_CREAT, __pyx_t_3) < 0) __PYX_ERR(0, 37, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "ssh2/sftp.pyx":36 + /* "ssh2/sftp.pyx":38 * LIBSSH2_FXF_APPEND = c_sftp.LIBSSH2_FXF_APPEND * LIBSSH2_FXF_CREAT = c_sftp.LIBSSH2_FXF_CREAT * LIBSSH2_FXF_TRUNC = c_sftp.LIBSSH2_FXF_TRUNC # <<<<<<<<<<<<<< * LIBSSH2_FXF_EXCL = c_sftp.LIBSSH2_FXF_EXCL * */ - __pyx_t_3 = __Pyx_PyInt_From_int(LIBSSH2_FXF_TRUNC); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 36, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(LIBSSH2_FXF_TRUNC); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_FXF_TRUNC, __pyx_t_3) < 0) __PYX_ERR(0, 36, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_FXF_TRUNC, __pyx_t_3) < 0) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "ssh2/sftp.pyx":37 + /* "ssh2/sftp.pyx":39 * LIBSSH2_FXF_CREAT = c_sftp.LIBSSH2_FXF_CREAT * LIBSSH2_FXF_TRUNC = c_sftp.LIBSSH2_FXF_TRUNC * LIBSSH2_FXF_EXCL = c_sftp.LIBSSH2_FXF_EXCL # <<<<<<<<<<<<<< * * # File mode masks */ - __pyx_t_3 = __Pyx_PyInt_From_int(LIBSSH2_FXF_EXCL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 37, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(LIBSSH2_FXF_EXCL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_FXF_EXCL, __pyx_t_3) < 0) __PYX_ERR(0, 37, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_FXF_EXCL, __pyx_t_3) < 0) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "ssh2/sftp.pyx":41 + /* "ssh2/sftp.pyx":43 * # File mode masks * # Read, write, execute/search by owner * LIBSSH2_SFTP_S_IRWXU = c_sftp.LIBSSH2_SFTP_S_IRWXU # <<<<<<<<<<<<<< * LIBSSH2_SFTP_S_IRUSR = c_sftp.LIBSSH2_SFTP_S_IRUSR * LIBSSH2_SFTP_S_IWUSR = c_sftp.LIBSSH2_SFTP_S_IWUSR */ - __pyx_t_3 = __Pyx_PyInt_From_int(LIBSSH2_SFTP_S_IRWXU); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 41, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(LIBSSH2_SFTP_S_IRWXU); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_SFTP_S_IRWXU, __pyx_t_3) < 0) __PYX_ERR(0, 41, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_SFTP_S_IRWXU, __pyx_t_3) < 0) __PYX_ERR(0, 43, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "ssh2/sftp.pyx":42 + /* "ssh2/sftp.pyx":44 * # Read, write, execute/search by owner * LIBSSH2_SFTP_S_IRWXU = c_sftp.LIBSSH2_SFTP_S_IRWXU * LIBSSH2_SFTP_S_IRUSR = c_sftp.LIBSSH2_SFTP_S_IRUSR # <<<<<<<<<<<<<< * LIBSSH2_SFTP_S_IWUSR = c_sftp.LIBSSH2_SFTP_S_IWUSR * LIBSSH2_SFTP_S_IXUSR = c_sftp.LIBSSH2_SFTP_S_IXUSR */ - __pyx_t_3 = __Pyx_PyInt_From_int(LIBSSH2_SFTP_S_IRUSR); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 42, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(LIBSSH2_SFTP_S_IRUSR); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_SFTP_S_IRUSR, __pyx_t_3) < 0) __PYX_ERR(0, 42, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_SFTP_S_IRUSR, __pyx_t_3) < 0) __PYX_ERR(0, 44, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "ssh2/sftp.pyx":43 + /* "ssh2/sftp.pyx":45 * LIBSSH2_SFTP_S_IRWXU = c_sftp.LIBSSH2_SFTP_S_IRWXU * LIBSSH2_SFTP_S_IRUSR = c_sftp.LIBSSH2_SFTP_S_IRUSR * LIBSSH2_SFTP_S_IWUSR = c_sftp.LIBSSH2_SFTP_S_IWUSR # <<<<<<<<<<<<<< * LIBSSH2_SFTP_S_IXUSR = c_sftp.LIBSSH2_SFTP_S_IXUSR * # Read, write, execute/search by group */ - __pyx_t_3 = __Pyx_PyInt_From_int(LIBSSH2_SFTP_S_IWUSR); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 43, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(LIBSSH2_SFTP_S_IWUSR); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_SFTP_S_IWUSR, __pyx_t_3) < 0) __PYX_ERR(0, 43, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_SFTP_S_IWUSR, __pyx_t_3) < 0) __PYX_ERR(0, 45, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "ssh2/sftp.pyx":44 + /* "ssh2/sftp.pyx":46 * LIBSSH2_SFTP_S_IRUSR = c_sftp.LIBSSH2_SFTP_S_IRUSR * LIBSSH2_SFTP_S_IWUSR = c_sftp.LIBSSH2_SFTP_S_IWUSR * LIBSSH2_SFTP_S_IXUSR = c_sftp.LIBSSH2_SFTP_S_IXUSR # <<<<<<<<<<<<<< * # Read, write, execute/search by group * LIBSSH2_SFTP_S_IRWXG = c_sftp.LIBSSH2_SFTP_S_IRWXG */ - __pyx_t_3 = __Pyx_PyInt_From_int(LIBSSH2_SFTP_S_IXUSR); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 44, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(LIBSSH2_SFTP_S_IXUSR); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_SFTP_S_IXUSR, __pyx_t_3) < 0) __PYX_ERR(0, 44, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_SFTP_S_IXUSR, __pyx_t_3) < 0) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "ssh2/sftp.pyx":46 + /* "ssh2/sftp.pyx":48 * LIBSSH2_SFTP_S_IXUSR = c_sftp.LIBSSH2_SFTP_S_IXUSR * # Read, write, execute/search by group * LIBSSH2_SFTP_S_IRWXG = c_sftp.LIBSSH2_SFTP_S_IRWXG # <<<<<<<<<<<<<< * LIBSSH2_SFTP_S_IRGRP = c_sftp.LIBSSH2_SFTP_S_IRGRP * LIBSSH2_SFTP_S_IWGRP = c_sftp.LIBSSH2_SFTP_S_IWGRP */ - __pyx_t_3 = __Pyx_PyInt_From_int(LIBSSH2_SFTP_S_IRWXG); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 46, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(LIBSSH2_SFTP_S_IRWXG); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_SFTP_S_IRWXG, __pyx_t_3) < 0) __PYX_ERR(0, 46, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_SFTP_S_IRWXG, __pyx_t_3) < 0) __PYX_ERR(0, 48, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "ssh2/sftp.pyx":47 + /* "ssh2/sftp.pyx":49 * # Read, write, execute/search by group * LIBSSH2_SFTP_S_IRWXG = c_sftp.LIBSSH2_SFTP_S_IRWXG * LIBSSH2_SFTP_S_IRGRP = c_sftp.LIBSSH2_SFTP_S_IRGRP # <<<<<<<<<<<<<< * LIBSSH2_SFTP_S_IWGRP = c_sftp.LIBSSH2_SFTP_S_IWGRP * LIBSSH2_SFTP_S_IXGRP = c_sftp.LIBSSH2_SFTP_S_IXGRP */ - __pyx_t_3 = __Pyx_PyInt_From_int(LIBSSH2_SFTP_S_IRGRP); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 47, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(LIBSSH2_SFTP_S_IRGRP); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_SFTP_S_IRGRP, __pyx_t_3) < 0) __PYX_ERR(0, 47, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_SFTP_S_IRGRP, __pyx_t_3) < 0) __PYX_ERR(0, 49, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "ssh2/sftp.pyx":48 + /* "ssh2/sftp.pyx":50 * LIBSSH2_SFTP_S_IRWXG = c_sftp.LIBSSH2_SFTP_S_IRWXG * LIBSSH2_SFTP_S_IRGRP = c_sftp.LIBSSH2_SFTP_S_IRGRP * LIBSSH2_SFTP_S_IWGRP = c_sftp.LIBSSH2_SFTP_S_IWGRP # <<<<<<<<<<<<<< * LIBSSH2_SFTP_S_IXGRP = c_sftp.LIBSSH2_SFTP_S_IXGRP * # Read, write, execute/search by others */ - __pyx_t_3 = __Pyx_PyInt_From_int(LIBSSH2_SFTP_S_IWGRP); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 48, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(LIBSSH2_SFTP_S_IWGRP); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_SFTP_S_IWGRP, __pyx_t_3) < 0) __PYX_ERR(0, 48, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_SFTP_S_IWGRP, __pyx_t_3) < 0) __PYX_ERR(0, 50, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "ssh2/sftp.pyx":49 + /* "ssh2/sftp.pyx":51 * LIBSSH2_SFTP_S_IRGRP = c_sftp.LIBSSH2_SFTP_S_IRGRP * LIBSSH2_SFTP_S_IWGRP = c_sftp.LIBSSH2_SFTP_S_IWGRP * LIBSSH2_SFTP_S_IXGRP = c_sftp.LIBSSH2_SFTP_S_IXGRP # <<<<<<<<<<<<<< * # Read, write, execute/search by others * LIBSSH2_SFTP_S_IRWXO = c_sftp.LIBSSH2_SFTP_S_IRWXO */ - __pyx_t_3 = __Pyx_PyInt_From_int(LIBSSH2_SFTP_S_IXGRP); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 49, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(LIBSSH2_SFTP_S_IXGRP); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_SFTP_S_IXGRP, __pyx_t_3) < 0) __PYX_ERR(0, 49, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_SFTP_S_IXGRP, __pyx_t_3) < 0) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "ssh2/sftp.pyx":51 + /* "ssh2/sftp.pyx":53 * LIBSSH2_SFTP_S_IXGRP = c_sftp.LIBSSH2_SFTP_S_IXGRP * # Read, write, execute/search by others * LIBSSH2_SFTP_S_IRWXO = c_sftp.LIBSSH2_SFTP_S_IRWXO # <<<<<<<<<<<<<< * LIBSSH2_SFTP_S_IROTH = c_sftp.LIBSSH2_SFTP_S_IROTH * LIBSSH2_SFTP_S_IWOTH = c_sftp.LIBSSH2_SFTP_S_IWOTH */ - __pyx_t_3 = __Pyx_PyInt_From_int(LIBSSH2_SFTP_S_IRWXO); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 51, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(LIBSSH2_SFTP_S_IRWXO); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_SFTP_S_IRWXO, __pyx_t_3) < 0) __PYX_ERR(0, 51, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_SFTP_S_IRWXO, __pyx_t_3) < 0) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "ssh2/sftp.pyx":52 + /* "ssh2/sftp.pyx":54 * # Read, write, execute/search by others * LIBSSH2_SFTP_S_IRWXO = c_sftp.LIBSSH2_SFTP_S_IRWXO * LIBSSH2_SFTP_S_IROTH = c_sftp.LIBSSH2_SFTP_S_IROTH # <<<<<<<<<<<<<< * LIBSSH2_SFTP_S_IWOTH = c_sftp.LIBSSH2_SFTP_S_IWOTH * LIBSSH2_SFTP_S_IXOTH = c_sftp.LIBSSH2_SFTP_S_IXOTH */ - __pyx_t_3 = __Pyx_PyInt_From_int(LIBSSH2_SFTP_S_IROTH); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 52, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(LIBSSH2_SFTP_S_IROTH); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_SFTP_S_IROTH, __pyx_t_3) < 0) __PYX_ERR(0, 52, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_SFTP_S_IROTH, __pyx_t_3) < 0) __PYX_ERR(0, 54, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "ssh2/sftp.pyx":53 + /* "ssh2/sftp.pyx":55 * LIBSSH2_SFTP_S_IRWXO = c_sftp.LIBSSH2_SFTP_S_IRWXO * LIBSSH2_SFTP_S_IROTH = c_sftp.LIBSSH2_SFTP_S_IROTH * LIBSSH2_SFTP_S_IWOTH = c_sftp.LIBSSH2_SFTP_S_IWOTH # <<<<<<<<<<<<<< * LIBSSH2_SFTP_S_IXOTH = c_sftp.LIBSSH2_SFTP_S_IXOTH * */ - __pyx_t_3 = __Pyx_PyInt_From_int(LIBSSH2_SFTP_S_IWOTH); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 53, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(LIBSSH2_SFTP_S_IWOTH); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_SFTP_S_IWOTH, __pyx_t_3) < 0) __PYX_ERR(0, 53, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_SFTP_S_IWOTH, __pyx_t_3) < 0) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "ssh2/sftp.pyx":54 + /* "ssh2/sftp.pyx":56 * LIBSSH2_SFTP_S_IROTH = c_sftp.LIBSSH2_SFTP_S_IROTH * LIBSSH2_SFTP_S_IWOTH = c_sftp.LIBSSH2_SFTP_S_IWOTH * LIBSSH2_SFTP_S_IXOTH = c_sftp.LIBSSH2_SFTP_S_IXOTH # <<<<<<<<<<<<<< * * */ - __pyx_t_3 = __Pyx_PyInt_From_int(LIBSSH2_SFTP_S_IXOTH); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 54, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(LIBSSH2_SFTP_S_IXOTH); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_SFTP_S_IXOTH, __pyx_t_3) < 0) __PYX_ERR(0, 54, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_SFTP_S_IXOTH, __pyx_t_3) < 0) __PYX_ERR(0, 56, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "ssh2/sftp.pyx":439 + /* "ssh2/sftp.pyx":441 * return rc * * def read(self, size_t buffer_maxlen=c_ssh2._LIBSSH2_CHANNEL_WINDOW_DEFAULT): # <<<<<<<<<<<<<< @@ -9869,7 +9850,7 @@ PyMODINIT_FUNC PyInit_sftp(void) */ __pyx_k__5 = LIBSSH2_CHANNEL_WINDOW_DEFAULT; - /* "ssh2/sftp.pyx":467 + /* "ssh2/sftp.pyx":469 * * def readdir(self, SFTPAttributes attrs, * size_t buffer_maxlen=c_ssh2._LIBSSH2_CHANNEL_WINDOW_DEFAULT): # <<<<<<<<<<<<<< diff --git a/ssh2/sftp.pyx b/ssh2/sftp.pyx index 30ddb99d..29a0e2e4 100644 --- a/ssh2/sftp.pyx +++ b/ssh2/sftp.pyx @@ -14,6 +14,8 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# cython: embedsignature=True, boundscheck=False, optimize.use_switch=True, wraparound=False + from libc.stdint cimport uint64_t from libc.stdlib cimport malloc, free diff --git a/ssh2/statinfo.c b/ssh2/statinfo.c index 72dbc2de..c0267d26 100644 --- a/ssh2/statinfo.c +++ b/ssh2/statinfo.c @@ -1,24 +1,5 @@ /* Generated by Cython 0.26 */ -/* BEGIN: Cython Metadata -{ - "distutils": { - "depends": [], - "extra_compile_args": [ - "-ggdb" - ], - "libraries": [ - "ssh2" - ], - "name": "ssh2.statinfo", - "sources": [ - "ssh2/statinfo.pyx" - ] - }, - "module_name": "ssh2.statinfo" -} -END: Cython Metadata */ - #define PY_SSIZE_T_CLEAN #include "Python.h" #ifndef Py_PYTHON_H @@ -972,7 +953,7 @@ static PyObject *__pyx_tp_new_4ssh2_8statinfo_StatInfo(PyTypeObject *t, PyObject static PyObject *__pyx_tuple_; static PyObject *__pyx_tuple__2; -/* "ssh2/statinfo.pyx":24 +/* "ssh2/statinfo.pyx":26 * """Representation of stat structure - older version""" * * def __cinit__(self): # <<<<<<<<<<<<<< @@ -1002,7 +983,7 @@ static int __pyx_pf_4ssh2_8statinfo_8StatInfo___cinit__(struct __pyx_obj_4ssh2_8 int __pyx_t_1; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "ssh2/statinfo.pyx":25 + /* "ssh2/statinfo.pyx":27 * * def __cinit__(self): * with nogil: # <<<<<<<<<<<<<< @@ -1017,7 +998,7 @@ static int __pyx_pf_4ssh2_8statinfo_8StatInfo___cinit__(struct __pyx_obj_4ssh2_8 #endif /*try:*/ { - /* "ssh2/statinfo.pyx":26 + /* "ssh2/statinfo.pyx":28 * def __cinit__(self): * with nogil: * self._stat = malloc( # <<<<<<<<<<<<<< @@ -1026,7 +1007,7 @@ static int __pyx_pf_4ssh2_8statinfo_8StatInfo___cinit__(struct __pyx_obj_4ssh2_8 */ __pyx_v_self->_stat = ((struct stat *)malloc((sizeof(struct stat)))); - /* "ssh2/statinfo.pyx":28 + /* "ssh2/statinfo.pyx":30 * self._stat = malloc( * sizeof(struct_stat)) * if self._stat is NULL: # <<<<<<<<<<<<<< @@ -1036,7 +1017,7 @@ static int __pyx_pf_4ssh2_8statinfo_8StatInfo___cinit__(struct __pyx_obj_4ssh2_8 __pyx_t_1 = ((__pyx_v_self->_stat == NULL) != 0); if (__pyx_t_1) { - /* "ssh2/statinfo.pyx":29 + /* "ssh2/statinfo.pyx":31 * sizeof(struct_stat)) * if self._stat is NULL: * with gil: # <<<<<<<<<<<<<< @@ -1049,17 +1030,17 @@ static int __pyx_pf_4ssh2_8statinfo_8StatInfo___cinit__(struct __pyx_obj_4ssh2_8 #endif /*try:*/ { - /* "ssh2/statinfo.pyx":30 + /* "ssh2/statinfo.pyx":32 * if self._stat is NULL: * with gil: * raise MemoryError # <<<<<<<<<<<<<< * * def __dealloc__(self): */ - PyErr_NoMemory(); __PYX_ERR(0, 30, __pyx_L8_error) + PyErr_NoMemory(); __PYX_ERR(0, 32, __pyx_L8_error) } - /* "ssh2/statinfo.pyx":29 + /* "ssh2/statinfo.pyx":31 * sizeof(struct_stat)) * if self._stat is NULL: * with gil: # <<<<<<<<<<<<<< @@ -1076,7 +1057,7 @@ static int __pyx_pf_4ssh2_8statinfo_8StatInfo___cinit__(struct __pyx_obj_4ssh2_8 } } - /* "ssh2/statinfo.pyx":28 + /* "ssh2/statinfo.pyx":30 * self._stat = malloc( * sizeof(struct_stat)) * if self._stat is NULL: # <<<<<<<<<<<<<< @@ -1086,7 +1067,7 @@ static int __pyx_pf_4ssh2_8statinfo_8StatInfo___cinit__(struct __pyx_obj_4ssh2_8 } } - /* "ssh2/statinfo.pyx":25 + /* "ssh2/statinfo.pyx":27 * * def __cinit__(self): * with nogil: # <<<<<<<<<<<<<< @@ -1112,7 +1093,7 @@ static int __pyx_pf_4ssh2_8statinfo_8StatInfo___cinit__(struct __pyx_obj_4ssh2_8 } } - /* "ssh2/statinfo.pyx":24 + /* "ssh2/statinfo.pyx":26 * """Representation of stat structure - older version""" * * def __cinit__(self): # <<<<<<<<<<<<<< @@ -1131,7 +1112,7 @@ static int __pyx_pf_4ssh2_8statinfo_8StatInfo___cinit__(struct __pyx_obj_4ssh2_8 return __pyx_r; } -/* "ssh2/statinfo.pyx":32 +/* "ssh2/statinfo.pyx":34 * raise MemoryError * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -1154,7 +1135,7 @@ static void __pyx_pf_4ssh2_8statinfo_8StatInfo_2__dealloc__(struct __pyx_obj_4ss __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "ssh2/statinfo.pyx":33 + /* "ssh2/statinfo.pyx":35 * * def __dealloc__(self): * free(self._stat) # <<<<<<<<<<<<<< @@ -1163,7 +1144,7 @@ static void __pyx_pf_4ssh2_8statinfo_8StatInfo_2__dealloc__(struct __pyx_obj_4ss */ free(__pyx_v_self->_stat); - /* "ssh2/statinfo.pyx":32 + /* "ssh2/statinfo.pyx":34 * raise MemoryError * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -1175,7 +1156,7 @@ static void __pyx_pf_4ssh2_8statinfo_8StatInfo_2__dealloc__(struct __pyx_obj_4ss __Pyx_RefNannyFinishContext(); } -/* "ssh2/statinfo.pyx":36 +/* "ssh2/statinfo.pyx":38 * * @property * def st_ino(self): # <<<<<<<<<<<<<< @@ -1202,7 +1183,7 @@ static PyObject *__pyx_pf_4ssh2_8statinfo_8StatInfo_6st_ino___get__(struct __pyx PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__", 0); - /* "ssh2/statinfo.pyx":37 + /* "ssh2/statinfo.pyx":39 * @property * def st_ino(self): * return self._stat.st_ino # <<<<<<<<<<<<<< @@ -1210,13 +1191,13 @@ static PyObject *__pyx_pf_4ssh2_8statinfo_8StatInfo_6st_ino___get__(struct __pyx * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_ino_t(__pyx_v_self->_stat->st_ino); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 37, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_ino_t(__pyx_v_self->_stat->st_ino); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/statinfo.pyx":36 + /* "ssh2/statinfo.pyx":38 * * @property * def st_ino(self): # <<<<<<<<<<<<<< @@ -1235,7 +1216,7 @@ static PyObject *__pyx_pf_4ssh2_8statinfo_8StatInfo_6st_ino___get__(struct __pyx return __pyx_r; } -/* "ssh2/statinfo.pyx":40 +/* "ssh2/statinfo.pyx":42 * * @property * def st_mode(self): # <<<<<<<<<<<<<< @@ -1262,7 +1243,7 @@ static PyObject *__pyx_pf_4ssh2_8statinfo_8StatInfo_7st_mode___get__(struct __py PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__", 0); - /* "ssh2/statinfo.pyx":41 + /* "ssh2/statinfo.pyx":43 * @property * def st_mode(self): * return self._stat.st_mode # <<<<<<<<<<<<<< @@ -1270,13 +1251,13 @@ static PyObject *__pyx_pf_4ssh2_8statinfo_8StatInfo_7st_mode___get__(struct __py * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_mode_t(__pyx_v_self->_stat->st_mode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 41, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_mode_t(__pyx_v_self->_stat->st_mode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/statinfo.pyx":40 + /* "ssh2/statinfo.pyx":42 * * @property * def st_mode(self): # <<<<<<<<<<<<<< @@ -1295,7 +1276,7 @@ static PyObject *__pyx_pf_4ssh2_8statinfo_8StatInfo_7st_mode___get__(struct __py return __pyx_r; } -/* "ssh2/statinfo.pyx":44 +/* "ssh2/statinfo.pyx":46 * * @property * def st_nlink(self): # <<<<<<<<<<<<<< @@ -1322,7 +1303,7 @@ static PyObject *__pyx_pf_4ssh2_8statinfo_8StatInfo_8st_nlink___get__(struct __p PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__", 0); - /* "ssh2/statinfo.pyx":45 + /* "ssh2/statinfo.pyx":47 * @property * def st_nlink(self): * return self._stat.st_nlink # <<<<<<<<<<<<<< @@ -1330,13 +1311,13 @@ static PyObject *__pyx_pf_4ssh2_8statinfo_8StatInfo_8st_nlink___get__(struct __p * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_nlink_t(__pyx_v_self->_stat->st_nlink); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 45, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_nlink_t(__pyx_v_self->_stat->st_nlink); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/statinfo.pyx":44 + /* "ssh2/statinfo.pyx":46 * * @property * def st_nlink(self): # <<<<<<<<<<<<<< @@ -1355,7 +1336,7 @@ static PyObject *__pyx_pf_4ssh2_8statinfo_8StatInfo_8st_nlink___get__(struct __p return __pyx_r; } -/* "ssh2/statinfo.pyx":48 +/* "ssh2/statinfo.pyx":50 * * @property * def st_uid(self): # <<<<<<<<<<<<<< @@ -1382,7 +1363,7 @@ static PyObject *__pyx_pf_4ssh2_8statinfo_8StatInfo_6st_uid___get__(struct __pyx PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__", 0); - /* "ssh2/statinfo.pyx":49 + /* "ssh2/statinfo.pyx":51 * @property * def st_uid(self): * return self._stat.st_uid # <<<<<<<<<<<<<< @@ -1390,13 +1371,13 @@ static PyObject *__pyx_pf_4ssh2_8statinfo_8StatInfo_6st_uid___get__(struct __pyx * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_uid_t(__pyx_v_self->_stat->st_uid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 49, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uid_t(__pyx_v_self->_stat->st_uid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/statinfo.pyx":48 + /* "ssh2/statinfo.pyx":50 * * @property * def st_uid(self): # <<<<<<<<<<<<<< @@ -1415,7 +1396,7 @@ static PyObject *__pyx_pf_4ssh2_8statinfo_8StatInfo_6st_uid___get__(struct __pyx return __pyx_r; } -/* "ssh2/statinfo.pyx":52 +/* "ssh2/statinfo.pyx":54 * * @property * def st_gid(self): # <<<<<<<<<<<<<< @@ -1442,7 +1423,7 @@ static PyObject *__pyx_pf_4ssh2_8statinfo_8StatInfo_6st_gid___get__(struct __pyx PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__", 0); - /* "ssh2/statinfo.pyx":53 + /* "ssh2/statinfo.pyx":55 * @property * def st_gid(self): * return self._stat.st_gid # <<<<<<<<<<<<<< @@ -1450,13 +1431,13 @@ static PyObject *__pyx_pf_4ssh2_8statinfo_8StatInfo_6st_gid___get__(struct __pyx * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_gid_t(__pyx_v_self->_stat->st_gid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 53, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_gid_t(__pyx_v_self->_stat->st_gid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/statinfo.pyx":52 + /* "ssh2/statinfo.pyx":54 * * @property * def st_gid(self): # <<<<<<<<<<<<<< @@ -1475,7 +1456,7 @@ static PyObject *__pyx_pf_4ssh2_8statinfo_8StatInfo_6st_gid___get__(struct __pyx return __pyx_r; } -/* "ssh2/statinfo.pyx":56 +/* "ssh2/statinfo.pyx":58 * * @property * def st_rdev(self): # <<<<<<<<<<<<<< @@ -1502,7 +1483,7 @@ static PyObject *__pyx_pf_4ssh2_8statinfo_8StatInfo_7st_rdev___get__(struct __py PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__", 0); - /* "ssh2/statinfo.pyx":57 + /* "ssh2/statinfo.pyx":59 * @property * def st_rdev(self): * return self._stat.st_rdev # <<<<<<<<<<<<<< @@ -1510,13 +1491,13 @@ static PyObject *__pyx_pf_4ssh2_8statinfo_8StatInfo_7st_rdev___get__(struct __py * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_dev_t(__pyx_v_self->_stat->st_rdev); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_dev_t(__pyx_v_self->_stat->st_rdev); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/statinfo.pyx":56 + /* "ssh2/statinfo.pyx":58 * * @property * def st_rdev(self): # <<<<<<<<<<<<<< @@ -1535,7 +1516,7 @@ static PyObject *__pyx_pf_4ssh2_8statinfo_8StatInfo_7st_rdev___get__(struct __py return __pyx_r; } -/* "ssh2/statinfo.pyx":60 +/* "ssh2/statinfo.pyx":62 * * @property * def st_size(self): # <<<<<<<<<<<<<< @@ -1562,7 +1543,7 @@ static PyObject *__pyx_pf_4ssh2_8statinfo_8StatInfo_7st_size___get__(struct __py PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__", 0); - /* "ssh2/statinfo.pyx":61 + /* "ssh2/statinfo.pyx":63 * @property * def st_size(self): * return self._stat.st_size # <<<<<<<<<<<<<< @@ -1570,13 +1551,13 @@ static PyObject *__pyx_pf_4ssh2_8statinfo_8StatInfo_7st_size___get__(struct __py * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_off_t(__pyx_v_self->_stat->st_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 61, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_off_t(__pyx_v_self->_stat->st_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/statinfo.pyx":60 + /* "ssh2/statinfo.pyx":62 * * @property * def st_size(self): # <<<<<<<<<<<<<< @@ -1595,7 +1576,7 @@ static PyObject *__pyx_pf_4ssh2_8statinfo_8StatInfo_7st_size___get__(struct __py return __pyx_r; } -/* "ssh2/statinfo.pyx":64 +/* "ssh2/statinfo.pyx":66 * * @property * def st_blksize(self): # <<<<<<<<<<<<<< @@ -1622,7 +1603,7 @@ static PyObject *__pyx_pf_4ssh2_8statinfo_8StatInfo_10st_blksize___get__(struct PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__", 0); - /* "ssh2/statinfo.pyx":65 + /* "ssh2/statinfo.pyx":67 * @property * def st_blksize(self): * return self._stat.st_blksize # <<<<<<<<<<<<<< @@ -1630,13 +1611,13 @@ static PyObject *__pyx_pf_4ssh2_8statinfo_8StatInfo_10st_blksize___get__(struct * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_blksize_t(__pyx_v_self->_stat->st_blksize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 65, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_blksize_t(__pyx_v_self->_stat->st_blksize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/statinfo.pyx":64 + /* "ssh2/statinfo.pyx":66 * * @property * def st_blksize(self): # <<<<<<<<<<<<<< @@ -1655,7 +1636,7 @@ static PyObject *__pyx_pf_4ssh2_8statinfo_8StatInfo_10st_blksize___get__(struct return __pyx_r; } -/* "ssh2/statinfo.pyx":68 +/* "ssh2/statinfo.pyx":70 * * @property * def st_blocks(self): # <<<<<<<<<<<<<< @@ -1682,7 +1663,7 @@ static PyObject *__pyx_pf_4ssh2_8statinfo_8StatInfo_9st_blocks___get__(struct __ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__", 0); - /* "ssh2/statinfo.pyx":69 + /* "ssh2/statinfo.pyx":71 * @property * def st_blocks(self): * return self._stat.st_blocks # <<<<<<<<<<<<<< @@ -1690,13 +1671,13 @@ static PyObject *__pyx_pf_4ssh2_8statinfo_8StatInfo_9st_blocks___get__(struct __ * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_blkcnt_t(__pyx_v_self->_stat->st_blocks); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 69, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_blkcnt_t(__pyx_v_self->_stat->st_blocks); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/statinfo.pyx":68 + /* "ssh2/statinfo.pyx":70 * * @property * def st_blocks(self): # <<<<<<<<<<<<<< @@ -1715,7 +1696,7 @@ static PyObject *__pyx_pf_4ssh2_8statinfo_8StatInfo_9st_blocks___get__(struct __ return __pyx_r; } -/* "ssh2/statinfo.pyx":72 +/* "ssh2/statinfo.pyx":74 * * @property * def st_atime(self): # <<<<<<<<<<<<<< @@ -1742,7 +1723,7 @@ static PyObject *__pyx_pf_4ssh2_8statinfo_8StatInfo_8st_atime___get__(struct __p PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__", 0); - /* "ssh2/statinfo.pyx":73 + /* "ssh2/statinfo.pyx":75 * @property * def st_atime(self): * return self._stat.st_atime # <<<<<<<<<<<<<< @@ -1750,13 +1731,13 @@ static PyObject *__pyx_pf_4ssh2_8statinfo_8StatInfo_8st_atime___get__(struct __p * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_time_t(__pyx_v_self->_stat->st_atime); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 73, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_time_t(__pyx_v_self->_stat->st_atime); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/statinfo.pyx":72 + /* "ssh2/statinfo.pyx":74 * * @property * def st_atime(self): # <<<<<<<<<<<<<< @@ -1775,7 +1756,7 @@ static PyObject *__pyx_pf_4ssh2_8statinfo_8StatInfo_8st_atime___get__(struct __p return __pyx_r; } -/* "ssh2/statinfo.pyx":76 +/* "ssh2/statinfo.pyx":78 * * @property * def st_mtime(self): # <<<<<<<<<<<<<< @@ -1802,7 +1783,7 @@ static PyObject *__pyx_pf_4ssh2_8statinfo_8StatInfo_8st_mtime___get__(struct __p PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__", 0); - /* "ssh2/statinfo.pyx":77 + /* "ssh2/statinfo.pyx":79 * @property * def st_mtime(self): * return self._stat.st_mtime # <<<<<<<<<<<<<< @@ -1810,13 +1791,13 @@ static PyObject *__pyx_pf_4ssh2_8statinfo_8StatInfo_8st_mtime___get__(struct __p * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_time_t(__pyx_v_self->_stat->st_mtime); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 77, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_time_t(__pyx_v_self->_stat->st_mtime); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/statinfo.pyx":76 + /* "ssh2/statinfo.pyx":78 * * @property * def st_mtime(self): # <<<<<<<<<<<<<< @@ -1835,7 +1816,7 @@ static PyObject *__pyx_pf_4ssh2_8statinfo_8StatInfo_8st_mtime___get__(struct __p return __pyx_r; } -/* "ssh2/statinfo.pyx":80 +/* "ssh2/statinfo.pyx":82 * * @property * def st_ctime(self): # <<<<<<<<<<<<<< @@ -1862,20 +1843,20 @@ static PyObject *__pyx_pf_4ssh2_8statinfo_8StatInfo_8st_ctime___get__(struct __p PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__", 0); - /* "ssh2/statinfo.pyx":81 + /* "ssh2/statinfo.pyx":83 * @property * def st_ctime(self): * return self._stat.st_ctime # <<<<<<<<<<<<<< * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_time_t(__pyx_v_self->_stat->st_ctime); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 81, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_time_t(__pyx_v_self->_stat->st_ctime); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/statinfo.pyx":80 + /* "ssh2/statinfo.pyx":82 * * @property * def st_ctime(self): # <<<<<<<<<<<<<< @@ -2197,7 +2178,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {0, 0, 0, 0, 0, 0, 0} }; static int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(0, 30, __pyx_L1_error) + __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(0, 32, __pyx_L1_error) __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error) return 0; __pyx_L1_error:; @@ -2325,10 +2306,10 @@ PyMODINIT_FUNC PyInit_statinfo(void) /*--- Variable export code ---*/ /*--- Function export code ---*/ /*--- Type init code ---*/ - if (PyType_Ready(&__pyx_type_4ssh2_8statinfo_StatInfo) < 0) __PYX_ERR(0, 21, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_4ssh2_8statinfo_StatInfo) < 0) __PYX_ERR(0, 23, __pyx_L1_error) __pyx_type_4ssh2_8statinfo_StatInfo.tp_print = 0; - if (PyObject_SetAttrString(__pyx_m, "StatInfo", (PyObject *)&__pyx_type_4ssh2_8statinfo_StatInfo) < 0) __PYX_ERR(0, 21, __pyx_L1_error) - if (__Pyx_setup_reduce((PyObject*)&__pyx_type_4ssh2_8statinfo_StatInfo) < 0) __PYX_ERR(0, 21, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "StatInfo", (PyObject *)&__pyx_type_4ssh2_8statinfo_StatInfo) < 0) __PYX_ERR(0, 23, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_4ssh2_8statinfo_StatInfo) < 0) __PYX_ERR(0, 23, __pyx_L1_error) __pyx_ptype_4ssh2_8statinfo_StatInfo = &__pyx_type_4ssh2_8statinfo_StatInfo; /*--- Type import code ---*/ /*--- Variable import code ---*/ diff --git a/ssh2/statinfo.pyx b/ssh2/statinfo.pyx index 1c2edf30..7671b4be 100644 --- a/ssh2/statinfo.pyx +++ b/ssh2/statinfo.pyx @@ -14,6 +14,8 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# cython: embedsignature=True, boundscheck=False, optimize.use_switch=True, wraparound=False + from libc.stdlib cimport malloc, free from posix.stat cimport struct_stat diff --git a/ssh2/utils.c b/ssh2/utils.c index 0dabce9f..9c11d99c 100644 --- a/ssh2/utils.c +++ b/ssh2/utils.c @@ -1,24 +1,5 @@ /* Generated by Cython 0.26 */ -/* BEGIN: Cython Metadata -{ - "distutils": { - "depends": [], - "extra_compile_args": [ - "-ggdb" - ], - "libraries": [ - "ssh2" - ], - "name": "ssh2.utils", - "sources": [ - "ssh2/utils.pyx" - ] - }, - "module_name": "ssh2.utils" -} -END: Cython Metadata */ - #define PY_SSIZE_T_CLEAN #include "Python.h" #ifndef Py_PYTHON_H @@ -1053,7 +1034,7 @@ static PyObject *__pyx_codeobj__2; static PyObject *__pyx_codeobj__3; static PyObject *__pyx_codeobj__5; -/* "ssh2/utils.pyx":28 +/* "ssh2/utils.pyx":30 * * * cdef char* to_bytes(_str): # <<<<<<<<<<<<<< @@ -1074,7 +1055,7 @@ static char *__pyx_f_4ssh2_5utils_to_bytes(PyObject *__pyx_v__str) { PyObject *__pyx_t_8 = NULL; __Pyx_RefNannySetupContext("to_bytes", 0); - /* "ssh2/utils.pyx":29 + /* "ssh2/utils.pyx":31 * * cdef char* to_bytes(_str): * if isinstance(_str, bytes): # <<<<<<<<<<<<<< @@ -1085,18 +1066,18 @@ static char *__pyx_f_4ssh2_5utils_to_bytes(PyObject *__pyx_v__str) { __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "ssh2/utils.pyx":30 + /* "ssh2/utils.pyx":32 * cdef char* to_bytes(_str): * if isinstance(_str, bytes): * return _str # <<<<<<<<<<<<<< * elif isinstance(_str, unicode): * return _str.encode(ENCODING) */ - __pyx_t_3 = __Pyx_PyObject_AsWritableString(__pyx_v__str); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) __PYX_ERR(0, 30, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_AsWritableString(__pyx_v__str); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) __PYX_ERR(0, 32, __pyx_L1_error) __pyx_r = __pyx_t_3; goto __pyx_L0; - /* "ssh2/utils.pyx":29 + /* "ssh2/utils.pyx":31 * * cdef char* to_bytes(_str): * if isinstance(_str, bytes): # <<<<<<<<<<<<<< @@ -1105,7 +1086,7 @@ static char *__pyx_f_4ssh2_5utils_to_bytes(PyObject *__pyx_v__str) { */ } - /* "ssh2/utils.pyx":31 + /* "ssh2/utils.pyx":33 * if isinstance(_str, bytes): * return _str * elif isinstance(_str, unicode): # <<<<<<<<<<<<<< @@ -1116,16 +1097,16 @@ static char *__pyx_f_4ssh2_5utils_to_bytes(PyObject *__pyx_v__str) { __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { - /* "ssh2/utils.pyx":32 + /* "ssh2/utils.pyx":34 * return _str * elif isinstance(_str, unicode): * return _str.encode(ENCODING) # <<<<<<<<<<<<<< * return _str * */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v__str, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 32, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v__str, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_ENCODING); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 32, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_ENCODING); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { @@ -1138,14 +1119,14 @@ static char *__pyx_f_4ssh2_5utils_to_bytes(PyObject *__pyx_v__str) { } } if (!__pyx_t_7) { - __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 32, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_4); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6}; - __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 32, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -1154,31 +1135,31 @@ static char *__pyx_f_4ssh2_5utils_to_bytes(PyObject *__pyx_v__str) { #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6}; - __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 32, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif { - __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 32, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL; __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_6); __pyx_t_6 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 32, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_3 = __Pyx_PyObject_AsWritableString(__pyx_t_4); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) __PYX_ERR(0, 32, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_AsWritableString(__pyx_t_4); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) __PYX_ERR(0, 34, __pyx_L1_error) __pyx_r = __pyx_t_3; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L0; - /* "ssh2/utils.pyx":31 + /* "ssh2/utils.pyx":33 * if isinstance(_str, bytes): * return _str * elif isinstance(_str, unicode): # <<<<<<<<<<<<<< @@ -1187,18 +1168,18 @@ static char *__pyx_f_4ssh2_5utils_to_bytes(PyObject *__pyx_v__str) { */ } - /* "ssh2/utils.pyx":33 + /* "ssh2/utils.pyx":35 * elif isinstance(_str, unicode): * return _str.encode(ENCODING) * return _str # <<<<<<<<<<<<<< * * */ - __pyx_t_3 = __Pyx_PyObject_AsWritableString(__pyx_v__str); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) __PYX_ERR(0, 33, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_AsWritableString(__pyx_v__str); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) __PYX_ERR(0, 35, __pyx_L1_error) __pyx_r = __pyx_t_3; goto __pyx_L0; - /* "ssh2/utils.pyx":28 + /* "ssh2/utils.pyx":30 * * * cdef char* to_bytes(_str): # <<<<<<<<<<<<<< @@ -1220,7 +1201,7 @@ static char *__pyx_f_4ssh2_5utils_to_bytes(PyObject *__pyx_v__str) { return __pyx_r; } -/* "ssh2/utils.pyx":36 +/* "ssh2/utils.pyx":38 * * * cdef object to_str(char *c_str): # <<<<<<<<<<<<<< @@ -1241,7 +1222,7 @@ static PyObject *__pyx_f_4ssh2_5utils_to_str(char *__pyx_v_c_str) { PyObject *__pyx_t_7 = NULL; __Pyx_RefNannySetupContext("to_str", 0); - /* "ssh2/utils.pyx":37 + /* "ssh2/utils.pyx":39 * * cdef object to_str(char *c_str): * if PY_MAJOR_VERSION < 3: # <<<<<<<<<<<<<< @@ -1251,7 +1232,7 @@ static PyObject *__pyx_f_4ssh2_5utils_to_str(char *__pyx_v_c_str) { __pyx_t_1 = ((PY_MAJOR_VERSION < 3) != 0); if (__pyx_t_1) { - /* "ssh2/utils.pyx":38 + /* "ssh2/utils.pyx":40 * cdef object to_str(char *c_str): * if PY_MAJOR_VERSION < 3: * return c_str # <<<<<<<<<<<<<< @@ -1259,13 +1240,13 @@ static PyObject *__pyx_f_4ssh2_5utils_to_str(char *__pyx_v_c_str) { * return c_str[:_len].decode(ENCODING) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_c_str); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 38, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_c_str); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "ssh2/utils.pyx":37 + /* "ssh2/utils.pyx":39 * * cdef object to_str(char *c_str): * if PY_MAJOR_VERSION < 3: # <<<<<<<<<<<<<< @@ -1274,7 +1255,7 @@ static PyObject *__pyx_f_4ssh2_5utils_to_str(char *__pyx_v_c_str) { */ } - /* "ssh2/utils.pyx":39 + /* "ssh2/utils.pyx":41 * if PY_MAJOR_VERSION < 3: * return c_str * _len = len(c_str) # <<<<<<<<<<<<<< @@ -1284,7 +1265,7 @@ static PyObject *__pyx_f_4ssh2_5utils_to_str(char *__pyx_v_c_str) { __pyx_t_3 = strlen(__pyx_v_c_str); __pyx_v__len = __pyx_t_3; - /* "ssh2/utils.pyx":40 + /* "ssh2/utils.pyx":42 * return c_str * _len = len(c_str) * return c_str[:_len].decode(ENCODING) # <<<<<<<<<<<<<< @@ -1292,12 +1273,12 @@ static PyObject *__pyx_f_4ssh2_5utils_to_str(char *__pyx_v_c_str) { * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_c_str + 0, __pyx_v__len - 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 40, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_c_str + 0, __pyx_v__len - 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_decode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 40, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_decode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_ENCODING); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 40, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_ENCODING); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { @@ -1310,14 +1291,14 @@ static PyObject *__pyx_f_4ssh2_5utils_to_str(char *__pyx_v_c_str) { } } if (!__pyx_t_6) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 40, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_4}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 40, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -1326,20 +1307,20 @@ static PyObject *__pyx_f_4ssh2_5utils_to_str(char *__pyx_v_c_str) { #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_4}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 40, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif { - __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 40, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL; __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 40, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } @@ -1349,7 +1330,7 @@ static PyObject *__pyx_f_4ssh2_5utils_to_str(char *__pyx_v_c_str) { __pyx_t_2 = 0; goto __pyx_L0; - /* "ssh2/utils.pyx":36 + /* "ssh2/utils.pyx":38 * * * cdef object to_str(char *c_str): # <<<<<<<<<<<<<< @@ -1372,7 +1353,7 @@ static PyObject *__pyx_f_4ssh2_5utils_to_str(char *__pyx_v_c_str) { return __pyx_r; } -/* "ssh2/utils.pyx":43 +/* "ssh2/utils.pyx":45 * * * def version(int required_version=0): # <<<<<<<<<<<<<< @@ -1410,7 +1391,7 @@ static PyObject *__pyx_pw_4ssh2_5utils_1version(PyObject *__pyx_self, PyObject * } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "version") < 0)) __PYX_ERR(0, 43, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "version") < 0)) __PYX_ERR(0, 45, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -1421,14 +1402,14 @@ static PyObject *__pyx_pw_4ssh2_5utils_1version(PyObject *__pyx_self, PyObject * } } if (values[0]) { - __pyx_v_required_version = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_required_version == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 43, __pyx_L3_error) + __pyx_v_required_version = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_required_version == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 45, __pyx_L3_error) } else { __pyx_v_required_version = ((int)0); } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("version", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 43, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("version", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 45, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.utils.version", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -1449,7 +1430,7 @@ static PyObject *__pyx_pf_4ssh2_5utils_version(CYTHON_UNUSED PyObject *__pyx_sel PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("version", 0); - /* "ssh2/utils.pyx":53 + /* "ssh2/utils.pyx":55 * """ * cdef const char *version * with nogil: # <<<<<<<<<<<<<< @@ -1464,7 +1445,7 @@ static PyObject *__pyx_pf_4ssh2_5utils_version(CYTHON_UNUSED PyObject *__pyx_sel #endif /*try:*/ { - /* "ssh2/utils.pyx":54 + /* "ssh2/utils.pyx":56 * cdef const char *version * with nogil: * version = c_ssh2.libssh2_version(required_version) # <<<<<<<<<<<<<< @@ -1474,7 +1455,7 @@ static PyObject *__pyx_pf_4ssh2_5utils_version(CYTHON_UNUSED PyObject *__pyx_sel __pyx_v_version = libssh2_version(__pyx_v_required_version); } - /* "ssh2/utils.pyx":53 + /* "ssh2/utils.pyx":55 * """ * cdef const char *version * with nogil: # <<<<<<<<<<<<<< @@ -1493,7 +1474,7 @@ static PyObject *__pyx_pf_4ssh2_5utils_version(CYTHON_UNUSED PyObject *__pyx_sel } } - /* "ssh2/utils.pyx":55 + /* "ssh2/utils.pyx":57 * with nogil: * version = c_ssh2.libssh2_version(required_version) * if version is NULL: # <<<<<<<<<<<<<< @@ -1503,7 +1484,7 @@ static PyObject *__pyx_pf_4ssh2_5utils_version(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_1 = ((__pyx_v_version == NULL) != 0); if (__pyx_t_1) { - /* "ssh2/utils.pyx":56 + /* "ssh2/utils.pyx":58 * version = c_ssh2.libssh2_version(required_version) * if version is NULL: * return # <<<<<<<<<<<<<< @@ -1514,7 +1495,7 @@ static PyObject *__pyx_pf_4ssh2_5utils_version(CYTHON_UNUSED PyObject *__pyx_sel __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "ssh2/utils.pyx":55 + /* "ssh2/utils.pyx":57 * with nogil: * version = c_ssh2.libssh2_version(required_version) * if version is NULL: # <<<<<<<<<<<<<< @@ -1523,7 +1504,7 @@ static PyObject *__pyx_pf_4ssh2_5utils_version(CYTHON_UNUSED PyObject *__pyx_sel */ } - /* "ssh2/utils.pyx":57 + /* "ssh2/utils.pyx":59 * if version is NULL: * return * return version # <<<<<<<<<<<<<< @@ -1531,13 +1512,13 @@ static PyObject *__pyx_pf_4ssh2_5utils_version(CYTHON_UNUSED PyObject *__pyx_sel * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_version); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 57, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_version); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "ssh2/utils.pyx":43 + /* "ssh2/utils.pyx":45 * * * def version(int required_version=0): # <<<<<<<<<<<<<< @@ -1556,7 +1537,7 @@ static PyObject *__pyx_pf_4ssh2_5utils_version(CYTHON_UNUSED PyObject *__pyx_sel return __pyx_r; } -/* "ssh2/utils.pyx":60 +/* "ssh2/utils.pyx":62 * * * def ssh2_exit(): # <<<<<<<<<<<<<< @@ -1584,7 +1565,7 @@ static PyObject *__pyx_pf_4ssh2_5utils_2ssh2_exit(CYTHON_UNUSED PyObject *__pyx_ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("ssh2_exit", 0); - /* "ssh2/utils.pyx":62 + /* "ssh2/utils.pyx":64 * def ssh2_exit(): * """Call libssh2_exit""" * c_ssh2.libssh2_exit() # <<<<<<<<<<<<<< @@ -1593,7 +1574,7 @@ static PyObject *__pyx_pf_4ssh2_5utils_2ssh2_exit(CYTHON_UNUSED PyObject *__pyx_ */ libssh2_exit(); - /* "ssh2/utils.pyx":60 + /* "ssh2/utils.pyx":62 * * * def ssh2_exit(): # <<<<<<<<<<<<<< @@ -1608,7 +1589,7 @@ static PyObject *__pyx_pf_4ssh2_5utils_2ssh2_exit(CYTHON_UNUSED PyObject *__pyx_ return __pyx_r; } -/* "ssh2/utils.pyx":65 +/* "ssh2/utils.pyx":67 * * * def wait_socket(_socket not None, Session session, timeout=1): # <<<<<<<<<<<<<< @@ -1653,7 +1634,7 @@ static PyObject *__pyx_pw_4ssh2_5utils_5wait_socket(PyObject *__pyx_self, PyObje case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_session)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("wait_socket", 0, 2, 3, 1); __PYX_ERR(0, 65, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("wait_socket", 0, 2, 3, 1); __PYX_ERR(0, 67, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -1663,7 +1644,7 @@ static PyObject *__pyx_pw_4ssh2_5utils_5wait_socket(PyObject *__pyx_self, PyObje } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "wait_socket") < 0)) __PYX_ERR(0, 65, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "wait_socket") < 0)) __PYX_ERR(0, 67, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -1681,16 +1662,16 @@ static PyObject *__pyx_pw_4ssh2_5utils_5wait_socket(PyObject *__pyx_self, PyObje } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("wait_socket", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 65, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("wait_socket", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 67, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.utils.wait_socket", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(((PyObject *)__pyx_v__socket) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "_socket"); __PYX_ERR(0, 65, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "_socket"); __PYX_ERR(0, 67, __pyx_L1_error) } - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_session), __pyx_ptype_4ssh2_7session_Session, 1, "session", 0))) __PYX_ERR(0, 65, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_session), __pyx_ptype_4ssh2_7session_Session, 1, "session", 0))) __PYX_ERR(0, 67, __pyx_L1_error) __pyx_r = __pyx_pf_4ssh2_5utils_4wait_socket(__pyx_self, __pyx_v__socket, __pyx_v_session, __pyx_v_timeout); /* function exit code */ @@ -1716,14 +1697,14 @@ static PyObject *__pyx_pf_4ssh2_5utils_4wait_socket(CYTHON_UNUSED PyObject *__py PyObject *__pyx_t_6 = NULL; __Pyx_RefNannySetupContext("wait_socket", 0); - /* "ssh2/utils.pyx":71 + /* "ssh2/utils.pyx":73 * to be used only for testing purposes. * """ * cdef int directions = session.blockdirections() # <<<<<<<<<<<<<< * if directions == 0: * return 0 */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_session), __pyx_n_s_blockdirections); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 71, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_session), __pyx_n_s_blockdirections); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { @@ -1736,18 +1717,18 @@ static PyObject *__pyx_pf_4ssh2_5utils_4wait_socket(CYTHON_UNUSED PyObject *__py } } if (__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 71, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 71, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 73, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 71, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_directions = __pyx_t_4; - /* "ssh2/utils.pyx":72 + /* "ssh2/utils.pyx":74 * """ * cdef int directions = session.blockdirections() * if directions == 0: # <<<<<<<<<<<<<< @@ -1757,7 +1738,7 @@ static PyObject *__pyx_pf_4ssh2_5utils_4wait_socket(CYTHON_UNUSED PyObject *__py __pyx_t_5 = ((__pyx_v_directions == 0) != 0); if (__pyx_t_5) { - /* "ssh2/utils.pyx":73 + /* "ssh2/utils.pyx":75 * cdef int directions = session.blockdirections() * if directions == 0: * return 0 # <<<<<<<<<<<<<< @@ -1769,7 +1750,7 @@ static PyObject *__pyx_pf_4ssh2_5utils_4wait_socket(CYTHON_UNUSED PyObject *__py __pyx_r = __pyx_int_0; goto __pyx_L0; - /* "ssh2/utils.pyx":72 + /* "ssh2/utils.pyx":74 * """ * cdef int directions = session.blockdirections() * if directions == 0: # <<<<<<<<<<<<<< @@ -1778,7 +1759,7 @@ static PyObject *__pyx_pf_4ssh2_5utils_4wait_socket(CYTHON_UNUSED PyObject *__py */ } - /* "ssh2/utils.pyx":75 + /* "ssh2/utils.pyx":77 * return 0 * readfds = [_socket] \ * if (directions & c_ssh2._LIBSSH2_SESSION_BLOCK_INBOUND) else () # <<<<<<<<<<<<<< @@ -1787,14 +1768,14 @@ static PyObject *__pyx_pf_4ssh2_5utils_4wait_socket(CYTHON_UNUSED PyObject *__py */ if (((__pyx_v_directions & LIBSSH2_SESSION_BLOCK_INBOUND) != 0)) { - /* "ssh2/utils.pyx":74 + /* "ssh2/utils.pyx":76 * if directions == 0: * return 0 * readfds = [_socket] \ # <<<<<<<<<<<<<< * if (directions & c_ssh2._LIBSSH2_SESSION_BLOCK_INBOUND) else () * writefds = [_socket] \ */ - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 74, __pyx_L1_error) + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v__socket); __Pyx_GIVEREF(__pyx_v__socket); @@ -1803,7 +1784,7 @@ static PyObject *__pyx_pf_4ssh2_5utils_4wait_socket(CYTHON_UNUSED PyObject *__py __pyx_t_2 = 0; } else { - /* "ssh2/utils.pyx":75 + /* "ssh2/utils.pyx":77 * return 0 * readfds = [_socket] \ * if (directions & c_ssh2._LIBSSH2_SESSION_BLOCK_INBOUND) else () # <<<<<<<<<<<<<< @@ -1816,7 +1797,7 @@ static PyObject *__pyx_pf_4ssh2_5utils_4wait_socket(CYTHON_UNUSED PyObject *__py __pyx_v_readfds = __pyx_t_1; __pyx_t_1 = 0; - /* "ssh2/utils.pyx":77 + /* "ssh2/utils.pyx":79 * if (directions & c_ssh2._LIBSSH2_SESSION_BLOCK_INBOUND) else () * writefds = [_socket] \ * if (directions & c_ssh2._LIBSSH2_SESSION_BLOCK_OUTBOUND) else () # <<<<<<<<<<<<<< @@ -1824,14 +1805,14 @@ static PyObject *__pyx_pf_4ssh2_5utils_4wait_socket(CYTHON_UNUSED PyObject *__py */ if (((__pyx_v_directions & LIBSSH2_SESSION_BLOCK_OUTBOUND) != 0)) { - /* "ssh2/utils.pyx":76 + /* "ssh2/utils.pyx":78 * readfds = [_socket] \ * if (directions & c_ssh2._LIBSSH2_SESSION_BLOCK_INBOUND) else () * writefds = [_socket] \ # <<<<<<<<<<<<<< * if (directions & c_ssh2._LIBSSH2_SESSION_BLOCK_OUTBOUND) else () * return select(readfds, writefds, (), timeout) */ - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 76, __pyx_L1_error) + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v__socket); __Pyx_GIVEREF(__pyx_v__socket); @@ -1840,7 +1821,7 @@ static PyObject *__pyx_pf_4ssh2_5utils_4wait_socket(CYTHON_UNUSED PyObject *__py __pyx_t_2 = 0; } else { - /* "ssh2/utils.pyx":77 + /* "ssh2/utils.pyx":79 * if (directions & c_ssh2._LIBSSH2_SESSION_BLOCK_INBOUND) else () * writefds = [_socket] \ * if (directions & c_ssh2._LIBSSH2_SESSION_BLOCK_OUTBOUND) else () # <<<<<<<<<<<<<< @@ -1852,13 +1833,13 @@ static PyObject *__pyx_pf_4ssh2_5utils_4wait_socket(CYTHON_UNUSED PyObject *__py __pyx_v_writefds = __pyx_t_1; __pyx_t_1 = 0; - /* "ssh2/utils.pyx":78 + /* "ssh2/utils.pyx":80 * writefds = [_socket] \ * if (directions & c_ssh2._LIBSSH2_SESSION_BLOCK_OUTBOUND) else () * return select(readfds, writefds, (), timeout) # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_select); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 78, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_select); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; @@ -1875,7 +1856,7 @@ static PyObject *__pyx_pf_4ssh2_5utils_4wait_socket(CYTHON_UNUSED PyObject *__py #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[5] = {__pyx_t_3, __pyx_v_readfds, __pyx_v_writefds, __pyx_empty_tuple, __pyx_v_timeout}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 4+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 78, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 4+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else @@ -1883,13 +1864,13 @@ static PyObject *__pyx_pf_4ssh2_5utils_4wait_socket(CYTHON_UNUSED PyObject *__py #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[5] = {__pyx_t_3, __pyx_v_readfds, __pyx_v_writefds, __pyx_empty_tuple, __pyx_v_timeout}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 4+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 78, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 4+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { - __pyx_t_6 = PyTuple_New(4+__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 78, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(4+__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL; @@ -1906,7 +1887,7 @@ static PyObject *__pyx_pf_4ssh2_5utils_4wait_socket(CYTHON_UNUSED PyObject *__py __Pyx_INCREF(__pyx_v_timeout); __Pyx_GIVEREF(__pyx_v_timeout); PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_4, __pyx_v_timeout); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 78, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } @@ -1915,7 +1896,7 @@ static PyObject *__pyx_pf_4ssh2_5utils_4wait_socket(CYTHON_UNUSED PyObject *__py __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/utils.pyx":65 + /* "ssh2/utils.pyx":67 * * * def wait_socket(_socket not None, Session session, timeout=1): # <<<<<<<<<<<<<< @@ -1995,38 +1976,38 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - /* "ssh2/utils.pyx":43 + /* "ssh2/utils.pyx":45 * * * def version(int required_version=0): # <<<<<<<<<<<<<< * """Get libssh2 version string. * */ - __pyx_tuple_ = PyTuple_Pack(2, __pyx_n_s_required_version, __pyx_n_s_version); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 43, __pyx_L1_error) + __pyx_tuple_ = PyTuple_Pack(2, __pyx_n_s_required_version, __pyx_n_s_version); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); - __pyx_codeobj__2 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple_, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ssh2_utils_pyx, __pyx_n_s_version, 43, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2)) __PYX_ERR(0, 43, __pyx_L1_error) + __pyx_codeobj__2 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple_, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ssh2_utils_pyx, __pyx_n_s_version, 45, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2)) __PYX_ERR(0, 45, __pyx_L1_error) - /* "ssh2/utils.pyx":60 + /* "ssh2/utils.pyx":62 * * * def ssh2_exit(): # <<<<<<<<<<<<<< * """Call libssh2_exit""" * c_ssh2.libssh2_exit() */ - __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ssh2_utils_pyx, __pyx_n_s_ssh2_exit, 60, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__3)) __PYX_ERR(0, 60, __pyx_L1_error) + __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ssh2_utils_pyx, __pyx_n_s_ssh2_exit, 62, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__3)) __PYX_ERR(0, 62, __pyx_L1_error) - /* "ssh2/utils.pyx":65 + /* "ssh2/utils.pyx":67 * * * def wait_socket(_socket not None, Session session, timeout=1): # <<<<<<<<<<<<<< * """Helper function for testing non-blocking mode. * */ - __pyx_tuple__4 = PyTuple_Pack(6, __pyx_n_s_socket, __pyx_n_s_session, __pyx_n_s_timeout, __pyx_n_s_directions, __pyx_n_s_readfds, __pyx_n_s_writefds); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 65, __pyx_L1_error) + __pyx_tuple__4 = PyTuple_Pack(6, __pyx_n_s_socket, __pyx_n_s_session, __pyx_n_s_timeout, __pyx_n_s_directions, __pyx_n_s_readfds, __pyx_n_s_writefds); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); - __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(3, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__4, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ssh2_utils_pyx, __pyx_n_s_wait_socket, 65, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(0, 65, __pyx_L1_error) + __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(3, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__4, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ssh2_utils_pyx, __pyx_n_s_wait_socket, 67, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -2141,70 +2122,70 @@ PyMODINIT_FUNC PyInit_utils(void) if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif - /* "ssh2/utils.pyx":17 - * # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + /* "ssh2/utils.pyx":19 + * # cython: embedsignature=True, boundscheck=False, optimize.use_switch=True, wraparound=False * * from select import select # <<<<<<<<<<<<<< * * from cpython.version cimport PY_MAJOR_VERSION */ - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 17, __pyx_L1_error) + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_select); __Pyx_GIVEREF(__pyx_n_s_select); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_select); - __pyx_t_2 = __Pyx_Import(__pyx_n_s_select, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 17, __pyx_L1_error) + __pyx_t_2 = __Pyx_Import(__pyx_n_s_select, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_select); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 17, __pyx_L1_error) + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_select); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_select, __pyx_t_1) < 0) __PYX_ERR(0, 17, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_select, __pyx_t_1) < 0) __PYX_ERR(0, 19, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "ssh2/utils.pyx":25 + /* "ssh2/utils.pyx":27 * * * ENCODING='utf-8' # <<<<<<<<<<<<<< * * */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ENCODING, __pyx_kp_s_utf_8) < 0) __PYX_ERR(0, 25, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ENCODING, __pyx_kp_s_utf_8) < 0) __PYX_ERR(0, 27, __pyx_L1_error) - /* "ssh2/utils.pyx":43 + /* "ssh2/utils.pyx":45 * * * def version(int required_version=0): # <<<<<<<<<<<<<< * """Get libssh2 version string. * */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_4ssh2_5utils_1version, NULL, __pyx_n_s_ssh2_utils); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 43, __pyx_L1_error) + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_4ssh2_5utils_1version, NULL, __pyx_n_s_ssh2_utils); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_version, __pyx_t_2) < 0) __PYX_ERR(0, 43, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_version, __pyx_t_2) < 0) __PYX_ERR(0, 45, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "ssh2/utils.pyx":60 + /* "ssh2/utils.pyx":62 * * * def ssh2_exit(): # <<<<<<<<<<<<<< * """Call libssh2_exit""" * c_ssh2.libssh2_exit() */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_4ssh2_5utils_3ssh2_exit, NULL, __pyx_n_s_ssh2_utils); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 60, __pyx_L1_error) + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_4ssh2_5utils_3ssh2_exit, NULL, __pyx_n_s_ssh2_utils); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 62, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ssh2_exit, __pyx_t_2) < 0) __PYX_ERR(0, 60, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ssh2_exit, __pyx_t_2) < 0) __PYX_ERR(0, 62, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "ssh2/utils.pyx":65 + /* "ssh2/utils.pyx":67 * * * def wait_socket(_socket not None, Session session, timeout=1): # <<<<<<<<<<<<<< * """Helper function for testing non-blocking mode. * */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_4ssh2_5utils_5wait_socket, NULL, __pyx_n_s_ssh2_utils); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 65, __pyx_L1_error) + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_4ssh2_5utils_5wait_socket, NULL, __pyx_n_s_ssh2_utils); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_wait_socket, __pyx_t_2) < 0) __PYX_ERR(0, 65, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_wait_socket, __pyx_t_2) < 0) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "ssh2/utils.pyx":1 diff --git a/ssh2/utils.pyx b/ssh2/utils.pyx index 85984af8..4902e72b 100644 --- a/ssh2/utils.pyx +++ b/ssh2/utils.pyx @@ -14,6 +14,8 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# cython: embedsignature=True, boundscheck=False, optimize.use_switch=True, wraparound=False + from select import select from cpython.version cimport PY_MAJOR_VERSION diff --git a/tests/test_ssh2.py b/tests/test_ssh2.py index 3663ebba..577dbb32 100644 --- a/tests/test_ssh2.py +++ b/tests/test_ssh2.py @@ -306,7 +306,8 @@ def test_sftp_symlink_realpath_lstat(self): os.unlink(symlink_target) os.unlink(remote_filename) - @unittest.expectedFailure + @unittest.skipUnless(hasattr(Session, 'scp_recv64'), + "Function not supported by libssh2") def test_scp_recv2(self): self.assertEqual(self._auth(), 0) test_data = b"data" From df50d56921bdb303887b996bbe5ff93b07626a62 Mon Sep 17 00:00:00 2001 From: Pan Date: Sun, 6 Aug 2017 22:44:06 +0100 Subject: [PATCH 6/6] Added Changelog --- Changelog.rst | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 Changelog.rst diff --git a/Changelog.rst b/Changelog.rst new file mode 100644 index 00000000..cd881e92 --- /dev/null +++ b/Changelog.rst @@ -0,0 +1,38 @@ +Change Log +============= + +0.4.0 +------ + +Changes +________ + +* Implemented SCP send and recv methods, all versions. +* Conditional compilation of features requiring newer versions of libssh2. +* Implemented channel receive window adjust, x11_*, poll and handle extended data methods. +* Implemented session get/set blocking, get/set timeout. +* Updated agent connection error exception name. +* Renamed session method name to match libssh2. +* Info extension classes for SCP file stat structure. + + +0.3.1 +------ + +Changes +_________ + +* Added context manager to SFTP handle +* Implemented SFTP write, seek, stat, fstat and last_error methods. +* Implemented SFTPAttribute object creation and de-allocation - added unit test. + + +0.3.0 +-------- + +Changes +________ + +* Updated API +* Updated session, channel, agent and pkey to accept any string type arguments. +* Added get_exit_signal implementation for channel.