diff --git a/ssh2/sftp.c b/ssh2/sftp.c index 80d73bee..0742948e 100644 --- a/ssh2/sftp.c +++ b/ssh2/sftp.c @@ -2453,7 +2453,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_6open_ex(struct __pyx_obj_4ssh2_4sft /* Python wrapper */ static PyObject *__pyx_pw_4ssh2_4sftp_4SFTP_9open(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_4ssh2_4sftp_4SFTP_8open[] = "SFTP.open(self, filename, unsigned long flags, long mode)\nOpen file handle for file name.\n\n :param filename: Name of file to open.\n :type filename: str\n :param flags: One or more LIBSSH2_FXF_* flags.\n\n Eg for reading flags is ``LIBSSH2_FXF_READ``,\n\n for writing ``LIBSSH2_FXF_WRITE``,\n\n for both ``LIBSSH2_FXF_READ`` | ``LIBSSH2_FXF_WRITE``.\n :type flags: int\n :param mode: File permissions mode. ``LIBSSH2_SFTP_S_IRUSR`` for\n reading.\n\n For writing one or more ``LIBSSH2_SFTP_S_*`` flags.\n\n Eg, for 664 permission mask (read/write owner/group, read other),\n\n mode is\n\n ``LIBSSH2_SFTP_S_IRUSR | LIBSSH2_SFTP_S_IWUSR | \\``\n ``LIBSSH2_SFTP_S_IRGRP | LIBSSH2_SFTP_S_IWGRP | \\``\n ``LIBSSH2_SFTP_S_IROTH``\n :type mode: int\n\n :raises: :py:class:`ssh2.exceptions.SFTPHandleError` on errors opening\n file.\n "; +static char __pyx_doc_4ssh2_4sftp_4SFTP_8open[] = "SFTP.open(self, filename, unsigned long flags, long mode)\nOpen file handle for file name.\n\n :param filename: Name of file to open.\n :type filename: str\n :param flags: One or more LIBSSH2_FXF_* flags.\n\n Eg for reading flags is ``LIBSSH2_FXF_READ``,\n\n for writing ``LIBSSH2_FXF_WRITE``,\n\n for both ``LIBSSH2_FXF_READ`` | ``LIBSSH2_FXF_WRITE``.\n :type flags: int\n :param mode: File permissions mode. ``LIBSSH2_SFTP_S_IRUSR`` for\n reading.\n\n For writing one or more ``LIBSSH2_SFTP_S_*`` flags.\n\n Eg, for 664 permission mask (read/write owner/group, read other),\n\n mode is\n\n ``LIBSSH2_SFTP_S_IRUSR | LIBSSH2_SFTP_S_IWUSR | \\``\n ``LIBSSH2_SFTP_S_IRGRP | LIBSSH2_SFTP_S_IWGRP | \\``\n ``LIBSSH2_SFTP_S_IROTH``\n :type mode: int\n\n :rtype: :py:class:`ssh2.sftp.SFTPHandle` or `None`\n\n :raises: :py:class:`ssh2.exceptions.SFTPHandleError` on errors opening\n file.\n "; static PyObject *__pyx_pw_4ssh2_4sftp_4SFTP_9open(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_filename = 0; unsigned long __pyx_v_flags; @@ -2549,19 +2549,19 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_8open(struct __pyx_obj_4ssh2_4sftp_S int __pyx_clineno = 0; __Pyx_RefNannySetupContext("open", 0); - /* "ssh2/sftp.pyx":250 + /* "ssh2/sftp.pyx":252 * """ # noqa: W605 * cdef c_sftp.LIBSSH2_SFTP_HANDLE *_handle * cdef bytes b_filename = to_bytes(filename) # <<<<<<<<<<<<<< * cdef char *_filename = b_filename * with nogil: */ - __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_filename); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 250, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_filename); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_b_filename = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/sftp.pyx":251 + /* "ssh2/sftp.pyx":253 * cdef c_sftp.LIBSSH2_SFTP_HANDLE *_handle * cdef bytes b_filename = to_bytes(filename) * cdef char *_filename = b_filename # <<<<<<<<<<<<<< @@ -2570,12 +2570,12 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_8open(struct __pyx_obj_4ssh2_4sftp_S */ if (unlikely(__pyx_v_b_filename == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 251, __pyx_L1_error) + __PYX_ERR(0, 253, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_filename); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 251, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_filename); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 253, __pyx_L1_error) __pyx_v__filename = __pyx_t_2; - /* "ssh2/sftp.pyx":252 + /* "ssh2/sftp.pyx":254 * cdef bytes b_filename = to_bytes(filename) * cdef char *_filename = b_filename * with nogil: # <<<<<<<<<<<<<< @@ -2590,7 +2590,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_8open(struct __pyx_obj_4ssh2_4sftp_S #endif /*try:*/ { - /* "ssh2/sftp.pyx":253 + /* "ssh2/sftp.pyx":255 * cdef char *_filename = b_filename * with nogil: * _handle = c_sftp.libssh2_sftp_open( # <<<<<<<<<<<<<< @@ -2600,7 +2600,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":252 + /* "ssh2/sftp.pyx":254 * cdef bytes b_filename = to_bytes(filename) * cdef char *_filename = b_filename * with nogil: # <<<<<<<<<<<<<< @@ -2619,7 +2619,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_8open(struct __pyx_obj_4ssh2_4sftp_S } } - /* "ssh2/sftp.pyx":255 + /* "ssh2/sftp.pyx":257 * _handle = c_sftp.libssh2_sftp_open( * self._sftp, _filename, flags, mode) * if _handle is NULL: # <<<<<<<<<<<<<< @@ -2629,7 +2629,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_8open(struct __pyx_obj_4ssh2_4sftp_S __pyx_t_3 = ((__pyx_v__handle == NULL) != 0); if (__pyx_t_3) { - /* "ssh2/sftp.pyx":256 + /* "ssh2/sftp.pyx":258 * self._sftp, _filename, flags, mode) * if _handle is NULL: * return handle_error_codes(c_ssh2.libssh2_session_last_errno( # <<<<<<<<<<<<<< @@ -2638,29 +2638,29 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_8open(struct __pyx_obj_4ssh2_4sftp_S */ __Pyx_XDECREF(__pyx_r); - /* "ssh2/sftp.pyx":257 + /* "ssh2/sftp.pyx":259 * if _handle is NULL: * return handle_error_codes(c_ssh2.libssh2_session_last_errno( * self._session._session)) # <<<<<<<<<<<<<< * return PySFTPHandle(_handle, self) * */ - __pyx_t_4 = __pyx_f_4ssh2_5utils_handle_error_codes(libssh2_session_last_errno(__pyx_v_self->_session->_session), 0); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 256, __pyx_L1_error) + __pyx_t_4 = __pyx_f_4ssh2_5utils_handle_error_codes(libssh2_session_last_errno(__pyx_v_self->_session->_session), 0); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 258, __pyx_L1_error) - /* "ssh2/sftp.pyx":256 + /* "ssh2/sftp.pyx":258 * self._sftp, _filename, flags, mode) * if _handle is NULL: * return handle_error_codes(c_ssh2.libssh2_session_last_errno( # <<<<<<<<<<<<<< * self._session._session)) * return PySFTPHandle(_handle, self) */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 256, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 258, __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 * _handle = c_sftp.libssh2_sftp_open( * self._sftp, _filename, flags, mode) * if _handle is NULL: # <<<<<<<<<<<<<< @@ -2669,7 +2669,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_8open(struct __pyx_obj_4ssh2_4sftp_S */ } - /* "ssh2/sftp.pyx":258 + /* "ssh2/sftp.pyx":260 * return handle_error_codes(c_ssh2.libssh2_session_last_errno( * self._session._session)) * return PySFTPHandle(_handle, self) # <<<<<<<<<<<<<< @@ -2677,7 +2677,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_8open(struct __pyx_obj_4ssh2_4sftp_S * def opendir(self, path not None): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_4ssh2_11sftp_handle_PySFTPHandle(__pyx_v__handle, __pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 258, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_11sftp_handle_PySFTPHandle(__pyx_v__handle, __pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -2703,7 +2703,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_8open(struct __pyx_obj_4ssh2_4sftp_S return __pyx_r; } -/* "ssh2/sftp.pyx":260 +/* "ssh2/sftp.pyx":262 * return PySFTPHandle(_handle, self) * * def opendir(self, path not None): # <<<<<<<<<<<<<< @@ -2722,7 +2722,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, 260, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "path"); __PYX_ERR(0, 262, __pyx_L1_error) } __pyx_r = __pyx_pf_4ssh2_4sftp_4SFTP_10opendir(((struct __pyx_obj_4ssh2_4sftp_SFTP *)__pyx_v_self), ((PyObject *)__pyx_v_path)); @@ -2750,19 +2750,19 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_10opendir(struct __pyx_obj_4ssh2_4sf int __pyx_clineno = 0; __Pyx_RefNannySetupContext("opendir", 0); - /* "ssh2/sftp.pyx":272 + /* "ssh2/sftp.pyx":274 * """ * cdef c_sftp.LIBSSH2_SFTP_HANDLE *_handle * cdef bytes b_path = to_bytes(path) # <<<<<<<<<<<<<< * cdef char *_path = b_path * with nogil: */ - __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 272, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_b_path = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/sftp.pyx":273 + /* "ssh2/sftp.pyx":275 * cdef c_sftp.LIBSSH2_SFTP_HANDLE *_handle * cdef bytes b_path = to_bytes(path) * cdef char *_path = b_path # <<<<<<<<<<<<<< @@ -2771,12 +2771,12 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_10opendir(struct __pyx_obj_4ssh2_4sf */ if (unlikely(__pyx_v_b_path == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 273, __pyx_L1_error) + __PYX_ERR(0, 275, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_path); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 273, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_path); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 275, __pyx_L1_error) __pyx_v__path = __pyx_t_2; - /* "ssh2/sftp.pyx":274 + /* "ssh2/sftp.pyx":276 * cdef bytes b_path = to_bytes(path) * cdef char *_path = b_path * with nogil: # <<<<<<<<<<<<<< @@ -2791,7 +2791,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_10opendir(struct __pyx_obj_4ssh2_4sf #endif /*try:*/ { - /* "ssh2/sftp.pyx":275 + /* "ssh2/sftp.pyx":277 * cdef char *_path = b_path * with nogil: * _handle = c_sftp.libssh2_sftp_opendir(self._sftp, _path) # <<<<<<<<<<<<<< @@ -2801,7 +2801,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":274 + /* "ssh2/sftp.pyx":276 * cdef bytes b_path = to_bytes(path) * cdef char *_path = b_path * with nogil: # <<<<<<<<<<<<<< @@ -2820,7 +2820,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_10opendir(struct __pyx_obj_4ssh2_4sf } } - /* "ssh2/sftp.pyx":276 + /* "ssh2/sftp.pyx":278 * with nogil: * _handle = c_sftp.libssh2_sftp_opendir(self._sftp, _path) * if _handle is NULL: # <<<<<<<<<<<<<< @@ -2830,7 +2830,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_10opendir(struct __pyx_obj_4ssh2_4sf __pyx_t_3 = ((__pyx_v__handle == NULL) != 0); if (__pyx_t_3) { - /* "ssh2/sftp.pyx":277 + /* "ssh2/sftp.pyx":279 * _handle = c_sftp.libssh2_sftp_opendir(self._sftp, _path) * if _handle is NULL: * return handle_error_codes(c_ssh2.libssh2_session_last_errno( # <<<<<<<<<<<<<< @@ -2839,29 +2839,29 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_10opendir(struct __pyx_obj_4ssh2_4sf */ __Pyx_XDECREF(__pyx_r); - /* "ssh2/sftp.pyx":278 + /* "ssh2/sftp.pyx":280 * if _handle is NULL: * return handle_error_codes(c_ssh2.libssh2_session_last_errno( * self._session._session)) # <<<<<<<<<<<<<< * return PySFTPHandle(_handle, self) * */ - __pyx_t_4 = __pyx_f_4ssh2_5utils_handle_error_codes(libssh2_session_last_errno(__pyx_v_self->_session->_session), 0); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 277, __pyx_L1_error) + __pyx_t_4 = __pyx_f_4ssh2_5utils_handle_error_codes(libssh2_session_last_errno(__pyx_v_self->_session->_session), 0); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 279, __pyx_L1_error) - /* "ssh2/sftp.pyx":277 + /* "ssh2/sftp.pyx":279 * _handle = c_sftp.libssh2_sftp_opendir(self._sftp, _path) * if _handle is NULL: * return handle_error_codes(c_ssh2.libssh2_session_last_errno( # <<<<<<<<<<<<<< * self._session._session)) * return PySFTPHandle(_handle, self) */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 277, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 279, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/sftp.pyx":276 + /* "ssh2/sftp.pyx":278 * with nogil: * _handle = c_sftp.libssh2_sftp_opendir(self._sftp, _path) * if _handle is NULL: # <<<<<<<<<<<<<< @@ -2870,7 +2870,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_10opendir(struct __pyx_obj_4ssh2_4sf */ } - /* "ssh2/sftp.pyx":279 + /* "ssh2/sftp.pyx":281 * return handle_error_codes(c_ssh2.libssh2_session_last_errno( * self._session._session)) * return PySFTPHandle(_handle, self) # <<<<<<<<<<<<<< @@ -2878,13 +2878,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_1 = __pyx_f_4ssh2_11sftp_handle_PySFTPHandle(__pyx_v__handle, __pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 279, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_11sftp_handle_PySFTPHandle(__pyx_v__handle, __pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 281, __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":262 * return PySFTPHandle(_handle, self) * * def opendir(self, path not None): # <<<<<<<<<<<<<< @@ -2904,7 +2904,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_10opendir(struct __pyx_obj_4ssh2_4sf return __pyx_r; } -/* "ssh2/sftp.pyx":281 +/* "ssh2/sftp.pyx":283 * return PySFTPHandle(_handle, self) * * def rename_ex(self, const char *source_filename, # <<<<<<<<<<<<<< @@ -2956,29 +2956,29 @@ static PyObject *__pyx_pw_4ssh2_4sftp_4SFTP_13rename_ex(PyObject *__pyx_v_self, case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_source_filename_len)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("rename_ex", 1, 5, 5, 1); __PYX_ERR(0, 281, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("rename_ex", 1, 5, 5, 1); __PYX_ERR(0, 283, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dest_filename)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("rename_ex", 1, 5, 5, 2); __PYX_ERR(0, 281, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("rename_ex", 1, 5, 5, 2); __PYX_ERR(0, 283, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dest_filename_len)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("rename_ex", 1, 5, 5, 3); __PYX_ERR(0, 281, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("rename_ex", 1, 5, 5, 3); __PYX_ERR(0, 283, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("rename_ex", 1, 5, 5, 4); __PYX_ERR(0, 281, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("rename_ex", 1, 5, 5, 4); __PYX_ERR(0, 283, __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, 281, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "rename_ex") < 0)) __PYX_ERR(0, 283, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 5) { goto __pyx_L5_argtuple_error; @@ -2989,15 +2989,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, 281, __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, 282, __pyx_L3_error) - __pyx_v_dest_filename = __Pyx_PyObject_AsString(values[2]); if (unlikely((!__pyx_v_dest_filename) && PyErr_Occurred())) __PYX_ERR(0, 283, __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, 284, __pyx_L3_error) - __pyx_v_flags = __Pyx_PyInt_As_long(values[4]); if (unlikely((__pyx_v_flags == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 285, __pyx_L3_error) + __pyx_v_source_filename = __Pyx_PyObject_AsString(values[0]); if (unlikely((!__pyx_v_source_filename) && PyErr_Occurred())) __PYX_ERR(0, 283, __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, 284, __pyx_L3_error) + __pyx_v_dest_filename = __Pyx_PyObject_AsString(values[2]); if (unlikely((!__pyx_v_dest_filename) && PyErr_Occurred())) __PYX_ERR(0, 285, __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, 286, __pyx_L3_error) + __pyx_v_flags = __Pyx_PyInt_As_long(values[4]); if (unlikely((__pyx_v_flags == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 287, __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, 281, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("rename_ex", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 283, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.sftp.SFTP.rename_ex", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -3021,7 +3021,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_12rename_ex(struct __pyx_obj_4ssh2_4 int __pyx_clineno = 0; __Pyx_RefNannySetupContext("rename_ex", 0); - /* "ssh2/sftp.pyx":287 + /* "ssh2/sftp.pyx":289 * long flags): * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -3036,7 +3036,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_12rename_ex(struct __pyx_obj_4ssh2_4 #endif /*try:*/ { - /* "ssh2/sftp.pyx":288 + /* "ssh2/sftp.pyx":290 * cdef int rc * with nogil: * rc = c_sftp.libssh2_sftp_rename_ex( # <<<<<<<<<<<<<< @@ -3046,7 +3046,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":287 + /* "ssh2/sftp.pyx":289 * long flags): * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -3065,7 +3065,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_12rename_ex(struct __pyx_obj_4ssh2_4 } } - /* "ssh2/sftp.pyx":291 + /* "ssh2/sftp.pyx":293 * self._sftp, source_filename, source_filename_len, * dest_filename, dest_filename_len, flags) * return handle_error_codes(rc) # <<<<<<<<<<<<<< @@ -3073,14 +3073,14 @@ 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_f_4ssh2_5utils_handle_error_codes(__pyx_v_rc, 0); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 291, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 291, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_5utils_handle_error_codes(__pyx_v_rc, 0); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 293, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 293, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "ssh2/sftp.pyx":281 + /* "ssh2/sftp.pyx":283 * return PySFTPHandle(_handle, self) * * def rename_ex(self, const char *source_filename, # <<<<<<<<<<<<<< @@ -3099,7 +3099,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_12rename_ex(struct __pyx_obj_4ssh2_4 return __pyx_r; } -/* "ssh2/sftp.pyx":293 +/* "ssh2/sftp.pyx":295 * return handle_error_codes(rc) * * def rename(self, source_filename not None, dest_filename not None): # <<<<<<<<<<<<<< @@ -3142,11 +3142,11 @@ static PyObject *__pyx_pw_4ssh2_4sftp_4SFTP_15rename(PyObject *__pyx_v_self, PyO case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dest_filename)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("rename", 1, 2, 2, 1); __PYX_ERR(0, 293, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("rename", 1, 2, 2, 1); __PYX_ERR(0, 295, __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, 293, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "rename") < 0)) __PYX_ERR(0, 295, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -3159,17 +3159,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, 293, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("rename", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 295, __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, 293, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "source_filename"); __PYX_ERR(0, 295, __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, 293, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "dest_filename"); __PYX_ERR(0, 295, __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); @@ -3198,31 +3198,31 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_14rename(struct __pyx_obj_4ssh2_4sft int __pyx_clineno = 0; __Pyx_RefNannySetupContext("rename", 0); - /* "ssh2/sftp.pyx":301 + /* "ssh2/sftp.pyx":303 * :type dest_filename: str""" * cdef int rc * cdef bytes b_source_filename = to_bytes(source_filename) # <<<<<<<<<<<<<< * cdef bytes b_dest_filename = to_bytes(dest_filename) * cdef char *_source_filename = b_source_filename */ - __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_source_filename); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 301, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_source_filename); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_b_source_filename = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/sftp.pyx":302 + /* "ssh2/sftp.pyx":304 * cdef int rc * cdef bytes b_source_filename = to_bytes(source_filename) * cdef bytes b_dest_filename = to_bytes(dest_filename) # <<<<<<<<<<<<<< * cdef char *_source_filename = b_source_filename * cdef char *_dest_filename = b_dest_filename */ - __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_dest_filename); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 302, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_dest_filename); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_b_dest_filename = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/sftp.pyx":303 + /* "ssh2/sftp.pyx":305 * cdef bytes b_source_filename = to_bytes(source_filename) * cdef bytes b_dest_filename = to_bytes(dest_filename) * cdef char *_source_filename = b_source_filename # <<<<<<<<<<<<<< @@ -3231,12 +3231,12 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_14rename(struct __pyx_obj_4ssh2_4sft */ if (unlikely(__pyx_v_b_source_filename == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 303, __pyx_L1_error) + __PYX_ERR(0, 305, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_source_filename); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 303, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_source_filename); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 305, __pyx_L1_error) __pyx_v__source_filename = __pyx_t_2; - /* "ssh2/sftp.pyx":304 + /* "ssh2/sftp.pyx":306 * cdef bytes b_dest_filename = to_bytes(dest_filename) * cdef char *_source_filename = b_source_filename * cdef char *_dest_filename = b_dest_filename # <<<<<<<<<<<<<< @@ -3245,12 +3245,12 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_14rename(struct __pyx_obj_4ssh2_4sft */ if (unlikely(__pyx_v_b_dest_filename == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 304, __pyx_L1_error) + __PYX_ERR(0, 306, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_dest_filename); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 304, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_dest_filename); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 306, __pyx_L1_error) __pyx_v__dest_filename = __pyx_t_2; - /* "ssh2/sftp.pyx":305 + /* "ssh2/sftp.pyx":307 * cdef char *_source_filename = b_source_filename * cdef char *_dest_filename = b_dest_filename * with nogil: # <<<<<<<<<<<<<< @@ -3265,7 +3265,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_14rename(struct __pyx_obj_4ssh2_4sft #endif /*try:*/ { - /* "ssh2/sftp.pyx":306 + /* "ssh2/sftp.pyx":308 * cdef char *_dest_filename = b_dest_filename * with nogil: * rc = c_sftp.libssh2_sftp_rename( # <<<<<<<<<<<<<< @@ -3275,7 +3275,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":305 + /* "ssh2/sftp.pyx":307 * cdef char *_source_filename = b_source_filename * cdef char *_dest_filename = b_dest_filename * with nogil: # <<<<<<<<<<<<<< @@ -3294,7 +3294,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_14rename(struct __pyx_obj_4ssh2_4sft } } - /* "ssh2/sftp.pyx":308 + /* "ssh2/sftp.pyx":310 * rc = c_sftp.libssh2_sftp_rename( * self._sftp, _source_filename, _dest_filename) * return handle_error_codes(rc) # <<<<<<<<<<<<<< @@ -3302,14 +3302,14 @@ 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_3 = __pyx_f_4ssh2_5utils_handle_error_codes(__pyx_v_rc, 0); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 308, __pyx_L1_error) - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 308, __pyx_L1_error) + __pyx_t_3 = __pyx_f_4ssh2_5utils_handle_error_codes(__pyx_v_rc, 0); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 310, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_t_3); 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/sftp.pyx":293 + /* "ssh2/sftp.pyx":295 * return handle_error_codes(rc) * * def rename(self, source_filename not None, dest_filename not None): # <<<<<<<<<<<<<< @@ -3330,7 +3330,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_14rename(struct __pyx_obj_4ssh2_4sft return __pyx_r; } -/* "ssh2/sftp.pyx":310 +/* "ssh2/sftp.pyx":312 * return handle_error_codes(rc) * * def unlink(self, filename not None): # <<<<<<<<<<<<<< @@ -3349,7 +3349,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, 310, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "filename"); __PYX_ERR(0, 312, __pyx_L1_error) } __pyx_r = __pyx_pf_4ssh2_4sftp_4SFTP_16unlink(((struct __pyx_obj_4ssh2_4sftp_SFTP *)__pyx_v_self), ((PyObject *)__pyx_v_filename)); @@ -3376,19 +3376,19 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_16unlink(struct __pyx_obj_4ssh2_4sft int __pyx_clineno = 0; __Pyx_RefNannySetupContext("unlink", 0); - /* "ssh2/sftp.pyx":316 + /* "ssh2/sftp.pyx":318 * :type filename: str""" * cdef int rc * cdef bytes b_filename = to_bytes(filename) # <<<<<<<<<<<<<< * cdef char *_filename = b_filename * with nogil: */ - __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_filename); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 316, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_filename); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_b_filename = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/sftp.pyx":317 + /* "ssh2/sftp.pyx":319 * cdef int rc * cdef bytes b_filename = to_bytes(filename) * cdef char *_filename = b_filename # <<<<<<<<<<<<<< @@ -3397,12 +3397,12 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_16unlink(struct __pyx_obj_4ssh2_4sft */ if (unlikely(__pyx_v_b_filename == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 317, __pyx_L1_error) + __PYX_ERR(0, 319, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_filename); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 317, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_filename); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 319, __pyx_L1_error) __pyx_v__filename = __pyx_t_2; - /* "ssh2/sftp.pyx":318 + /* "ssh2/sftp.pyx":320 * cdef bytes b_filename = to_bytes(filename) * cdef char *_filename = b_filename * with nogil: # <<<<<<<<<<<<<< @@ -3417,7 +3417,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_16unlink(struct __pyx_obj_4ssh2_4sft #endif /*try:*/ { - /* "ssh2/sftp.pyx":319 + /* "ssh2/sftp.pyx":321 * cdef char *_filename = b_filename * with nogil: * rc = c_sftp.libssh2_sftp_unlink(self._sftp, _filename) # <<<<<<<<<<<<<< @@ -3427,7 +3427,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":318 + /* "ssh2/sftp.pyx":320 * cdef bytes b_filename = to_bytes(filename) * cdef char *_filename = b_filename * with nogil: # <<<<<<<<<<<<<< @@ -3446,7 +3446,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_16unlink(struct __pyx_obj_4ssh2_4sft } } - /* "ssh2/sftp.pyx":320 + /* "ssh2/sftp.pyx":322 * with nogil: * rc = c_sftp.libssh2_sftp_unlink(self._sftp, _filename) * return handle_error_codes(rc) # <<<<<<<<<<<<<< @@ -3454,14 +3454,14 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_16unlink(struct __pyx_obj_4ssh2_4sft * def statvfs(self, path): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __pyx_f_4ssh2_5utils_handle_error_codes(__pyx_v_rc, 0); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 320, __pyx_L1_error) - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 320, __pyx_L1_error) + __pyx_t_3 = __pyx_f_4ssh2_5utils_handle_error_codes(__pyx_v_rc, 0); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 322, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/sftp.pyx":310 + /* "ssh2/sftp.pyx":312 * return handle_error_codes(rc) * * def unlink(self, filename not None): # <<<<<<<<<<<<<< @@ -3481,7 +3481,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_16unlink(struct __pyx_obj_4ssh2_4sft return __pyx_r; } -/* "ssh2/sftp.pyx":322 +/* "ssh2/sftp.pyx":324 * return handle_error_codes(rc) * * def statvfs(self, path): # <<<<<<<<<<<<<< @@ -3521,31 +3521,31 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_18statvfs(struct __pyx_obj_4ssh2_4sf int __pyx_clineno = 0; __Pyx_RefNannySetupContext("statvfs", 0); - /* "ssh2/sftp.pyx":326 + /* "ssh2/sftp.pyx":328 * * :rtype: `ssh2.sftp.SFTPStatVFS` or int of error code""" * cdef SFTPStatVFS vfs = SFTPStatVFS(self) # <<<<<<<<<<<<<< * cdef bytes b_path = to_bytes(path) * cdef char *_path = b_path */ - __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_4ssh2_11sftp_handle_SFTPStatVFS), ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 326, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_4ssh2_11sftp_handle_SFTPStatVFS), ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 328, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_vfs = ((struct __pyx_obj_4ssh2_11sftp_handle_SFTPStatVFS *)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/sftp.pyx":327 + /* "ssh2/sftp.pyx":329 * :rtype: `ssh2.sftp.SFTPStatVFS` or int of error code""" * cdef SFTPStatVFS vfs = SFTPStatVFS(self) * cdef bytes b_path = to_bytes(path) # <<<<<<<<<<<<<< * cdef char *_path = b_path * cdef size_t path_len = len(b_path) */ - __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 327, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 329, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_b_path = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/sftp.pyx":328 + /* "ssh2/sftp.pyx":330 * cdef SFTPStatVFS vfs = SFTPStatVFS(self) * cdef bytes b_path = to_bytes(path) * cdef char *_path = b_path # <<<<<<<<<<<<<< @@ -3554,12 +3554,12 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_18statvfs(struct __pyx_obj_4ssh2_4sf */ if (unlikely(__pyx_v_b_path == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 328, __pyx_L1_error) + __PYX_ERR(0, 330, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_path); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 328, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_path); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 330, __pyx_L1_error) __pyx_v__path = __pyx_t_2; - /* "ssh2/sftp.pyx":329 + /* "ssh2/sftp.pyx":331 * cdef bytes b_path = to_bytes(path) * cdef char *_path = b_path * cdef size_t path_len = len(b_path) # <<<<<<<<<<<<<< @@ -3568,12 +3568,12 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_18statvfs(struct __pyx_obj_4ssh2_4sf */ if (unlikely(__pyx_v_b_path == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 329, __pyx_L1_error) + __PYX_ERR(0, 331, __pyx_L1_error) } - __pyx_t_3 = PyBytes_GET_SIZE(__pyx_v_b_path); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 329, __pyx_L1_error) + __pyx_t_3 = PyBytes_GET_SIZE(__pyx_v_b_path); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 331, __pyx_L1_error) __pyx_v_path_len = __pyx_t_3; - /* "ssh2/sftp.pyx":330 + /* "ssh2/sftp.pyx":332 * cdef char *_path = b_path * cdef size_t path_len = len(b_path) * with nogil: # <<<<<<<<<<<<<< @@ -3588,7 +3588,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_18statvfs(struct __pyx_obj_4ssh2_4sf #endif /*try:*/ { - /* "ssh2/sftp.pyx":331 + /* "ssh2/sftp.pyx":333 * cdef size_t path_len = len(b_path) * with nogil: * rc = c_sftp.libssh2_sftp_statvfs( # <<<<<<<<<<<<<< @@ -3598,7 +3598,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_18statvfs(struct __pyx_obj_4ssh2_4sf __pyx_v_rc = libssh2_sftp_statvfs(__pyx_v_self->_sftp, __pyx_v__path, __pyx_v_path_len, __pyx_v_vfs->_ptr); } - /* "ssh2/sftp.pyx":330 + /* "ssh2/sftp.pyx":332 * cdef char *_path = b_path * cdef size_t path_len = len(b_path) * with nogil: # <<<<<<<<<<<<<< @@ -3617,7 +3617,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_18statvfs(struct __pyx_obj_4ssh2_4sf } } - /* "ssh2/sftp.pyx":333 + /* "ssh2/sftp.pyx":335 * rc = c_sftp.libssh2_sftp_statvfs( * self._sftp, _path, path_len, vfs._ptr) * return handle_error_codes(rc) if rc != 0 else vfs # <<<<<<<<<<<<<< @@ -3626,8 +3626,8 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_18statvfs(struct __pyx_obj_4ssh2_4sf */ __Pyx_XDECREF(__pyx_r); if (((__pyx_v_rc != 0) != 0)) { - __pyx_t_4 = __pyx_f_4ssh2_5utils_handle_error_codes(__pyx_v_rc, 0); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 333, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 333, __pyx_L1_error) + __pyx_t_4 = __pyx_f_4ssh2_5utils_handle_error_codes(__pyx_v_rc, 0); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 335, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __pyx_t_5 = 0; @@ -3639,7 +3639,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_18statvfs(struct __pyx_obj_4ssh2_4sf __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/sftp.pyx":322 + /* "ssh2/sftp.pyx":324 * return handle_error_codes(rc) * * def statvfs(self, path): # <<<<<<<<<<<<<< @@ -3661,7 +3661,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_18statvfs(struct __pyx_obj_4ssh2_4sf return __pyx_r; } -/* "ssh2/sftp.pyx":335 +/* "ssh2/sftp.pyx":337 * return handle_error_codes(rc) if rc != 0 else vfs * * def mkdir(self, path not None, long mode): # <<<<<<<<<<<<<< @@ -3704,11 +3704,11 @@ static PyObject *__pyx_pw_4ssh2_4sftp_4SFTP_21mkdir(PyObject *__pyx_v_self, PyOb case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("mkdir", 1, 2, 2, 1); __PYX_ERR(0, 335, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("mkdir", 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, "mkdir") < 0)) __PYX_ERR(0, 335, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "mkdir") < 0)) __PYX_ERR(0, 337, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -3717,18 +3717,18 @@ static PyObject *__pyx_pw_4ssh2_4sftp_4SFTP_21mkdir(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, 335, __pyx_L3_error) + __pyx_v_mode = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v_mode == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 337, __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, 335, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("mkdir", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 337, __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, 335, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "path"); __PYX_ERR(0, 337, __pyx_L1_error) } __pyx_r = __pyx_pf_4ssh2_4sftp_4SFTP_20mkdir(((struct __pyx_obj_4ssh2_4sftp_SFTP *)__pyx_v_self), __pyx_v_path, __pyx_v_mode); @@ -3755,19 +3755,19 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_20mkdir(struct __pyx_obj_4ssh2_4sftp int __pyx_clineno = 0; __Pyx_RefNannySetupContext("mkdir", 0); - /* "ssh2/sftp.pyx":348 + /* "ssh2/sftp.pyx":350 * """ * cdef int rc * cdef bytes b_path = to_bytes(path) # <<<<<<<<<<<<<< * cdef char *_path = b_path * with nogil: */ - __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 348, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 350, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_b_path = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/sftp.pyx":349 + /* "ssh2/sftp.pyx":351 * cdef int rc * cdef bytes b_path = to_bytes(path) * cdef char *_path = b_path # <<<<<<<<<<<<<< @@ -3776,12 +3776,12 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_20mkdir(struct __pyx_obj_4ssh2_4sftp */ if (unlikely(__pyx_v_b_path == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 349, __pyx_L1_error) + __PYX_ERR(0, 351, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_path); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 349, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_path); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 351, __pyx_L1_error) __pyx_v__path = __pyx_t_2; - /* "ssh2/sftp.pyx":350 + /* "ssh2/sftp.pyx":352 * cdef bytes b_path = to_bytes(path) * cdef char *_path = b_path * with nogil: # <<<<<<<<<<<<<< @@ -3796,7 +3796,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_20mkdir(struct __pyx_obj_4ssh2_4sftp #endif /*try:*/ { - /* "ssh2/sftp.pyx":351 + /* "ssh2/sftp.pyx":353 * cdef char *_path = b_path * with nogil: * rc = c_sftp.libssh2_sftp_mkdir(self._sftp, _path, mode) # <<<<<<<<<<<<<< @@ -3806,7 +3806,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_20mkdir(struct __pyx_obj_4ssh2_4sftp __pyx_v_rc = libssh2_sftp_mkdir(__pyx_v_self->_sftp, __pyx_v__path, __pyx_v_mode); } - /* "ssh2/sftp.pyx":350 + /* "ssh2/sftp.pyx":352 * cdef bytes b_path = to_bytes(path) * cdef char *_path = b_path * with nogil: # <<<<<<<<<<<<<< @@ -3825,7 +3825,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_20mkdir(struct __pyx_obj_4ssh2_4sftp } } - /* "ssh2/sftp.pyx":352 + /* "ssh2/sftp.pyx":354 * with nogil: * rc = c_sftp.libssh2_sftp_mkdir(self._sftp, _path, mode) * return handle_error_codes(rc) # <<<<<<<<<<<<<< @@ -3833,14 +3833,14 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_20mkdir(struct __pyx_obj_4ssh2_4sftp * def rmdir(self, path not None): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __pyx_f_4ssh2_5utils_handle_error_codes(__pyx_v_rc, 0); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 352, __pyx_L1_error) - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 352, __pyx_L1_error) + __pyx_t_3 = __pyx_f_4ssh2_5utils_handle_error_codes(__pyx_v_rc, 0); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 354, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 354, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/sftp.pyx":335 + /* "ssh2/sftp.pyx":337 * return handle_error_codes(rc) if rc != 0 else vfs * * def mkdir(self, path not None, long mode): # <<<<<<<<<<<<<< @@ -3860,7 +3860,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_20mkdir(struct __pyx_obj_4ssh2_4sftp return __pyx_r; } -/* "ssh2/sftp.pyx":354 +/* "ssh2/sftp.pyx":356 * return handle_error_codes(rc) * * def rmdir(self, path not None): # <<<<<<<<<<<<<< @@ -3879,7 +3879,7 @@ static PyObject *__pyx_pw_4ssh2_4sftp_4SFTP_23rmdir(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, 354, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "path"); __PYX_ERR(0, 356, __pyx_L1_error) } __pyx_r = __pyx_pf_4ssh2_4sftp_4SFTP_22rmdir(((struct __pyx_obj_4ssh2_4sftp_SFTP *)__pyx_v_self), ((PyObject *)__pyx_v_path)); @@ -3906,19 +3906,19 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_22rmdir(struct __pyx_obj_4ssh2_4sftp int __pyx_clineno = 0; __Pyx_RefNannySetupContext("rmdir", 0); - /* "ssh2/sftp.pyx":362 + /* "ssh2/sftp.pyx":364 * :rtype: int""" * cdef int rc * cdef bytes b_path = to_bytes(path) # <<<<<<<<<<<<<< * cdef char *_path = b_path * with nogil: */ - __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 362, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 364, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_b_path = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/sftp.pyx":363 + /* "ssh2/sftp.pyx":365 * cdef int rc * cdef bytes b_path = to_bytes(path) * cdef char *_path = b_path # <<<<<<<<<<<<<< @@ -3927,12 +3927,12 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_22rmdir(struct __pyx_obj_4ssh2_4sftp */ if (unlikely(__pyx_v_b_path == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 363, __pyx_L1_error) + __PYX_ERR(0, 365, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_path); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 363, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_path); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 365, __pyx_L1_error) __pyx_v__path = __pyx_t_2; - /* "ssh2/sftp.pyx":364 + /* "ssh2/sftp.pyx":366 * cdef bytes b_path = to_bytes(path) * cdef char *_path = b_path * with nogil: # <<<<<<<<<<<<<< @@ -3947,7 +3947,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_22rmdir(struct __pyx_obj_4ssh2_4sftp #endif /*try:*/ { - /* "ssh2/sftp.pyx":365 + /* "ssh2/sftp.pyx":367 * cdef char *_path = b_path * with nogil: * rc = c_sftp.libssh2_sftp_rmdir(self._sftp, _path) # <<<<<<<<<<<<<< @@ -3957,7 +3957,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_22rmdir(struct __pyx_obj_4ssh2_4sftp __pyx_v_rc = libssh2_sftp_rmdir(__pyx_v_self->_sftp, __pyx_v__path); } - /* "ssh2/sftp.pyx":364 + /* "ssh2/sftp.pyx":366 * cdef bytes b_path = to_bytes(path) * cdef char *_path = b_path * with nogil: # <<<<<<<<<<<<<< @@ -3976,7 +3976,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_22rmdir(struct __pyx_obj_4ssh2_4sftp } } - /* "ssh2/sftp.pyx":366 + /* "ssh2/sftp.pyx":368 * with nogil: * rc = c_sftp.libssh2_sftp_rmdir(self._sftp, _path) * return handle_error_codes(rc) # <<<<<<<<<<<<<< @@ -3984,14 +3984,14 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_22rmdir(struct __pyx_obj_4ssh2_4sftp * def stat(self, path not None): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __pyx_f_4ssh2_5utils_handle_error_codes(__pyx_v_rc, 0); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 366, __pyx_L1_error) - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 366, __pyx_L1_error) + __pyx_t_3 = __pyx_f_4ssh2_5utils_handle_error_codes(__pyx_v_rc, 0); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 368, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 368, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/sftp.pyx":354 + /* "ssh2/sftp.pyx":356 * return handle_error_codes(rc) * * def rmdir(self, path not None): # <<<<<<<<<<<<<< @@ -4011,7 +4011,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_22rmdir(struct __pyx_obj_4ssh2_4sftp return __pyx_r; } -/* "ssh2/sftp.pyx":368 +/* "ssh2/sftp.pyx":370 * return handle_error_codes(rc) * * def stat(self, path not None): # <<<<<<<<<<<<<< @@ -4030,7 +4030,7 @@ static PyObject *__pyx_pw_4ssh2_4sftp_4SFTP_25stat(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, 368, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "path"); __PYX_ERR(0, 370, __pyx_L1_error) } __pyx_r = __pyx_pf_4ssh2_4sftp_4SFTP_24stat(((struct __pyx_obj_4ssh2_4sftp_SFTP *)__pyx_v_self), ((PyObject *)__pyx_v_path)); @@ -4059,19 +4059,19 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_24stat(struct __pyx_obj_4ssh2_4sftp_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("stat", 0); - /* "ssh2/sftp.pyx":377 + /* "ssh2/sftp.pyx":379 * LIBSSH2_ERROR_EAGAIN""" * cdef int rc * cdef bytes b_path = to_bytes(path) # <<<<<<<<<<<<<< * cdef char *_path = b_path * cdef SFTPAttributes attrs = SFTPAttributes() */ - __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 377, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_b_path = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/sftp.pyx":378 + /* "ssh2/sftp.pyx":380 * cdef int rc * cdef bytes b_path = to_bytes(path) * cdef char *_path = b_path # <<<<<<<<<<<<<< @@ -4080,24 +4080,24 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_24stat(struct __pyx_obj_4ssh2_4sftp_ */ if (unlikely(__pyx_v_b_path == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 378, __pyx_L1_error) + __PYX_ERR(0, 380, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_path); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 378, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_path); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 380, __pyx_L1_error) __pyx_v__path = __pyx_t_2; - /* "ssh2/sftp.pyx":379 + /* "ssh2/sftp.pyx":381 * cdef bytes b_path = to_bytes(path) * cdef char *_path = b_path * cdef SFTPAttributes attrs = SFTPAttributes() # <<<<<<<<<<<<<< * with nogil: * rc = c_sftp.libssh2_sftp_stat( */ - __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_4ssh2_11sftp_handle_SFTPAttributes)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 379, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_4ssh2_11sftp_handle_SFTPAttributes)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_attrs = ((struct __pyx_obj_4ssh2_11sftp_handle_SFTPAttributes *)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/sftp.pyx":380 + /* "ssh2/sftp.pyx":382 * cdef char *_path = b_path * cdef SFTPAttributes attrs = SFTPAttributes() * with nogil: # <<<<<<<<<<<<<< @@ -4112,7 +4112,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_24stat(struct __pyx_obj_4ssh2_4sftp_ #endif /*try:*/ { - /* "ssh2/sftp.pyx":381 + /* "ssh2/sftp.pyx":383 * cdef SFTPAttributes attrs = SFTPAttributes() * with nogil: * rc = c_sftp.libssh2_sftp_stat( # <<<<<<<<<<<<<< @@ -4122,7 +4122,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_24stat(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":380 + /* "ssh2/sftp.pyx":382 * cdef char *_path = b_path * cdef SFTPAttributes attrs = SFTPAttributes() * with nogil: # <<<<<<<<<<<<<< @@ -4141,7 +4141,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_24stat(struct __pyx_obj_4ssh2_4sftp_ } } - /* "ssh2/sftp.pyx":383 + /* "ssh2/sftp.pyx":385 * rc = c_sftp.libssh2_sftp_stat( * self._sftp, _path, attrs._attrs) * return handle_error_codes(rc) if rc != 0 else attrs # <<<<<<<<<<<<<< @@ -4150,8 +4150,8 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_24stat(struct __pyx_obj_4ssh2_4sftp_ */ __Pyx_XDECREF(__pyx_r); if (((__pyx_v_rc != 0) != 0)) { - __pyx_t_3 = __pyx_f_4ssh2_5utils_handle_error_codes(__pyx_v_rc, 0); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 383, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 383, __pyx_L1_error) + __pyx_t_3 = __pyx_f_4ssh2_5utils_handle_error_codes(__pyx_v_rc, 0); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 385, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 385, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = __pyx_t_4; __pyx_t_4 = 0; @@ -4163,7 +4163,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_24stat(struct __pyx_obj_4ssh2_4sftp_ __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/sftp.pyx":368 + /* "ssh2/sftp.pyx":370 * return handle_error_codes(rc) * * def stat(self, path not None): # <<<<<<<<<<<<<< @@ -4185,7 +4185,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_24stat(struct __pyx_obj_4ssh2_4sftp_ return __pyx_r; } -/* "ssh2/sftp.pyx":385 +/* "ssh2/sftp.pyx":387 * return handle_error_codes(rc) if rc != 0 else attrs * * def lstat(self, path not None): # <<<<<<<<<<<<<< @@ -4204,7 +4204,7 @@ static PyObject *__pyx_pw_4ssh2_4sftp_4SFTP_27lstat(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, 385, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "path"); __PYX_ERR(0, 387, __pyx_L1_error) } __pyx_r = __pyx_pf_4ssh2_4sftp_4SFTP_26lstat(((struct __pyx_obj_4ssh2_4sftp_SFTP *)__pyx_v_self), ((PyObject *)__pyx_v_path)); @@ -4233,19 +4233,19 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_26lstat(struct __pyx_obj_4ssh2_4sftp int __pyx_clineno = 0; __Pyx_RefNannySetupContext("lstat", 0); - /* "ssh2/sftp.pyx":388 + /* "ssh2/sftp.pyx":390 * """Link stat a file.""" * cdef int rc * cdef bytes b_path = to_bytes(path) # <<<<<<<<<<<<<< * cdef char *_path = b_path * cdef SFTPAttributes attrs = SFTPAttributes() */ - __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 388, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 390, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_b_path = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/sftp.pyx":389 + /* "ssh2/sftp.pyx":391 * cdef int rc * cdef bytes b_path = to_bytes(path) * cdef char *_path = b_path # <<<<<<<<<<<<<< @@ -4254,24 +4254,24 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_26lstat(struct __pyx_obj_4ssh2_4sftp */ if (unlikely(__pyx_v_b_path == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 389, __pyx_L1_error) + __PYX_ERR(0, 391, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_path); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 389, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_path); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 391, __pyx_L1_error) __pyx_v__path = __pyx_t_2; - /* "ssh2/sftp.pyx":390 + /* "ssh2/sftp.pyx":392 * cdef bytes b_path = to_bytes(path) * cdef char *_path = b_path * cdef SFTPAttributes attrs = SFTPAttributes() # <<<<<<<<<<<<<< * with nogil: * rc = c_sftp.libssh2_sftp_lstat( */ - __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_4ssh2_11sftp_handle_SFTPAttributes)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 390, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_4ssh2_11sftp_handle_SFTPAttributes)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 392, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_attrs = ((struct __pyx_obj_4ssh2_11sftp_handle_SFTPAttributes *)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/sftp.pyx":391 + /* "ssh2/sftp.pyx":393 * cdef char *_path = b_path * cdef SFTPAttributes attrs = SFTPAttributes() * with nogil: # <<<<<<<<<<<<<< @@ -4286,7 +4286,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_26lstat(struct __pyx_obj_4ssh2_4sftp #endif /*try:*/ { - /* "ssh2/sftp.pyx":392 + /* "ssh2/sftp.pyx":394 * cdef SFTPAttributes attrs = SFTPAttributes() * with nogil: * rc = c_sftp.libssh2_sftp_lstat( # <<<<<<<<<<<<<< @@ -4296,7 +4296,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_26lstat(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":391 + /* "ssh2/sftp.pyx":393 * cdef char *_path = b_path * cdef SFTPAttributes attrs = SFTPAttributes() * with nogil: # <<<<<<<<<<<<<< @@ -4315,7 +4315,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_26lstat(struct __pyx_obj_4ssh2_4sftp } } - /* "ssh2/sftp.pyx":394 + /* "ssh2/sftp.pyx":396 * rc = c_sftp.libssh2_sftp_lstat( * self._sftp, _path, attrs._attrs) * return handle_error_codes(rc) if rc != 0 else attrs # <<<<<<<<<<<<<< @@ -4324,8 +4324,8 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_26lstat(struct __pyx_obj_4ssh2_4sftp */ __Pyx_XDECREF(__pyx_r); if (((__pyx_v_rc != 0) != 0)) { - __pyx_t_3 = __pyx_f_4ssh2_5utils_handle_error_codes(__pyx_v_rc, 0); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 394, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 394, __pyx_L1_error) + __pyx_t_3 = __pyx_f_4ssh2_5utils_handle_error_codes(__pyx_v_rc, 0); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 396, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 396, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = __pyx_t_4; __pyx_t_4 = 0; @@ -4337,7 +4337,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_26lstat(struct __pyx_obj_4ssh2_4sftp __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/sftp.pyx":385 + /* "ssh2/sftp.pyx":387 * return handle_error_codes(rc) if rc != 0 else attrs * * def lstat(self, path not None): # <<<<<<<<<<<<<< @@ -4359,7 +4359,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_26lstat(struct __pyx_obj_4ssh2_4sftp return __pyx_r; } -/* "ssh2/sftp.pyx":396 +/* "ssh2/sftp.pyx":398 * return handle_error_codes(rc) if rc != 0 else attrs * * def setstat(self, path not None, SFTPAttributes attrs): # <<<<<<<<<<<<<< @@ -4402,11 +4402,11 @@ static PyObject *__pyx_pw_4ssh2_4sftp_4SFTP_29setstat(PyObject *__pyx_v_self, Py case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_attrs)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("setstat", 1, 2, 2, 1); __PYX_ERR(0, 396, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("setstat", 1, 2, 2, 1); __PYX_ERR(0, 398, __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, 396, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setstat") < 0)) __PYX_ERR(0, 398, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -4419,16 +4419,16 @@ static PyObject *__pyx_pw_4ssh2_4sftp_4SFTP_29setstat(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, 396, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("setstat", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 398, __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, 396, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "path"); __PYX_ERR(0, 398, __pyx_L1_error) } - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_attrs), __pyx_ptype_4ssh2_11sftp_handle_SFTPAttributes, 1, "attrs", 0))) __PYX_ERR(0, 396, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_attrs), __pyx_ptype_4ssh2_11sftp_handle_SFTPAttributes, 1, "attrs", 0))) __PYX_ERR(0, 398, __pyx_L1_error) __pyx_r = __pyx_pf_4ssh2_4sftp_4SFTP_28setstat(((struct __pyx_obj_4ssh2_4sftp_SFTP *)__pyx_v_self), __pyx_v_path, __pyx_v_attrs); /* function exit code */ @@ -4454,19 +4454,19 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_28setstat(struct __pyx_obj_4ssh2_4sf int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setstat", 0); - /* "ssh2/sftp.pyx":406 + /* "ssh2/sftp.pyx":408 * :rtype: int""" * cdef int rc * cdef bytes b_path = to_bytes(path) # <<<<<<<<<<<<<< * cdef char *_path = b_path * with nogil: */ - __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 406, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 408, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_b_path = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/sftp.pyx":407 + /* "ssh2/sftp.pyx":409 * cdef int rc * cdef bytes b_path = to_bytes(path) * cdef char *_path = b_path # <<<<<<<<<<<<<< @@ -4475,12 +4475,12 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_28setstat(struct __pyx_obj_4ssh2_4sf */ if (unlikely(__pyx_v_b_path == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 407, __pyx_L1_error) + __PYX_ERR(0, 409, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_path); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 407, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_path); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 409, __pyx_L1_error) __pyx_v__path = __pyx_t_2; - /* "ssh2/sftp.pyx":408 + /* "ssh2/sftp.pyx":410 * cdef bytes b_path = to_bytes(path) * cdef char *_path = b_path * with nogil: # <<<<<<<<<<<<<< @@ -4495,7 +4495,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_28setstat(struct __pyx_obj_4ssh2_4sf #endif /*try:*/ { - /* "ssh2/sftp.pyx":409 + /* "ssh2/sftp.pyx":411 * cdef char *_path = b_path * with nogil: * rc = c_sftp.libssh2_sftp_setstat( # <<<<<<<<<<<<<< @@ -4505,7 +4505,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_28setstat(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":408 + /* "ssh2/sftp.pyx":410 * cdef bytes b_path = to_bytes(path) * cdef char *_path = b_path * with nogil: # <<<<<<<<<<<<<< @@ -4524,7 +4524,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_28setstat(struct __pyx_obj_4ssh2_4sf } } - /* "ssh2/sftp.pyx":411 + /* "ssh2/sftp.pyx":413 * rc = c_sftp.libssh2_sftp_setstat( * self._sftp, _path, attrs._attrs) * return handle_error_codes(rc) # <<<<<<<<<<<<<< @@ -4532,14 +4532,14 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_28setstat(struct __pyx_obj_4ssh2_4sf * def symlink(self, path not None, target not None): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __pyx_f_4ssh2_5utils_handle_error_codes(__pyx_v_rc, 0); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 411, __pyx_L1_error) - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 411, __pyx_L1_error) + __pyx_t_3 = __pyx_f_4ssh2_5utils_handle_error_codes(__pyx_v_rc, 0); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 413, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_t_3); 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/sftp.pyx":396 + /* "ssh2/sftp.pyx":398 * return handle_error_codes(rc) if rc != 0 else attrs * * def setstat(self, path not None, SFTPAttributes attrs): # <<<<<<<<<<<<<< @@ -4559,7 +4559,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_28setstat(struct __pyx_obj_4ssh2_4sf return __pyx_r; } -/* "ssh2/sftp.pyx":413 +/* "ssh2/sftp.pyx":415 * return handle_error_codes(rc) * * def symlink(self, path not None, target not None): # <<<<<<<<<<<<<< @@ -4602,11 +4602,11 @@ static PyObject *__pyx_pw_4ssh2_4sftp_4SFTP_31symlink(PyObject *__pyx_v_self, Py case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_target)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("symlink", 1, 2, 2, 1); __PYX_ERR(0, 413, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("symlink", 1, 2, 2, 1); __PYX_ERR(0, 415, __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, 413, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "symlink") < 0)) __PYX_ERR(0, 415, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -4619,17 +4619,17 @@ static PyObject *__pyx_pw_4ssh2_4sftp_4SFTP_31symlink(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, 413, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("symlink", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 415, __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, 413, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "path"); __PYX_ERR(0, 415, __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, 413, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "target"); __PYX_ERR(0, 415, __pyx_L1_error) } __pyx_r = __pyx_pf_4ssh2_4sftp_4SFTP_30symlink(((struct __pyx_obj_4ssh2_4sftp_SFTP *)__pyx_v_self), __pyx_v_path, __pyx_v_target); @@ -4658,19 +4658,19 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_30symlink(struct __pyx_obj_4ssh2_4sf int __pyx_clineno = 0; __Pyx_RefNannySetupContext("symlink", 0); - /* "ssh2/sftp.pyx":423 + /* "ssh2/sftp.pyx":425 * :rtype: int""" * cdef int rc * cdef bytes b_path = to_bytes(path) # <<<<<<<<<<<<<< * cdef char *_path = b_path * cdef bytes b_target = to_bytes(target) */ - __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 423, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 425, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_b_path = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/sftp.pyx":424 + /* "ssh2/sftp.pyx":426 * cdef int rc * cdef bytes b_path = to_bytes(path) * cdef char *_path = b_path # <<<<<<<<<<<<<< @@ -4679,24 +4679,24 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_30symlink(struct __pyx_obj_4ssh2_4sf */ if (unlikely(__pyx_v_b_path == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 424, __pyx_L1_error) + __PYX_ERR(0, 426, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_path); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 424, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_path); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 426, __pyx_L1_error) __pyx_v__path = __pyx_t_2; - /* "ssh2/sftp.pyx":425 + /* "ssh2/sftp.pyx":427 * cdef bytes b_path = to_bytes(path) * cdef char *_path = b_path * cdef bytes b_target = to_bytes(target) # <<<<<<<<<<<<<< * cdef char *_target = b_target * with nogil: */ - __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_target); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 425, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_target); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 427, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_b_target = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/sftp.pyx":426 + /* "ssh2/sftp.pyx":428 * cdef char *_path = b_path * cdef bytes b_target = to_bytes(target) * cdef char *_target = b_target # <<<<<<<<<<<<<< @@ -4705,12 +4705,12 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_30symlink(struct __pyx_obj_4ssh2_4sf */ if (unlikely(__pyx_v_b_target == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 426, __pyx_L1_error) + __PYX_ERR(0, 428, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_target); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 426, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_target); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 428, __pyx_L1_error) __pyx_v__target = __pyx_t_2; - /* "ssh2/sftp.pyx":427 + /* "ssh2/sftp.pyx":429 * cdef bytes b_target = to_bytes(target) * cdef char *_target = b_target * with nogil: # <<<<<<<<<<<<<< @@ -4725,7 +4725,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_30symlink(struct __pyx_obj_4ssh2_4sf #endif /*try:*/ { - /* "ssh2/sftp.pyx":428 + /* "ssh2/sftp.pyx":430 * cdef char *_target = b_target * with nogil: * rc = c_sftp.libssh2_sftp_symlink(self._sftp, _path, _target) # <<<<<<<<<<<<<< @@ -4735,7 +4735,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_30symlink(struct __pyx_obj_4ssh2_4sf __pyx_v_rc = libssh2_sftp_symlink(__pyx_v_self->_sftp, __pyx_v__path, __pyx_v__target); } - /* "ssh2/sftp.pyx":427 + /* "ssh2/sftp.pyx":429 * cdef bytes b_target = to_bytes(target) * cdef char *_target = b_target * with nogil: # <<<<<<<<<<<<<< @@ -4754,7 +4754,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_30symlink(struct __pyx_obj_4ssh2_4sf } } - /* "ssh2/sftp.pyx":429 + /* "ssh2/sftp.pyx":431 * with nogil: * rc = c_sftp.libssh2_sftp_symlink(self._sftp, _path, _target) * return handle_error_codes(rc) # <<<<<<<<<<<<<< @@ -4762,14 +4762,14 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_30symlink(struct __pyx_obj_4ssh2_4sf * def realpath(self, path not None, size_t max_len=256): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __pyx_f_4ssh2_5utils_handle_error_codes(__pyx_v_rc, 0); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 429, __pyx_L1_error) - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 429, __pyx_L1_error) + __pyx_t_3 = __pyx_f_4ssh2_5utils_handle_error_codes(__pyx_v_rc, 0); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 431, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 431, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/sftp.pyx":413 + /* "ssh2/sftp.pyx":415 * return handle_error_codes(rc) * * def symlink(self, path not None, target not None): # <<<<<<<<<<<<<< @@ -4790,7 +4790,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_30symlink(struct __pyx_obj_4ssh2_4sf return __pyx_r; } -/* "ssh2/sftp.pyx":431 +/* "ssh2/sftp.pyx":433 * return handle_error_codes(rc) * * def realpath(self, path not None, size_t max_len=256): # <<<<<<<<<<<<<< @@ -4837,7 +4837,7 @@ static PyObject *__pyx_pw_4ssh2_4sftp_4SFTP_33realpath(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, 431, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "realpath") < 0)) __PYX_ERR(0, 433, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -4850,21 +4850,21 @@ static PyObject *__pyx_pw_4ssh2_4sftp_4SFTP_33realpath(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, 431, __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, 433, __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, 431, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("realpath", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 433, __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, 431, __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_4sftp_4SFTP_32realpath(((struct __pyx_obj_4ssh2_4sftp_SFTP *)__pyx_v_self), __pyx_v_path, __pyx_v_max_len); @@ -4901,7 +4901,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_32realpath(struct __pyx_obj_4ssh2_4s int __pyx_clineno = 0; __Pyx_RefNannySetupContext("realpath", 0); - /* "ssh2/sftp.pyx":443 + /* "ssh2/sftp.pyx":445 * :raises: :py:class:`ssh2.exceptions.SFTPBufferTooSmall` on max_len less * than real path length.""" * cdef char *_target = malloc(sizeof(char)*max_len) # <<<<<<<<<<<<<< @@ -4910,7 +4910,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_32realpath(struct __pyx_obj_4ssh2_4s */ __pyx_v__target = ((char *)malloc(((sizeof(char)) * __pyx_v_max_len))); - /* "ssh2/sftp.pyx":444 + /* "ssh2/sftp.pyx":446 * than real path length.""" * cdef char *_target = malloc(sizeof(char)*max_len) * if _target is NULL: # <<<<<<<<<<<<<< @@ -4920,16 +4920,16 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_32realpath(struct __pyx_obj_4ssh2_4s __pyx_t_1 = ((__pyx_v__target == NULL) != 0); if (unlikely(__pyx_t_1)) { - /* "ssh2/sftp.pyx":445 + /* "ssh2/sftp.pyx":447 * cdef char *_target = malloc(sizeof(char)*max_len) * if _target is NULL: * raise MemoryError # <<<<<<<<<<<<<< * cdef int rc * cdef bytes b_path = to_bytes(path) */ - PyErr_NoMemory(); __PYX_ERR(0, 445, __pyx_L1_error) + PyErr_NoMemory(); __PYX_ERR(0, 447, __pyx_L1_error) - /* "ssh2/sftp.pyx":444 + /* "ssh2/sftp.pyx":446 * than real path length.""" * cdef char *_target = malloc(sizeof(char)*max_len) * if _target is NULL: # <<<<<<<<<<<<<< @@ -4938,19 +4938,19 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_32realpath(struct __pyx_obj_4ssh2_4s */ } - /* "ssh2/sftp.pyx":447 + /* "ssh2/sftp.pyx":449 * raise MemoryError * cdef int rc * cdef bytes b_path = to_bytes(path) # <<<<<<<<<<<<<< * cdef char *_path = b_path * try: */ - __pyx_t_2 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 447, __pyx_L1_error) + __pyx_t_2 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 449, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_b_path = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "ssh2/sftp.pyx":448 + /* "ssh2/sftp.pyx":450 * cdef int rc * cdef bytes b_path = to_bytes(path) * cdef char *_path = b_path # <<<<<<<<<<<<<< @@ -4959,12 +4959,12 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_32realpath(struct __pyx_obj_4ssh2_4s */ if (unlikely(__pyx_v_b_path == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 448, __pyx_L1_error) + __PYX_ERR(0, 450, __pyx_L1_error) } - __pyx_t_3 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_path); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) __PYX_ERR(0, 448, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_path); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) __PYX_ERR(0, 450, __pyx_L1_error) __pyx_v__path = __pyx_t_3; - /* "ssh2/sftp.pyx":449 + /* "ssh2/sftp.pyx":451 * cdef bytes b_path = to_bytes(path) * cdef char *_path = b_path * try: # <<<<<<<<<<<<<< @@ -4973,7 +4973,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_32realpath(struct __pyx_obj_4ssh2_4s */ /*try:*/ { - /* "ssh2/sftp.pyx":450 + /* "ssh2/sftp.pyx":452 * cdef char *_path = b_path * try: * with nogil: # <<<<<<<<<<<<<< @@ -4988,7 +4988,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_32realpath(struct __pyx_obj_4ssh2_4s #endif /*try:*/ { - /* "ssh2/sftp.pyx":451 + /* "ssh2/sftp.pyx":453 * try: * with nogil: * rc = c_sftp.libssh2_sftp_realpath( # <<<<<<<<<<<<<< @@ -4997,7 +4997,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_32realpath(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":453 + /* "ssh2/sftp.pyx":455 * rc = c_sftp.libssh2_sftp_realpath( * self._sftp, _path, _target, max_len) * if rc < 0: # <<<<<<<<<<<<<< @@ -5007,7 +5007,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_32realpath(struct __pyx_obj_4ssh2_4s __pyx_t_1 = ((__pyx_v_rc < 0) != 0); if (__pyx_t_1) { - /* "ssh2/sftp.pyx":454 + /* "ssh2/sftp.pyx":456 * self._sftp, _path, _target, max_len) * if rc < 0: * with gil: # <<<<<<<<<<<<<< @@ -5020,7 +5020,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_32realpath(struct __pyx_obj_4ssh2_4s #endif /*try:*/ { - /* "ssh2/sftp.pyx":455 + /* "ssh2/sftp.pyx":457 * if rc < 0: * with gil: * return handle_error_codes(rc) # <<<<<<<<<<<<<< @@ -5028,15 +5028,15 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_32realpath(struct __pyx_obj_4ssh2_4s * finally: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = __pyx_f_4ssh2_5utils_handle_error_codes(__pyx_v_rc, 0); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 455, __pyx_L12_error) - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 455, __pyx_L12_error) + __pyx_t_4 = __pyx_f_4ssh2_5utils_handle_error_codes(__pyx_v_rc, 0); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 457, __pyx_L12_error) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 457, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L11_return; } - /* "ssh2/sftp.pyx":454 + /* "ssh2/sftp.pyx":456 * self._sftp, _path, _target, max_len) * if rc < 0: * with gil: # <<<<<<<<<<<<<< @@ -5059,7 +5059,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_32realpath(struct __pyx_obj_4ssh2_4s } } - /* "ssh2/sftp.pyx":453 + /* "ssh2/sftp.pyx":455 * rc = c_sftp.libssh2_sftp_realpath( * self._sftp, _path, _target, max_len) * if rc < 0: # <<<<<<<<<<<<<< @@ -5069,7 +5069,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_32realpath(struct __pyx_obj_4ssh2_4s } } - /* "ssh2/sftp.pyx":450 + /* "ssh2/sftp.pyx":452 * cdef char *_path = b_path * try: * with nogil: # <<<<<<<<<<<<<< @@ -5102,7 +5102,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_32realpath(struct __pyx_obj_4ssh2_4s } } - /* "ssh2/sftp.pyx":456 + /* "ssh2/sftp.pyx":458 * with gil: * return handle_error_codes(rc) * return to_str_len(_target, rc) # <<<<<<<<<<<<<< @@ -5110,14 +5110,14 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_32realpath(struct __pyx_obj_4ssh2_4s * free(_target) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __pyx_f_4ssh2_5utils_to_str_len(__pyx_v__target, __pyx_v_rc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 456, __pyx_L5_error) + __pyx_t_2 = __pyx_f_4ssh2_5utils_to_str_len(__pyx_v__target, __pyx_v_rc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 458, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L4_return; } - /* "ssh2/sftp.pyx":458 + /* "ssh2/sftp.pyx":460 * return to_str_len(_target, rc) * finally: * free(_target) # <<<<<<<<<<<<<< @@ -5167,7 +5167,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_32realpath(struct __pyx_obj_4ssh2_4s } } - /* "ssh2/sftp.pyx":431 + /* "ssh2/sftp.pyx":433 * return handle_error_codes(rc) * * def realpath(self, path not None, size_t max_len=256): # <<<<<<<<<<<<<< @@ -5187,7 +5187,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_32realpath(struct __pyx_obj_4ssh2_4s return __pyx_r; } -/* "ssh2/sftp.pyx":460 +/* "ssh2/sftp.pyx":462 * free(_target) * * def last_error(self): # <<<<<<<<<<<<<< @@ -5219,7 +5219,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_34last_error(struct __pyx_obj_4ssh2_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("last_error", 0); - /* "ssh2/sftp.pyx":465 + /* "ssh2/sftp.pyx":467 * :rtype: int""" * cdef unsigned long rc * with nogil: # <<<<<<<<<<<<<< @@ -5234,7 +5234,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_34last_error(struct __pyx_obj_4ssh2_ #endif /*try:*/ { - /* "ssh2/sftp.pyx":466 + /* "ssh2/sftp.pyx":468 * cdef unsigned long rc * with nogil: * rc = c_sftp.libssh2_sftp_last_error(self._sftp) # <<<<<<<<<<<<<< @@ -5243,7 +5243,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_34last_error(struct __pyx_obj_4ssh2_ __pyx_v_rc = libssh2_sftp_last_error(__pyx_v_self->_sftp); } - /* "ssh2/sftp.pyx":465 + /* "ssh2/sftp.pyx":467 * :rtype: int""" * cdef unsigned long rc * with nogil: # <<<<<<<<<<<<<< @@ -5262,19 +5262,19 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_34last_error(struct __pyx_obj_4ssh2_ } } - /* "ssh2/sftp.pyx":467 + /* "ssh2/sftp.pyx":469 * with nogil: * rc = c_sftp.libssh2_sftp_last_error(self._sftp) * return rc # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_unsigned_long(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 467, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_unsigned_long(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 469, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/sftp.pyx":460 + /* "ssh2/sftp.pyx":462 * free(_target) * * def last_error(self): # <<<<<<<<<<<<<< @@ -5677,7 +5677,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {0, 0, 0, 0, 0, 0, 0} }; static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(0, 445, __pyx_L1_error) + __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(0, 447, __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:; diff --git a/ssh2/sftp.pyx b/ssh2/sftp.pyx index e46cb847..364ab0da 100644 --- a/ssh2/sftp.pyx +++ b/ssh2/sftp.pyx @@ -243,6 +243,8 @@ cdef class SFTP: ``LIBSSH2_SFTP_S_IROTH`` :type mode: int + :rtype: :py:class:`ssh2.sftp.SFTPHandle` or `None` + :raises: :py:class:`ssh2.exceptions.SFTPHandleError` on errors opening file. """ # noqa: W605