diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index ac5b4174..00000000 --- a/.travis.yml +++ /dev/null @@ -1,84 +0,0 @@ -language: python -cache: - - pip - - directories: - - "$HOME/.pyenv" - - "$HOME/Library/Caches/Homebrew" - - "$HOME/.git/lfs" -notifications: - email: false -python: - - 2.7 -install: - - pip install flake8 jinja2 sphinx sphinx_rtd_theme - - python setup.py build_ext --inplace - - eval "$(ssh-agent -s)" -script: - - pytest tests - - flake8 ssh2 - # Test source distribution builds - - python setup.py sdist - - cd dist - - pip install * - - python -c 'from ssh2.session import Session; Session()' - - cd .. - - cd doc - - make html - - cd .. -sudo: required -dist: xenial -services: - - docker -addons: - apt: - packages: - - openssh-server - - rpm - - dpkg - - cmake - -jobs: - include: - - - stage: test - - # - &osx-wheels - # stage: build packages - # if: tag IS present - # os: osx - # osx_image: xcode11.6 - # env: - # - SYSTEM_LIBSSH2: 1 - # before_install: - # - brew install libssh2 - # - pip3 install twine - # - which twine - # install: skip - # script: - # - ./ci/osx-wheel.sh - # after_success: - # - if [[ ! -z "$TRAVIS_TAG" ]]; then - # twine upload --skip-existing -u $PYPI_U -p $PYPI_P wheels/*.whl; - # fi - # language: generic - # python: skip - - # - <<: *osx-wheels - # osx_image: xcode11.3 - - # - stage: build packages - # if: tag IS present - # os: linux - # python: 3.6 - # env: - # - WHEELS=1 - # install: - # - pip install twine - # script: - # - if [[ "$TRAVIS_PULL_REQUEST" == "false" ]]; then docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"; fi - # - ./ci/travis/build-manylinux.sh - # - python setup.py sdist - # after_success: - # - if [[ ! -z "$TRAVIS_TAG" ]]; then - # twine upload --skip-existing -u $PYPI_U -p $PYPI_P wheelhouse/*.whl dist/*; - # fi diff --git a/Changelog.rst b/Changelog.rst index 33c2eb4c..c9f7bade 100644 --- a/Changelog.rst +++ b/Changelog.rst @@ -8,6 +8,8 @@ Changes ------- * ``Session.forward_listen_ex`` now returns (``Listener``, ``bound_port``) tuple. +* Added new in libssh2 1.9.0 host key and hash type attributes to ``ssh2.session``. +* Added new in libssh2 1.9.0 known host key attributes to ``ssh2.knownhost``. 0.23.0 diff --git a/README.rst b/README.rst index d752736f..e3ccc84d 100644 --- a/README.rst +++ b/README.rst @@ -3,14 +3,14 @@ ssh2-python Super fast SSH2 protocol library. ``ssh2-python`` provides Python bindings for `libssh2`_. -.. image:: https://img.shields.io/badge/License-LGPL%20v2-blue.svg +.. image:: https://img.shields.io/badge/License-LGPL%20v2.1-blue.svg :target: https://pypi.python.org/pypi/ssh2-python :alt: License .. image:: https://img.shields.io/pypi/v/ssh2-python.svg :target: https://pypi.python.org/pypi/ssh2-python :alt: Latest Version -.. image:: https://travis-ci.org/ParallelSSH/ssh2-python.svg?branch=master - :target: https://travis-ci.org/ParallelSSH/ssh2-python +.. image:: https://circleci.com/gh/ParallelSSH/ssh2-python/tree/master.svg?style=svg + :target: https://circleci.com/gh/ParallelSSH/ssh2-python .. image:: https://ci.appveyor.com/api/projects/status/github/parallelssh/ssh2-python?svg=true&branch=master :target: https://ci.appveyor.com/project/pkittenis/ssh2-python .. image:: https://img.shields.io/pypi/wheel/ssh2-python.svg @@ -38,6 +38,26 @@ For from source installation instructions, including building against system pro For creating native system packages for Centos/RedHat, Ubuntu, Debian and Fedora, see `instructions in the documentation `_. +Who Should Use This +___________________ + +Developers of bespoke SSH clients. + + +Who Should Not Use This +_______________________ + +Developers looking for ready made SSH clients. + +This library is not an SSH client. + +Developers looking for high level easy to use clients based on this library should use `parallel-ssh `_. It provides both `single `_ and `parallel `_ clients. + +This library provides bindings to libssh2 and its API closely matches libssh2. + +If the examples seem long, this is not the right library. Use `parallel-ssh `_. + + API Feature Set ________________ diff --git a/ssh2/c_ssh2.pxd b/ssh2/c_ssh2.pxd index b0bcc731..97068b5c 100644 --- a/ssh2/c_ssh2.pxd +++ b/ssh2/c_ssh2.pxd @@ -42,6 +42,10 @@ cdef extern from "libssh2.h" nogil: IF EMBEDDED_LIB: enum: LIBSSH2_HOSTKEY_HASH_SHA256 + LIBSSH2_HOSTKEY_TYPE_ECDSA_256 + LIBSSH2_HOSTKEY_TYPE_ECDSA_384 + LIBSSH2_HOSTKEY_TYPE_ECDSA_521 + LIBSSH2_HOSTKEY_TYPE_ED25519 # ctypedef libssh2_uint64_t libssh2_struct_stat_size ctypedef struct libssh2_struct_stat: @@ -424,6 +428,10 @@ cdef extern from "libssh2.h" nogil: LIBSSH2_KNOWNHOST_KEY_SSHDSS IF EMBEDDED_LIB: enum: + LIBSSH2_KNOWNHOST_KEY_ECDSA_256 + LIBSSH2_KNOWNHOST_KEY_ECDSA_384 + LIBSSH2_KNOWNHOST_KEY_ECDSA_521 + LIBSSH2_KNOWNHOST_KEY_ED25519 LIBSSH2_KNOWNHOST_KEY_UNKNOWN # Public Key API diff --git a/ssh2/knownhost.c b/ssh2/knownhost.c index 51f316a1..cfeb20c1 100644 --- a/ssh2/knownhost.c +++ b/ssh2/knownhost.c @@ -1377,11 +1377,15 @@ static const char __pyx_k_LIBSSH2_KNOWNHOST_KEY_SSHDSS[] = "LIBSSH2_KNOWNHOST_KE static const char __pyx_k_LIBSSH2_KNOWNHOST_KEY_SSHRSA[] = "LIBSSH2_KNOWNHOST_KEY_SSHRSA"; static const char __pyx_k_LIBSSH2_KNOWNHOST_TYPE_PLAIN[] = "LIBSSH2_KNOWNHOST_TYPE_PLAIN"; static const char __pyx_k_LIBSSH2_KNOWNHOST_KEYENC_MASK[] = "LIBSSH2_KNOWNHOST_KEYENC_MASK"; +static const char __pyx_k_LIBSSH2_KNOWNHOST_KEY_ED25519[] = "LIBSSH2_KNOWNHOST_KEY_ED25519"; static const char __pyx_k_LIBSSH2_KNOWNHOST_KEY_UNKNOWN[] = "LIBSSH2_KNOWNHOST_KEY_UNKNOWN"; static const char __pyx_k_LIBSSH2_KNOWNHOST_TYPE_CUSTOM[] = "LIBSSH2_KNOWNHOST_TYPE_CUSTOM"; static const char __pyx_k_Error_deleting_known_host_entry[] = "Error deleting known host entry - error code %s"; static const char __pyx_k_Host_s_not_found_in_known_hosts[] = "Host %s not found in known hosts collection"; static const char __pyx_k_LIBSSH2_KNOWNHOST_KEYENC_BASE64[] = "LIBSSH2_KNOWNHOST_KEYENC_BASE64"; +static const char __pyx_k_LIBSSH2_KNOWNHOST_KEY_ECDSA_256[] = "LIBSSH2_KNOWNHOST_KEY_ECDSA_256"; +static const char __pyx_k_LIBSSH2_KNOWNHOST_KEY_ECDSA_384[] = "LIBSSH2_KNOWNHOST_KEY_ECDSA_384"; +static const char __pyx_k_LIBSSH2_KNOWNHOST_KEY_ECDSA_521[] = "LIBSSH2_KNOWNHOST_KEY_ECDSA_521"; static const char __pyx_k_Unknown_error_occurred_checking[] = "Unknown error occurred checking known host %s"; static const char __pyx_k_self__store_cannot_be_converted[] = "self._store cannot be converted to a Python object for pickling"; static const char __pyx_k_Could_not_check_known_host_entry[] = "Could not check known host entry for host %s - error code %s"; @@ -1421,6 +1425,10 @@ static PyObject *__pyx_kp_s_Known_host_key_for_host_s_does_n; static PyObject *__pyx_n_s_LIBSSH2_KNOWNHOST_KEYENC_BASE64; static PyObject *__pyx_n_s_LIBSSH2_KNOWNHOST_KEYENC_MASK; static PyObject *__pyx_n_s_LIBSSH2_KNOWNHOST_KEYENC_RAW; +static PyObject *__pyx_n_s_LIBSSH2_KNOWNHOST_KEY_ECDSA_256; +static PyObject *__pyx_n_s_LIBSSH2_KNOWNHOST_KEY_ECDSA_384; +static PyObject *__pyx_n_s_LIBSSH2_KNOWNHOST_KEY_ECDSA_521; +static PyObject *__pyx_n_s_LIBSSH2_KNOWNHOST_KEY_ED25519; static PyObject *__pyx_n_s_LIBSSH2_KNOWNHOST_KEY_MASK; static PyObject *__pyx_n_s_LIBSSH2_KNOWNHOST_KEY_RSA1; static PyObject *__pyx_n_s_LIBSSH2_KNOWNHOST_KEY_SHIFT; @@ -1503,7 +1511,7 @@ static PyObject *__pyx_tuple__8; static PyObject *__pyx_tuple__9; /* Late includes */ -/* "ssh2/knownhost.pyx":52 +/* "ssh2/knownhost.pyx":56 * * * cdef KnownHost PyKnownHost(Session session, c_ssh2.LIBSSH2_KNOWNHOSTS *_ptr): # <<<<<<<<<<<<<< @@ -1522,25 +1530,25 @@ static struct __pyx_obj_4ssh2_9knownhost_KnownHost *__pyx_f_4ssh2_9knownhost_PyK int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyKnownHost", 0); - /* "ssh2/knownhost.pyx":53 + /* "ssh2/knownhost.pyx":57 * * cdef KnownHost PyKnownHost(Session session, c_ssh2.LIBSSH2_KNOWNHOSTS *_ptr): * cdef KnownHost known_host = KnownHost.__new__(KnownHost, session) # <<<<<<<<<<<<<< * known_host._ptr = _ptr * return known_host */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 53, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __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 = ((PyObject *)__pyx_tp_new_4ssh2_9knownhost_KnownHost(((PyTypeObject *)__pyx_ptype_4ssh2_9knownhost_KnownHost), __pyx_t_1, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 53, __pyx_L1_error) + __pyx_t_2 = ((PyObject *)__pyx_tp_new_4ssh2_9knownhost_KnownHost(((PyTypeObject *)__pyx_ptype_4ssh2_9knownhost_KnownHost), __pyx_t_1, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_GOTREF(((PyObject *)__pyx_t_2)); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_known_host = ((struct __pyx_obj_4ssh2_9knownhost_KnownHost *)__pyx_t_2); __pyx_t_2 = 0; - /* "ssh2/knownhost.pyx":54 + /* "ssh2/knownhost.pyx":58 * cdef KnownHost PyKnownHost(Session session, c_ssh2.LIBSSH2_KNOWNHOSTS *_ptr): * cdef KnownHost known_host = KnownHost.__new__(KnownHost, session) * known_host._ptr = _ptr # <<<<<<<<<<<<<< @@ -1549,7 +1557,7 @@ static struct __pyx_obj_4ssh2_9knownhost_KnownHost *__pyx_f_4ssh2_9knownhost_PyK */ __pyx_v_known_host->_ptr = __pyx_v__ptr; - /* "ssh2/knownhost.pyx":55 + /* "ssh2/knownhost.pyx":59 * cdef KnownHost known_host = KnownHost.__new__(KnownHost, session) * known_host._ptr = _ptr * return known_host # <<<<<<<<<<<<<< @@ -1561,7 +1569,7 @@ static struct __pyx_obj_4ssh2_9knownhost_KnownHost *__pyx_f_4ssh2_9knownhost_PyK __pyx_r = __pyx_v_known_host; goto __pyx_L0; - /* "ssh2/knownhost.pyx":52 + /* "ssh2/knownhost.pyx":56 * * * cdef KnownHost PyKnownHost(Session session, c_ssh2.LIBSSH2_KNOWNHOSTS *_ptr): # <<<<<<<<<<<<<< @@ -1582,7 +1590,7 @@ static struct __pyx_obj_4ssh2_9knownhost_KnownHost *__pyx_f_4ssh2_9knownhost_PyK return __pyx_r; } -/* "ssh2/knownhost.pyx":58 +/* "ssh2/knownhost.pyx":62 * * * cdef KnownHostEntry PyKnownHostEntry(c_ssh2.libssh2_knownhost *_entry): # <<<<<<<<<<<<<< @@ -1600,19 +1608,19 @@ static struct __pyx_obj_4ssh2_9knownhost_KnownHostEntry *__pyx_f_4ssh2_9knownhos int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyKnownHostEntry", 0); - /* "ssh2/knownhost.pyx":59 + /* "ssh2/knownhost.pyx":63 * * cdef KnownHostEntry PyKnownHostEntry(c_ssh2.libssh2_knownhost *_entry): * cdef KnownHostEntry entry = KnownHostEntry.__new__(KnownHostEntry) # <<<<<<<<<<<<<< * entry._store = _entry * return entry */ - __pyx_t_1 = ((PyObject *)__pyx_tp_new_4ssh2_9knownhost_KnownHostEntry(((PyTypeObject *)__pyx_ptype_4ssh2_9knownhost_KnownHostEntry), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 59, __pyx_L1_error) + __pyx_t_1 = ((PyObject *)__pyx_tp_new_4ssh2_9knownhost_KnownHostEntry(((PyTypeObject *)__pyx_ptype_4ssh2_9knownhost_KnownHostEntry), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 63, __pyx_L1_error) __Pyx_GOTREF(((PyObject *)__pyx_t_1)); __pyx_v_entry = ((struct __pyx_obj_4ssh2_9knownhost_KnownHostEntry *)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/knownhost.pyx":60 + /* "ssh2/knownhost.pyx":64 * cdef KnownHostEntry PyKnownHostEntry(c_ssh2.libssh2_knownhost *_entry): * cdef KnownHostEntry entry = KnownHostEntry.__new__(KnownHostEntry) * entry._store = _entry # <<<<<<<<<<<<<< @@ -1621,7 +1629,7 @@ static struct __pyx_obj_4ssh2_9knownhost_KnownHostEntry *__pyx_f_4ssh2_9knownhos */ __pyx_v_entry->_store = __pyx_v__entry; - /* "ssh2/knownhost.pyx":61 + /* "ssh2/knownhost.pyx":65 * cdef KnownHostEntry entry = KnownHostEntry.__new__(KnownHostEntry) * entry._store = _entry * return entry # <<<<<<<<<<<<<< @@ -1633,7 +1641,7 @@ static struct __pyx_obj_4ssh2_9knownhost_KnownHostEntry *__pyx_f_4ssh2_9knownhos __pyx_r = __pyx_v_entry; goto __pyx_L0; - /* "ssh2/knownhost.pyx":58 + /* "ssh2/knownhost.pyx":62 * * * cdef KnownHostEntry PyKnownHostEntry(c_ssh2.libssh2_knownhost *_entry): # <<<<<<<<<<<<<< @@ -1653,7 +1661,7 @@ static struct __pyx_obj_4ssh2_9knownhost_KnownHostEntry *__pyx_f_4ssh2_9knownhos return __pyx_r; } -/* "ssh2/knownhost.pyx":64 +/* "ssh2/knownhost.pyx":68 * * * cdef KnownHostEntry PyNewKnownHostEntry(): # <<<<<<<<<<<<<< @@ -1673,19 +1681,19 @@ static struct __pyx_obj_4ssh2_9knownhost_KnownHostEntry *__pyx_f_4ssh2_9knownhos int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyNewKnownHostEntry", 0); - /* "ssh2/knownhost.pyx":65 + /* "ssh2/knownhost.pyx":69 * * cdef KnownHostEntry PyNewKnownHostEntry(): * cdef KnownHostEntry entry = KnownHostEntry.__new__(KnownHostEntry) # <<<<<<<<<<<<<< * cdef c_ssh2.libssh2_knownhost *_entry * with nogil: */ - __pyx_t_1 = ((PyObject *)__pyx_tp_new_4ssh2_9knownhost_KnownHostEntry(((PyTypeObject *)__pyx_ptype_4ssh2_9knownhost_KnownHostEntry), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 65, __pyx_L1_error) + __pyx_t_1 = ((PyObject *)__pyx_tp_new_4ssh2_9knownhost_KnownHostEntry(((PyTypeObject *)__pyx_ptype_4ssh2_9knownhost_KnownHostEntry), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_GOTREF(((PyObject *)__pyx_t_1)); __pyx_v_entry = ((struct __pyx_obj_4ssh2_9knownhost_KnownHostEntry *)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/knownhost.pyx":67 + /* "ssh2/knownhost.pyx":71 * cdef KnownHostEntry entry = KnownHostEntry.__new__(KnownHostEntry) * cdef c_ssh2.libssh2_knownhost *_entry * with nogil: # <<<<<<<<<<<<<< @@ -1700,7 +1708,7 @@ static struct __pyx_obj_4ssh2_9knownhost_KnownHostEntry *__pyx_f_4ssh2_9knownhos #endif /*try:*/ { - /* "ssh2/knownhost.pyx":68 + /* "ssh2/knownhost.pyx":72 * cdef c_ssh2.libssh2_knownhost *_entry * with nogil: * _entry = malloc( # <<<<<<<<<<<<<< @@ -1709,7 +1717,7 @@ static struct __pyx_obj_4ssh2_9knownhost_KnownHostEntry *__pyx_f_4ssh2_9knownhos */ __pyx_v__entry = ((struct libssh2_knownhost *)malloc((sizeof(struct libssh2_knownhost)))); - /* "ssh2/knownhost.pyx":70 + /* "ssh2/knownhost.pyx":74 * _entry = malloc( * sizeof(c_ssh2.libssh2_knownhost)) * if _entry is NULL: # <<<<<<<<<<<<<< @@ -1719,7 +1727,7 @@ static struct __pyx_obj_4ssh2_9knownhost_KnownHostEntry *__pyx_f_4ssh2_9knownhos __pyx_t_2 = ((__pyx_v__entry == NULL) != 0); if (__pyx_t_2) { - /* "ssh2/knownhost.pyx":71 + /* "ssh2/knownhost.pyx":75 * sizeof(c_ssh2.libssh2_knownhost)) * if _entry is NULL: * with gil: # <<<<<<<<<<<<<< @@ -1732,17 +1740,17 @@ static struct __pyx_obj_4ssh2_9knownhost_KnownHostEntry *__pyx_f_4ssh2_9knownhos #endif /*try:*/ { - /* "ssh2/knownhost.pyx":72 + /* "ssh2/knownhost.pyx":76 * if _entry is NULL: * with gil: * raise MemoryError # <<<<<<<<<<<<<< * _entry.magic = 0 * _entry.node = NULL */ - PyErr_NoMemory(); __PYX_ERR(0, 72, __pyx_L8_error) + PyErr_NoMemory(); __PYX_ERR(0, 76, __pyx_L8_error) } - /* "ssh2/knownhost.pyx":71 + /* "ssh2/knownhost.pyx":75 * sizeof(c_ssh2.libssh2_knownhost)) * if _entry is NULL: * with gil: # <<<<<<<<<<<<<< @@ -1759,7 +1767,7 @@ static struct __pyx_obj_4ssh2_9knownhost_KnownHostEntry *__pyx_f_4ssh2_9knownhos } } - /* "ssh2/knownhost.pyx":70 + /* "ssh2/knownhost.pyx":74 * _entry = malloc( * sizeof(c_ssh2.libssh2_knownhost)) * if _entry is NULL: # <<<<<<<<<<<<<< @@ -1768,7 +1776,7 @@ static struct __pyx_obj_4ssh2_9knownhost_KnownHostEntry *__pyx_f_4ssh2_9knownhos */ } - /* "ssh2/knownhost.pyx":73 + /* "ssh2/knownhost.pyx":77 * with gil: * raise MemoryError * _entry.magic = 0 # <<<<<<<<<<<<<< @@ -1777,7 +1785,7 @@ static struct __pyx_obj_4ssh2_9knownhost_KnownHostEntry *__pyx_f_4ssh2_9knownhos */ __pyx_v__entry->magic = 0; - /* "ssh2/knownhost.pyx":74 + /* "ssh2/knownhost.pyx":78 * raise MemoryError * _entry.magic = 0 * _entry.node = NULL # <<<<<<<<<<<<<< @@ -1786,7 +1794,7 @@ static struct __pyx_obj_4ssh2_9knownhost_KnownHostEntry *__pyx_f_4ssh2_9knownhos */ __pyx_v__entry->node = NULL; - /* "ssh2/knownhost.pyx":75 + /* "ssh2/knownhost.pyx":79 * _entry.magic = 0 * _entry.node = NULL * _entry.name = NULL # <<<<<<<<<<<<<< @@ -1795,7 +1803,7 @@ static struct __pyx_obj_4ssh2_9knownhost_KnownHostEntry *__pyx_f_4ssh2_9knownhos */ __pyx_v__entry->name = NULL; - /* "ssh2/knownhost.pyx":76 + /* "ssh2/knownhost.pyx":80 * _entry.node = NULL * _entry.name = NULL * _entry.key = NULL # <<<<<<<<<<<<<< @@ -1804,7 +1812,7 @@ static struct __pyx_obj_4ssh2_9knownhost_KnownHostEntry *__pyx_f_4ssh2_9knownhos */ __pyx_v__entry->key = NULL; - /* "ssh2/knownhost.pyx":77 + /* "ssh2/knownhost.pyx":81 * _entry.name = NULL * _entry.key = NULL * _entry.typemask = -1 # <<<<<<<<<<<<<< @@ -1813,7 +1821,7 @@ static struct __pyx_obj_4ssh2_9knownhost_KnownHostEntry *__pyx_f_4ssh2_9knownhos */ __pyx_v__entry->typemask = -1; - /* "ssh2/knownhost.pyx":78 + /* "ssh2/knownhost.pyx":82 * _entry.key = NULL * _entry.typemask = -1 * entry._store = _entry # <<<<<<<<<<<<<< @@ -1823,7 +1831,7 @@ static struct __pyx_obj_4ssh2_9knownhost_KnownHostEntry *__pyx_f_4ssh2_9knownhos __pyx_v_entry->_store = __pyx_v__entry; } - /* "ssh2/knownhost.pyx":67 + /* "ssh2/knownhost.pyx":71 * cdef KnownHostEntry entry = KnownHostEntry.__new__(KnownHostEntry) * cdef c_ssh2.libssh2_knownhost *_entry * with nogil: # <<<<<<<<<<<<<< @@ -1849,7 +1857,7 @@ static struct __pyx_obj_4ssh2_9knownhost_KnownHostEntry *__pyx_f_4ssh2_9knownhos } } - /* "ssh2/knownhost.pyx":79 + /* "ssh2/knownhost.pyx":83 * _entry.typemask = -1 * entry._store = _entry * return entry # <<<<<<<<<<<<<< @@ -1861,7 +1869,7 @@ static struct __pyx_obj_4ssh2_9knownhost_KnownHostEntry *__pyx_f_4ssh2_9knownhos __pyx_r = __pyx_v_entry; goto __pyx_L0; - /* "ssh2/knownhost.pyx":64 + /* "ssh2/knownhost.pyx":68 * * * cdef KnownHostEntry PyNewKnownHostEntry(): # <<<<<<<<<<<<<< @@ -1881,7 +1889,7 @@ static struct __pyx_obj_4ssh2_9knownhost_KnownHostEntry *__pyx_f_4ssh2_9knownhos return __pyx_r; } -/* "ssh2/knownhost.pyx":85 +/* "ssh2/knownhost.pyx":89 * """Class representing a single known host entry.""" * * def __repr__(self): # <<<<<<<<<<<<<< @@ -1912,7 +1920,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_14KnownHostEntry___repr__(struct __py int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__repr__", 0); - /* "ssh2/knownhost.pyx":86 + /* "ssh2/knownhost.pyx":90 * * def __repr__(self): * return "Known host entry for host: %s" % (self.name) # <<<<<<<<<<<<<< @@ -1920,16 +1928,16 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_14KnownHostEntry___repr__(struct __py * def __str__(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 86, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Known_host_entry_for_host_s, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Known_host_entry_for_host_s, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "ssh2/knownhost.pyx":85 + /* "ssh2/knownhost.pyx":89 * """Class representing a single known host entry.""" * * def __repr__(self): # <<<<<<<<<<<<<< @@ -1949,7 +1957,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_14KnownHostEntry___repr__(struct __py return __pyx_r; } -/* "ssh2/knownhost.pyx":88 +/* "ssh2/knownhost.pyx":92 * return "Known host entry for host: %s" % (self.name) * * def __str__(self): # <<<<<<<<<<<<<< @@ -1981,7 +1989,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_14KnownHostEntry_2__str__(struct __py int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__str__", 0); - /* "ssh2/knownhost.pyx":89 + /* "ssh2/knownhost.pyx":93 * * def __str__(self): * return self.__repr__() # <<<<<<<<<<<<<< @@ -1989,7 +1997,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_14KnownHostEntry_2__str__(struct __py * def _dealloc__(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_repr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 89, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_repr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { @@ -2003,14 +2011,14 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_14KnownHostEntry_2__str__(struct __py } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 89, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/knownhost.pyx":88 + /* "ssh2/knownhost.pyx":92 * return "Known host entry for host: %s" % (self.name) * * def __str__(self): # <<<<<<<<<<<<<< @@ -2031,7 +2039,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_14KnownHostEntry_2__str__(struct __py return __pyx_r; } -/* "ssh2/knownhost.pyx":91 +/* "ssh2/knownhost.pyx":95 * return self.__repr__() * * def _dealloc__(self): # <<<<<<<<<<<<<< @@ -2058,7 +2066,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_14KnownHostEntry_4_dealloc__(struct _ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_dealloc__", 0); - /* "ssh2/knownhost.pyx":92 + /* "ssh2/knownhost.pyx":96 * * def _dealloc__(self): * with nogil: # <<<<<<<<<<<<<< @@ -2073,7 +2081,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_14KnownHostEntry_4_dealloc__(struct _ #endif /*try:*/ { - /* "ssh2/knownhost.pyx":93 + /* "ssh2/knownhost.pyx":97 * def _dealloc__(self): * with nogil: * free(self._store) # <<<<<<<<<<<<<< @@ -2083,7 +2091,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_14KnownHostEntry_4_dealloc__(struct _ free(__pyx_v_self->_store); } - /* "ssh2/knownhost.pyx":92 + /* "ssh2/knownhost.pyx":96 * * def _dealloc__(self): * with nogil: # <<<<<<<<<<<<<< @@ -2102,7 +2110,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_14KnownHostEntry_4_dealloc__(struct _ } } - /* "ssh2/knownhost.pyx":91 + /* "ssh2/knownhost.pyx":95 * return self.__repr__() * * def _dealloc__(self): # <<<<<<<<<<<<<< @@ -2117,7 +2125,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_14KnownHostEntry_4_dealloc__(struct _ return __pyx_r; } -/* "ssh2/knownhost.pyx":96 +/* "ssh2/knownhost.pyx":100 * * @property * def magic(self): # <<<<<<<<<<<<<< @@ -2147,7 +2155,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_14KnownHostEntry_5magic___get__(struc int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "ssh2/knownhost.pyx":98 + /* "ssh2/knownhost.pyx":102 * def magic(self): * """Entry magic number.""" * return self._store.magic # <<<<<<<<<<<<<< @@ -2155,13 +2163,13 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_14KnownHostEntry_5magic___get__(struc * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(__pyx_v_self->_store->magic); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 98, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(__pyx_v_self->_store->magic); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/knownhost.pyx":96 + /* "ssh2/knownhost.pyx":100 * * @property * def magic(self): # <<<<<<<<<<<<<< @@ -2180,7 +2188,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_14KnownHostEntry_5magic___get__(struc return __pyx_r; } -/* "ssh2/knownhost.pyx":101 +/* "ssh2/knownhost.pyx":105 * * @property * def name(self): # <<<<<<<<<<<<<< @@ -2211,7 +2219,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_14KnownHostEntry_4name___get__(struct int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "ssh2/knownhost.pyx":103 + /* "ssh2/knownhost.pyx":107 * def name(self): * """Name of host.""" * return self._store.name if self._store.name is not NULL \ # <<<<<<<<<<<<<< @@ -2220,13 +2228,13 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_14KnownHostEntry_4name___get__(struct */ __Pyx_XDECREF(__pyx_r); if (((__pyx_v_self->_store->name != NULL) != 0)) { - __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_self->_store->name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 103, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_self->_store->name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __pyx_t_2; __pyx_t_2 = 0; } else { - /* "ssh2/knownhost.pyx":104 + /* "ssh2/knownhost.pyx":108 * """Name of host.""" * return self._store.name if self._store.name is not NULL \ * else None # <<<<<<<<<<<<<< @@ -2240,7 +2248,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_14KnownHostEntry_4name___get__(struct __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/knownhost.pyx":101 + /* "ssh2/knownhost.pyx":105 * * @property * def name(self): # <<<<<<<<<<<<<< @@ -2260,7 +2268,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_14KnownHostEntry_4name___get__(struct return __pyx_r; } -/* "ssh2/knownhost.pyx":107 +/* "ssh2/knownhost.pyx":111 * * @property * def key(self): # <<<<<<<<<<<<<< @@ -2294,7 +2302,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_14KnownHostEntry_3key___get__(struct int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "ssh2/knownhost.pyx":117 + /* "ssh2/knownhost.pyx":121 * base64 encoded, contrary to documentation, and ``KnownHostEntry.key`` * will need to be re-encoded as base64 to get actual key.""" * return b64decode(self._store.key) \ # <<<<<<<<<<<<<< @@ -2303,7 +2311,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_14KnownHostEntry_3key___get__(struct */ __Pyx_XDECREF(__pyx_r); - /* "ssh2/knownhost.pyx":118 + /* "ssh2/knownhost.pyx":122 * will need to be re-encoded as base64 to get actual key.""" * return b64decode(self._store.key) \ * if self._store.key is not NULL else None # <<<<<<<<<<<<<< @@ -2312,16 +2320,16 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_14KnownHostEntry_3key___get__(struct */ if (((__pyx_v_self->_store->key != NULL) != 0)) { - /* "ssh2/knownhost.pyx":117 + /* "ssh2/knownhost.pyx":121 * base64 encoded, contrary to documentation, and ``KnownHostEntry.key`` * will need to be re-encoded as base64 to get actual key.""" * return b64decode(self._store.key) \ # <<<<<<<<<<<<<< * if self._store.key is not NULL else None * */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_b64decode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 117, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_b64decode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->_store->key); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 117, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->_store->key); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { @@ -2336,14 +2344,14 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_14KnownHostEntry_3key___get__(struct __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 117, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_1 = __pyx_t_2; __pyx_t_2 = 0; } else { - /* "ssh2/knownhost.pyx":118 + /* "ssh2/knownhost.pyx":122 * will need to be re-encoded as base64 to get actual key.""" * return b64decode(self._store.key) \ * if self._store.key is not NULL else None # <<<<<<<<<<<<<< @@ -2357,7 +2365,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_14KnownHostEntry_3key___get__(struct __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/knownhost.pyx":107 + /* "ssh2/knownhost.pyx":111 * * @property * def key(self): # <<<<<<<<<<<<<< @@ -2380,7 +2388,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_14KnownHostEntry_3key___get__(struct return __pyx_r; } -/* "ssh2/knownhost.pyx":121 +/* "ssh2/knownhost.pyx":125 * * @property * def typemask(self): # <<<<<<<<<<<<<< @@ -2410,7 +2418,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_14KnownHostEntry_8typemask___get__(st int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "ssh2/knownhost.pyx":123 + /* "ssh2/knownhost.pyx":127 * def typemask(self): * """Type mask of host entry.""" * return self._store.typemask # <<<<<<<<<<<<<< @@ -2418,13 +2426,13 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_14KnownHostEntry_8typemask___get__(st * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_store->typemask); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 123, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_store->typemask); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/knownhost.pyx":121 + /* "ssh2/knownhost.pyx":125 * * @property * def typemask(self): # <<<<<<<<<<<<<< @@ -2558,7 +2566,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_14KnownHostEntry_8__setstate_cython__ return __pyx_r; } -/* "ssh2/knownhost.pyx":129 +/* "ssh2/knownhost.pyx":133 * """Manage known host entries.""" * * def __cinit__(self, Session session): # <<<<<<<<<<<<<< @@ -2595,7 +2603,7 @@ static int __pyx_pw_4ssh2_9knownhost_9KnownHost_1__cinit__(PyObject *__pyx_v_sel 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, 129, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 133, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; @@ -2606,13 +2614,13 @@ static int __pyx_pw_4ssh2_9knownhost_9KnownHost_1__cinit__(PyObject *__pyx_v_sel } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 129, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 133, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.knownhost.KnownHost.__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, 129, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_session), __pyx_ptype_4ssh2_7session_Session, 1, "session", 0))) __PYX_ERR(0, 133, __pyx_L1_error) __pyx_r = __pyx_pf_4ssh2_9knownhost_9KnownHost___cinit__(((struct __pyx_obj_4ssh2_9knownhost_KnownHost *)__pyx_v_self), __pyx_v_session); /* function exit code */ @@ -2629,7 +2637,7 @@ static int __pyx_pf_4ssh2_9knownhost_9KnownHost___cinit__(struct __pyx_obj_4ssh2 __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); - /* "ssh2/knownhost.pyx":130 + /* "ssh2/knownhost.pyx":134 * * def __cinit__(self, Session session): * self._ptr = NULL # <<<<<<<<<<<<<< @@ -2638,7 +2646,7 @@ static int __pyx_pf_4ssh2_9knownhost_9KnownHost___cinit__(struct __pyx_obj_4ssh2 */ __pyx_v_self->_ptr = NULL; - /* "ssh2/knownhost.pyx":131 + /* "ssh2/knownhost.pyx":135 * def __cinit__(self, Session session): * self._ptr = NULL * self._session = session # <<<<<<<<<<<<<< @@ -2651,7 +2659,7 @@ static int __pyx_pf_4ssh2_9knownhost_9KnownHost___cinit__(struct __pyx_obj_4ssh2 __Pyx_DECREF(((PyObject *)__pyx_v_self->_session)); __pyx_v_self->_session = __pyx_v_session; - /* "ssh2/knownhost.pyx":129 + /* "ssh2/knownhost.pyx":133 * """Manage known host entries.""" * * def __cinit__(self, Session session): # <<<<<<<<<<<<<< @@ -2665,7 +2673,7 @@ static int __pyx_pf_4ssh2_9knownhost_9KnownHost___cinit__(struct __pyx_obj_4ssh2 return __pyx_r; } -/* "ssh2/knownhost.pyx":133 +/* "ssh2/knownhost.pyx":137 * self._session = session * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -2689,7 +2697,7 @@ static void __pyx_pf_4ssh2_9knownhost_9KnownHost_2__dealloc__(struct __pyx_obj_4 int __pyx_t_1; __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "ssh2/knownhost.pyx":134 + /* "ssh2/knownhost.pyx":138 * * def __dealloc__(self): * if self._ptr is not NULL: # <<<<<<<<<<<<<< @@ -2699,7 +2707,7 @@ static void __pyx_pf_4ssh2_9knownhost_9KnownHost_2__dealloc__(struct __pyx_obj_4 __pyx_t_1 = ((__pyx_v_self->_ptr != NULL) != 0); if (__pyx_t_1) { - /* "ssh2/knownhost.pyx":135 + /* "ssh2/knownhost.pyx":139 * def __dealloc__(self): * if self._ptr is not NULL: * c_ssh2.libssh2_knownhost_free(self._ptr) # <<<<<<<<<<<<<< @@ -2708,7 +2716,7 @@ static void __pyx_pf_4ssh2_9knownhost_9KnownHost_2__dealloc__(struct __pyx_obj_4 */ libssh2_knownhost_free(__pyx_v_self->_ptr); - /* "ssh2/knownhost.pyx":136 + /* "ssh2/knownhost.pyx":140 * if self._ptr is not NULL: * c_ssh2.libssh2_knownhost_free(self._ptr) * self._ptr = NULL # <<<<<<<<<<<<<< @@ -2717,7 +2725,7 @@ static void __pyx_pf_4ssh2_9knownhost_9KnownHost_2__dealloc__(struct __pyx_obj_4 */ __pyx_v_self->_ptr = NULL; - /* "ssh2/knownhost.pyx":134 + /* "ssh2/knownhost.pyx":138 * * def __dealloc__(self): * if self._ptr is not NULL: # <<<<<<<<<<<<<< @@ -2726,7 +2734,7 @@ static void __pyx_pf_4ssh2_9knownhost_9KnownHost_2__dealloc__(struct __pyx_obj_4 */ } - /* "ssh2/knownhost.pyx":133 + /* "ssh2/knownhost.pyx":137 * self._session = session * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -2738,7 +2746,7 @@ static void __pyx_pf_4ssh2_9knownhost_9KnownHost_2__dealloc__(struct __pyx_obj_4 __Pyx_RefNannyFinishContext(); } -/* "ssh2/knownhost.pyx":138 +/* "ssh2/knownhost.pyx":142 * self._ptr = NULL * * def add(self, bytes host, bytes salt, bytes key, int typemask): # <<<<<<<<<<<<<< @@ -2787,23 +2795,23 @@ static PyObject *__pyx_pw_4ssh2_9knownhost_9KnownHost_5add(PyObject *__pyx_v_sel case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_salt)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("add", 1, 4, 4, 1); __PYX_ERR(0, 138, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("add", 1, 4, 4, 1); __PYX_ERR(0, 142, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("add", 1, 4, 4, 2); __PYX_ERR(0, 138, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("add", 1, 4, 4, 2); __PYX_ERR(0, 142, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_typemask)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("add", 1, 4, 4, 3); __PYX_ERR(0, 138, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("add", 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, "add") < 0)) __PYX_ERR(0, 138, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add") < 0)) __PYX_ERR(0, 142, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; @@ -2816,19 +2824,19 @@ static PyObject *__pyx_pw_4ssh2_9knownhost_9KnownHost_5add(PyObject *__pyx_v_sel __pyx_v_host = ((PyObject*)values[0]); __pyx_v_salt = ((PyObject*)values[1]); __pyx_v_key = ((PyObject*)values[2]); - __pyx_v_typemask = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_typemask == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 138, __pyx_L3_error) + __pyx_v_typemask = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_typemask == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 142, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("add", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 138, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("add", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 142, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.knownhost.KnownHost.add", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_host), (&PyBytes_Type), 1, "host", 1))) __PYX_ERR(0, 138, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_salt), (&PyBytes_Type), 1, "salt", 1))) __PYX_ERR(0, 138, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_key), (&PyBytes_Type), 1, "key", 1))) __PYX_ERR(0, 138, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_host), (&PyBytes_Type), 1, "host", 1))) __PYX_ERR(0, 142, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_salt), (&PyBytes_Type), 1, "salt", 1))) __PYX_ERR(0, 142, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_key), (&PyBytes_Type), 1, "key", 1))) __PYX_ERR(0, 142, __pyx_L1_error) __pyx_r = __pyx_pf_4ssh2_9knownhost_9KnownHost_4add(((struct __pyx_obj_4ssh2_9knownhost_KnownHost *)__pyx_v_self), __pyx_v_host, __pyx_v_salt, __pyx_v_key, __pyx_v_typemask); /* function exit code */ @@ -2848,7 +2856,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_4add(CYTHON_UNUSED struct int __pyx_clineno = 0; __Pyx_RefNannySetupContext("add", 0); - /* "ssh2/knownhost.pyx":140 + /* "ssh2/knownhost.pyx":144 * def add(self, bytes host, bytes salt, bytes key, int typemask): * """Deprecated - use ``self.addc``""" * raise NotImplementedError # <<<<<<<<<<<<<< @@ -2856,9 +2864,9 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_4add(CYTHON_UNUSED struct * def addc(self, bytes host not None, bytes key not None, */ __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); - __PYX_ERR(0, 140, __pyx_L1_error) + __PYX_ERR(0, 144, __pyx_L1_error) - /* "ssh2/knownhost.pyx":138 + /* "ssh2/knownhost.pyx":142 * self._ptr = NULL * * def add(self, bytes host, bytes salt, bytes key, int typemask): # <<<<<<<<<<<<<< @@ -2875,7 +2883,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_4add(CYTHON_UNUSED struct return __pyx_r; } -/* "ssh2/knownhost.pyx":142 +/* "ssh2/knownhost.pyx":146 * raise NotImplementedError * * def addc(self, bytes host not None, bytes key not None, # <<<<<<<<<<<<<< @@ -2902,7 +2910,7 @@ static PyObject *__pyx_pw_4ssh2_9knownhost_9KnownHost_7addc(PyObject *__pyx_v_se static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_host,&__pyx_n_s_key,&__pyx_n_s_typemask,&__pyx_n_s_salt,&__pyx_n_s_comment,0}; PyObject* values[5] = {0,0,0,0,0}; - /* "ssh2/knownhost.pyx":143 + /* "ssh2/knownhost.pyx":147 * * def addc(self, bytes host not None, bytes key not None, * int typemask, bytes salt=None, bytes comment=None): # <<<<<<<<<<<<<< @@ -2937,13 +2945,13 @@ static PyObject *__pyx_pw_4ssh2_9knownhost_9KnownHost_7addc(PyObject *__pyx_v_se case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("addc", 0, 3, 5, 1); __PYX_ERR(0, 142, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("addc", 0, 3, 5, 1); __PYX_ERR(0, 146, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_typemask)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("addc", 0, 3, 5, 2); __PYX_ERR(0, 142, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("addc", 0, 3, 5, 2); __PYX_ERR(0, 146, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: @@ -2959,7 +2967,7 @@ static PyObject *__pyx_pw_4ssh2_9knownhost_9KnownHost_7addc(PyObject *__pyx_v_se } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "addc") < 0)) __PYX_ERR(0, 142, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "addc") < 0)) __PYX_ERR(0, 146, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -2976,25 +2984,25 @@ static PyObject *__pyx_pw_4ssh2_9knownhost_9KnownHost_7addc(PyObject *__pyx_v_se } __pyx_v_host = ((PyObject*)values[0]); __pyx_v_key = ((PyObject*)values[1]); - __pyx_v_typemask = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_typemask == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 143, __pyx_L3_error) + __pyx_v_typemask = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_typemask == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 147, __pyx_L3_error) __pyx_v_salt = ((PyObject*)values[3]); __pyx_v_comment = ((PyObject*)values[4]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("addc", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 142, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("addc", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 146, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.knownhost.KnownHost.addc", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_host), (&PyBytes_Type), 0, "host", 1))) __PYX_ERR(0, 142, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_key), (&PyBytes_Type), 0, "key", 1))) __PYX_ERR(0, 142, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_salt), (&PyBytes_Type), 1, "salt", 1))) __PYX_ERR(0, 143, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_comment), (&PyBytes_Type), 1, "comment", 1))) __PYX_ERR(0, 143, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_host), (&PyBytes_Type), 0, "host", 1))) __PYX_ERR(0, 146, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_key), (&PyBytes_Type), 0, "key", 1))) __PYX_ERR(0, 146, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_salt), (&PyBytes_Type), 1, "salt", 1))) __PYX_ERR(0, 147, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_comment), (&PyBytes_Type), 1, "comment", 1))) __PYX_ERR(0, 147, __pyx_L1_error) __pyx_r = __pyx_pf_4ssh2_9knownhost_9KnownHost_6addc(((struct __pyx_obj_4ssh2_9knownhost_KnownHost *)__pyx_v_self), __pyx_v_host, __pyx_v_key, __pyx_v_typemask, __pyx_v_salt, __pyx_v_comment); - /* "ssh2/knownhost.pyx":142 + /* "ssh2/knownhost.pyx":146 * raise NotImplementedError * * def addc(self, bytes host not None, bytes key not None, # <<<<<<<<<<<<<< @@ -3038,27 +3046,27 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_6addc(struct __pyx_obj_4ss int __pyx_clineno = 0; __Pyx_RefNannySetupContext("addc", 0); - /* "ssh2/knownhost.pyx":171 + /* "ssh2/knownhost.pyx":175 * :raises: :py:class:`ssh2.exceptions.KnownHostAddError` on errors adding * known host entry.""" * cdef size_t keylen = len(key) # <<<<<<<<<<<<<< * cdef size_t comment_len * cdef char *_host = host */ - __pyx_t_1 = PyBytes_GET_SIZE(__pyx_v_key); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 171, __pyx_L1_error) + __pyx_t_1 = PyBytes_GET_SIZE(__pyx_v_key); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 175, __pyx_L1_error) __pyx_v_keylen = __pyx_t_1; - /* "ssh2/knownhost.pyx":173 + /* "ssh2/knownhost.pyx":177 * cdef size_t keylen = len(key) * cdef size_t comment_len * cdef char *_host = host # <<<<<<<<<<<<<< * cdef char *_salt * if salt is not None: */ - __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_host); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 173, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_host); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 177, __pyx_L1_error) __pyx_v__host = __pyx_t_2; - /* "ssh2/knownhost.pyx":175 + /* "ssh2/knownhost.pyx":179 * cdef char *_host = host * cdef char *_salt * if salt is not None: # <<<<<<<<<<<<<< @@ -3069,7 +3077,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_6addc(struct __pyx_obj_4ss __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { - /* "ssh2/knownhost.pyx":176 + /* "ssh2/knownhost.pyx":180 * cdef char *_salt * if salt is not None: * _salt = salt # <<<<<<<<<<<<<< @@ -3078,12 +3086,12 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_6addc(struct __pyx_obj_4ss */ if (unlikely(__pyx_v_salt == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 176, __pyx_L1_error) + __PYX_ERR(0, 180, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_salt); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 176, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_salt); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 180, __pyx_L1_error) __pyx_v__salt = __pyx_t_2; - /* "ssh2/knownhost.pyx":175 + /* "ssh2/knownhost.pyx":179 * cdef char *_host = host * cdef char *_salt * if salt is not None: # <<<<<<<<<<<<<< @@ -3093,7 +3101,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_6addc(struct __pyx_obj_4ss goto __pyx_L3; } - /* "ssh2/knownhost.pyx":178 + /* "ssh2/knownhost.pyx":182 * _salt = salt * else: * _salt = "" # <<<<<<<<<<<<<< @@ -3105,17 +3113,17 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_6addc(struct __pyx_obj_4ss } __pyx_L3:; - /* "ssh2/knownhost.pyx":179 + /* "ssh2/knownhost.pyx":183 * else: * _salt = "" * cdef char *_key = key # <<<<<<<<<<<<<< * cdef char *_comment * if comment is not None: */ - __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_key); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 179, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_key); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 183, __pyx_L1_error) __pyx_v__key = __pyx_t_2; - /* "ssh2/knownhost.pyx":181 + /* "ssh2/knownhost.pyx":185 * cdef char *_key = key * cdef char *_comment * if comment is not None: # <<<<<<<<<<<<<< @@ -3126,7 +3134,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_6addc(struct __pyx_obj_4ss __pyx_t_3 = (__pyx_t_4 != 0); if (__pyx_t_3) { - /* "ssh2/knownhost.pyx":182 + /* "ssh2/knownhost.pyx":186 * cdef char *_comment * if comment is not None: * _comment = comment # <<<<<<<<<<<<<< @@ -3135,12 +3143,12 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_6addc(struct __pyx_obj_4ss */ if (unlikely(__pyx_v_comment == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 182, __pyx_L1_error) + __PYX_ERR(0, 186, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_comment); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 182, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_comment); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 186, __pyx_L1_error) __pyx_v__comment = __pyx_t_2; - /* "ssh2/knownhost.pyx":181 + /* "ssh2/knownhost.pyx":185 * cdef char *_key = key * cdef char *_comment * if comment is not None: # <<<<<<<<<<<<<< @@ -3150,7 +3158,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_6addc(struct __pyx_obj_4ss goto __pyx_L4; } - /* "ssh2/knownhost.pyx":184 + /* "ssh2/knownhost.pyx":188 * _comment = comment * else: * _comment = NULL # <<<<<<<<<<<<<< @@ -3162,19 +3170,19 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_6addc(struct __pyx_obj_4ss } __pyx_L4:; - /* "ssh2/knownhost.pyx":186 + /* "ssh2/knownhost.pyx":190 * _comment = NULL * cdef int rc * cdef KnownHostEntry entry = PyNewKnownHostEntry() # <<<<<<<<<<<<<< * comment_len = len(comment) if comment is not None else 0 * with nogil: */ - __pyx_t_5 = ((PyObject *)__pyx_f_4ssh2_9knownhost_PyNewKnownHostEntry()); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 186, __pyx_L1_error) + __pyx_t_5 = ((PyObject *)__pyx_f_4ssh2_9knownhost_PyNewKnownHostEntry()); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_v_entry = ((struct __pyx_obj_4ssh2_9knownhost_KnownHostEntry *)__pyx_t_5); __pyx_t_5 = 0; - /* "ssh2/knownhost.pyx":187 + /* "ssh2/knownhost.pyx":191 * cdef int rc * cdef KnownHostEntry entry = PyNewKnownHostEntry() * comment_len = len(comment) if comment is not None else 0 # <<<<<<<<<<<<<< @@ -3185,16 +3193,16 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_6addc(struct __pyx_obj_4ss if ((__pyx_t_3 != 0)) { if (unlikely(__pyx_v_comment == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 187, __pyx_L1_error) + __PYX_ERR(0, 191, __pyx_L1_error) } - __pyx_t_1 = PyBytes_GET_SIZE(__pyx_v_comment); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 187, __pyx_L1_error) + __pyx_t_1 = PyBytes_GET_SIZE(__pyx_v_comment); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 191, __pyx_L1_error) __pyx_t_6 = __pyx_t_1; } else { __pyx_t_6 = 0; } __pyx_v_comment_len = __pyx_t_6; - /* "ssh2/knownhost.pyx":188 + /* "ssh2/knownhost.pyx":192 * cdef KnownHostEntry entry = PyNewKnownHostEntry() * comment_len = len(comment) if comment is not None else 0 * with nogil: # <<<<<<<<<<<<<< @@ -3209,7 +3217,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_6addc(struct __pyx_obj_4ss #endif /*try:*/ { - /* "ssh2/knownhost.pyx":189 + /* "ssh2/knownhost.pyx":193 * comment_len = len(comment) if comment is not None else 0 * with nogil: * rc = c_ssh2.libssh2_knownhost_addc( # <<<<<<<<<<<<<< @@ -3219,7 +3227,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_6addc(struct __pyx_obj_4ss __pyx_v_rc = libssh2_knownhost_addc(__pyx_v_self->_ptr, __pyx_v__host, __pyx_v__salt, __pyx_v__key, __pyx_v_keylen, __pyx_v__comment, __pyx_v_comment_len, __pyx_v_typemask, (&__pyx_v_entry->_store)); } - /* "ssh2/knownhost.pyx":188 + /* "ssh2/knownhost.pyx":192 * cdef KnownHostEntry entry = PyNewKnownHostEntry() * comment_len = len(comment) if comment is not None else 0 * with nogil: # <<<<<<<<<<<<<< @@ -3238,7 +3246,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_6addc(struct __pyx_obj_4ss } } - /* "ssh2/knownhost.pyx":192 + /* "ssh2/knownhost.pyx":196 * self._ptr, _host, _salt, _key, keylen, _comment, comment_len, * typemask, &entry._store) * if rc != 0: # <<<<<<<<<<<<<< @@ -3248,24 +3256,24 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_6addc(struct __pyx_obj_4ss __pyx_t_3 = ((__pyx_v_rc != 0) != 0); if (unlikely(__pyx_t_3)) { - /* "ssh2/knownhost.pyx":193 + /* "ssh2/knownhost.pyx":197 * typemask, &entry._store) * if rc != 0: * raise KnownHostAddError( # <<<<<<<<<<<<<< * "Error adding known host entry for host %s - error code %s", * host, rc) */ - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_KnownHostAddError); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 193, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_KnownHostAddError); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - /* "ssh2/knownhost.pyx":195 + /* "ssh2/knownhost.pyx":199 * raise KnownHostAddError( * "Error adding known host entry for host %s - error code %s", * host, rc) # <<<<<<<<<<<<<< * return entry * */ - __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 195, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = NULL; __pyx_t_10 = 0; @@ -3282,7 +3290,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_6addc(struct __pyx_obj_4ss #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_kp_s_Error_adding_known_host_entry_fo, __pyx_v_host, __pyx_t_8}; - __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_10, 3+__pyx_t_10); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 193, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_10, 3+__pyx_t_10); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; @@ -3291,14 +3299,14 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_6addc(struct __pyx_obj_4ss #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_kp_s_Error_adding_known_host_entry_fo, __pyx_v_host, __pyx_t_8}; - __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_10, 3+__pyx_t_10); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 193, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_10, 3+__pyx_t_10); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else #endif { - __pyx_t_11 = PyTuple_New(3+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 193, __pyx_L1_error) + __pyx_t_11 = PyTuple_New(3+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__pyx_t_9) { __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); __pyx_t_9 = NULL; @@ -3312,16 +3320,16 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_6addc(struct __pyx_obj_4ss __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_11, 2+__pyx_t_10, __pyx_t_8); __pyx_t_8 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_11, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 193, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_11, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(0, 193, __pyx_L1_error) + __PYX_ERR(0, 197, __pyx_L1_error) - /* "ssh2/knownhost.pyx":192 + /* "ssh2/knownhost.pyx":196 * self._ptr, _host, _salt, _key, keylen, _comment, comment_len, * typemask, &entry._store) * if rc != 0: # <<<<<<<<<<<<<< @@ -3330,7 +3338,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_6addc(struct __pyx_obj_4ss */ } - /* "ssh2/knownhost.pyx":196 + /* "ssh2/knownhost.pyx":200 * "Error adding known host entry for host %s - error code %s", * host, rc) * return entry # <<<<<<<<<<<<<< @@ -3342,7 +3350,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_6addc(struct __pyx_obj_4ss __pyx_r = ((PyObject *)__pyx_v_entry); goto __pyx_L0; - /* "ssh2/knownhost.pyx":142 + /* "ssh2/knownhost.pyx":146 * raise NotImplementedError * * def addc(self, bytes host not None, bytes key not None, # <<<<<<<<<<<<<< @@ -3366,7 +3374,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_6addc(struct __pyx_obj_4ss return __pyx_r; } -/* "ssh2/knownhost.pyx":198 +/* "ssh2/knownhost.pyx":202 * return entry * * def check(self, bytes host, bytes key, int typemask): # <<<<<<<<<<<<<< @@ -3412,17 +3420,17 @@ static PyObject *__pyx_pw_4ssh2_9knownhost_9KnownHost_9check(PyObject *__pyx_v_s case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("check", 1, 3, 3, 1); __PYX_ERR(0, 198, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("check", 1, 3, 3, 1); __PYX_ERR(0, 202, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_typemask)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("check", 1, 3, 3, 2); __PYX_ERR(0, 198, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("check", 1, 3, 3, 2); __PYX_ERR(0, 202, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "check") < 0)) __PYX_ERR(0, 198, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "check") < 0)) __PYX_ERR(0, 202, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -3433,18 +3441,18 @@ static PyObject *__pyx_pw_4ssh2_9knownhost_9KnownHost_9check(PyObject *__pyx_v_s } __pyx_v_host = ((PyObject*)values[0]); __pyx_v_key = ((PyObject*)values[1]); - __pyx_v_typemask = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_typemask == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 198, __pyx_L3_error) + __pyx_v_typemask = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_typemask == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 202, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("check", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 198, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("check", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 202, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.knownhost.KnownHost.check", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_host), (&PyBytes_Type), 1, "host", 1))) __PYX_ERR(0, 198, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_key), (&PyBytes_Type), 1, "key", 1))) __PYX_ERR(0, 198, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_host), (&PyBytes_Type), 1, "host", 1))) __PYX_ERR(0, 202, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_key), (&PyBytes_Type), 1, "key", 1))) __PYX_ERR(0, 202, __pyx_L1_error) __pyx_r = __pyx_pf_4ssh2_9knownhost_9KnownHost_8check(((struct __pyx_obj_4ssh2_9knownhost_KnownHost *)__pyx_v_self), __pyx_v_host, __pyx_v_key, __pyx_v_typemask); /* function exit code */ @@ -3464,7 +3472,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_8check(CYTHON_UNUSED struc int __pyx_clineno = 0; __Pyx_RefNannySetupContext("check", 0); - /* "ssh2/knownhost.pyx":200 + /* "ssh2/knownhost.pyx":204 * def check(self, bytes host, bytes key, int typemask): * """Deprecated - use ``self.checkp``""" * raise NotImplementedError # <<<<<<<<<<<<<< @@ -3472,9 +3480,9 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_8check(CYTHON_UNUSED struc * def checkp(self, bytes host not None, int port, bytes key not None, */ __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); - __PYX_ERR(0, 200, __pyx_L1_error) + __PYX_ERR(0, 204, __pyx_L1_error) - /* "ssh2/knownhost.pyx":198 + /* "ssh2/knownhost.pyx":202 * return entry * * def check(self, bytes host, bytes key, int typemask): # <<<<<<<<<<<<<< @@ -3491,7 +3499,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_8check(CYTHON_UNUSED struc return __pyx_r; } -/* "ssh2/knownhost.pyx":202 +/* "ssh2/knownhost.pyx":206 * raise NotImplementedError * * def checkp(self, bytes host not None, int port, bytes key not None, # <<<<<<<<<<<<<< @@ -3540,23 +3548,23 @@ static PyObject *__pyx_pw_4ssh2_9knownhost_9KnownHost_11checkp(PyObject *__pyx_v case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_port)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("checkp", 1, 4, 4, 1); __PYX_ERR(0, 202, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("checkp", 1, 4, 4, 1); __PYX_ERR(0, 206, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("checkp", 1, 4, 4, 2); __PYX_ERR(0, 202, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("checkp", 1, 4, 4, 2); __PYX_ERR(0, 206, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_typemask)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("checkp", 1, 4, 4, 3); __PYX_ERR(0, 202, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("checkp", 1, 4, 4, 3); __PYX_ERR(0, 206, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "checkp") < 0)) __PYX_ERR(0, 202, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "checkp") < 0)) __PYX_ERR(0, 206, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; @@ -3567,20 +3575,20 @@ static PyObject *__pyx_pw_4ssh2_9knownhost_9KnownHost_11checkp(PyObject *__pyx_v values[3] = PyTuple_GET_ITEM(__pyx_args, 3); } __pyx_v_host = ((PyObject*)values[0]); - __pyx_v_port = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_port == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 202, __pyx_L3_error) + __pyx_v_port = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_port == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 206, __pyx_L3_error) __pyx_v_key = ((PyObject*)values[2]); - __pyx_v_typemask = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_typemask == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 203, __pyx_L3_error) + __pyx_v_typemask = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_typemask == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 207, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("checkp", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 202, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("checkp", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 206, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.knownhost.KnownHost.checkp", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_host), (&PyBytes_Type), 0, "host", 1))) __PYX_ERR(0, 202, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_key), (&PyBytes_Type), 0, "key", 1))) __PYX_ERR(0, 202, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_host), (&PyBytes_Type), 0, "host", 1))) __PYX_ERR(0, 206, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_key), (&PyBytes_Type), 0, "key", 1))) __PYX_ERR(0, 206, __pyx_L1_error) __pyx_r = __pyx_pf_4ssh2_9knownhost_9KnownHost_10checkp(((struct __pyx_obj_4ssh2_9knownhost_KnownHost *)__pyx_v_self), __pyx_v_host, __pyx_v_port, __pyx_v_key, __pyx_v_typemask); /* function exit code */ @@ -3614,49 +3622,49 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_10checkp(struct __pyx_obj_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("checkp", 0); - /* "ssh2/knownhost.pyx":238 + /* "ssh2/knownhost.pyx":242 * * :rtype: :py:class:`ssh2.knownhost.KnownHostEntry`""" * cdef char *_host = host # <<<<<<<<<<<<<< * cdef char *_key = key * cdef size_t keylen = len(key) */ - __pyx_t_1 = __Pyx_PyBytes_AsWritableString(__pyx_v_host); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(0, 238, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBytes_AsWritableString(__pyx_v_host); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(0, 242, __pyx_L1_error) __pyx_v__host = __pyx_t_1; - /* "ssh2/knownhost.pyx":239 + /* "ssh2/knownhost.pyx":243 * :rtype: :py:class:`ssh2.knownhost.KnownHostEntry`""" * cdef char *_host = host * cdef char *_key = key # <<<<<<<<<<<<<< * cdef size_t keylen = len(key) * cdef KnownHostEntry entry = PyNewKnownHostEntry() */ - __pyx_t_1 = __Pyx_PyBytes_AsWritableString(__pyx_v_key); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(0, 239, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBytes_AsWritableString(__pyx_v_key); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(0, 243, __pyx_L1_error) __pyx_v__key = __pyx_t_1; - /* "ssh2/knownhost.pyx":240 + /* "ssh2/knownhost.pyx":244 * cdef char *_host = host * cdef char *_key = key * cdef size_t keylen = len(key) # <<<<<<<<<<<<<< * cdef KnownHostEntry entry = PyNewKnownHostEntry() * cdef int rc */ - __pyx_t_2 = PyBytes_GET_SIZE(__pyx_v_key); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 240, __pyx_L1_error) + __pyx_t_2 = PyBytes_GET_SIZE(__pyx_v_key); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 244, __pyx_L1_error) __pyx_v_keylen = __pyx_t_2; - /* "ssh2/knownhost.pyx":241 + /* "ssh2/knownhost.pyx":245 * cdef char *_key = key * cdef size_t keylen = len(key) * cdef KnownHostEntry entry = PyNewKnownHostEntry() # <<<<<<<<<<<<<< * cdef int rc * with nogil: */ - __pyx_t_3 = ((PyObject *)__pyx_f_4ssh2_9knownhost_PyNewKnownHostEntry()); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 241, __pyx_L1_error) + __pyx_t_3 = ((PyObject *)__pyx_f_4ssh2_9knownhost_PyNewKnownHostEntry()); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_entry = ((struct __pyx_obj_4ssh2_9knownhost_KnownHostEntry *)__pyx_t_3); __pyx_t_3 = 0; - /* "ssh2/knownhost.pyx":243 + /* "ssh2/knownhost.pyx":247 * cdef KnownHostEntry entry = PyNewKnownHostEntry() * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -3671,7 +3679,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_10checkp(struct __pyx_obj_ #endif /*try:*/ { - /* "ssh2/knownhost.pyx":244 + /* "ssh2/knownhost.pyx":248 * cdef int rc * with nogil: * rc = c_ssh2.libssh2_knownhost_checkp( # <<<<<<<<<<<<<< @@ -3681,7 +3689,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_10checkp(struct __pyx_obj_ __pyx_v_rc = libssh2_knownhost_checkp(__pyx_v_self->_ptr, __pyx_v__host, __pyx_v_port, __pyx_v__key, __pyx_v_keylen, __pyx_v_typemask, (&__pyx_v_entry->_store)); } - /* "ssh2/knownhost.pyx":243 + /* "ssh2/knownhost.pyx":247 * cdef KnownHostEntry entry = PyNewKnownHostEntry() * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -3700,7 +3708,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_10checkp(struct __pyx_obj_ } } - /* "ssh2/knownhost.pyx":246 + /* "ssh2/knownhost.pyx":250 * rc = c_ssh2.libssh2_knownhost_checkp( * self._ptr, _host, port, _key, keylen, typemask, &entry._store) * if rc != c_ssh2.LIBSSH2_KNOWNHOST_CHECK_MATCH: # <<<<<<<<<<<<<< @@ -3710,7 +3718,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_10checkp(struct __pyx_obj_ __pyx_t_4 = ((__pyx_v_rc != LIBSSH2_KNOWNHOST_CHECK_MATCH) != 0); if (__pyx_t_4) { - /* "ssh2/knownhost.pyx":247 + /* "ssh2/knownhost.pyx":251 * self._ptr, _host, port, _key, keylen, typemask, &entry._store) * if rc != c_ssh2.LIBSSH2_KNOWNHOST_CHECK_MATCH: * if rc == c_ssh2.LIBSSH2_KNOWNHOST_CHECK_FAILURE: # <<<<<<<<<<<<<< @@ -3720,24 +3728,24 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_10checkp(struct __pyx_obj_ switch (__pyx_v_rc) { case LIBSSH2_KNOWNHOST_CHECK_FAILURE: - /* "ssh2/knownhost.pyx":248 + /* "ssh2/knownhost.pyx":252 * if rc != c_ssh2.LIBSSH2_KNOWNHOST_CHECK_MATCH: * if rc == c_ssh2.LIBSSH2_KNOWNHOST_CHECK_FAILURE: * raise KnownHostCheckFailure( # <<<<<<<<<<<<<< * "Could not check known host entry for host %s " * "- error code %s", host, rc) */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_KnownHostCheckFailure); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 248, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_KnownHostCheckFailure); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - /* "ssh2/knownhost.pyx":250 + /* "ssh2/knownhost.pyx":254 * raise KnownHostCheckFailure( * "Could not check known host entry for host %s " * "- error code %s", host, rc) # <<<<<<<<<<<<<< * elif rc == c_ssh2.LIBSSH2_KNOWNHOST_CHECK_NOTFOUND: * raise KnownHostCheckNotFoundError( */ - __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 250, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_8 = 0; @@ -3754,7 +3762,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_10checkp(struct __pyx_obj_ #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_kp_s_Could_not_check_known_host_entry, __pyx_v_host, __pyx_t_6}; - __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 248, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 252, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -3763,14 +3771,14 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_10checkp(struct __pyx_obj_ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_kp_s_Could_not_check_known_host_entry, __pyx_v_host, __pyx_t_6}; - __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 248, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 252, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif { - __pyx_t_9 = PyTuple_New(3+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 248, __pyx_L1_error) + __pyx_t_9 = PyTuple_New(3+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (__pyx_t_7) { __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL; @@ -3784,16 +3792,16 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_10checkp(struct __pyx_obj_ __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_8, __pyx_t_6); __pyx_t_6 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 248, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 248, __pyx_L1_error) + __PYX_ERR(0, 252, __pyx_L1_error) - /* "ssh2/knownhost.pyx":247 + /* "ssh2/knownhost.pyx":251 * self._ptr, _host, port, _key, keylen, typemask, &entry._store) * if rc != c_ssh2.LIBSSH2_KNOWNHOST_CHECK_MATCH: * if rc == c_ssh2.LIBSSH2_KNOWNHOST_CHECK_FAILURE: # <<<<<<<<<<<<<< @@ -3803,17 +3811,17 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_10checkp(struct __pyx_obj_ break; case LIBSSH2_KNOWNHOST_CHECK_NOTFOUND: - /* "ssh2/knownhost.pyx":252 + /* "ssh2/knownhost.pyx":256 * "- error code %s", host, rc) * elif rc == c_ssh2.LIBSSH2_KNOWNHOST_CHECK_NOTFOUND: * raise KnownHostCheckNotFoundError( # <<<<<<<<<<<<<< * "Host %s not found in known hosts collection", host) * elif rc == c_ssh2.LIBSSH2_KNOWNHOST_CHECK_MISMATCH: */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_KnownHostCheckNotFoundError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 252, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_KnownHostCheckNotFoundError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - /* "ssh2/knownhost.pyx":253 + /* "ssh2/knownhost.pyx":257 * elif rc == c_ssh2.LIBSSH2_KNOWNHOST_CHECK_NOTFOUND: * raise KnownHostCheckNotFoundError( * "Host %s not found in known hosts collection", host) # <<<<<<<<<<<<<< @@ -3835,7 +3843,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_10checkp(struct __pyx_obj_ #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_kp_s_Host_s_not_found_in_known_hosts, __pyx_v_host}; - __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 252, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 256, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_3); } else @@ -3843,13 +3851,13 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_10checkp(struct __pyx_obj_ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_kp_s_Host_s_not_found_in_known_hosts, __pyx_v_host}; - __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 252, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 256, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif { - __pyx_t_6 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 252, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_9) { __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_9); __pyx_t_9 = NULL; @@ -3860,16 +3868,16 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_10checkp(struct __pyx_obj_ __Pyx_INCREF(__pyx_v_host); __Pyx_GIVEREF(__pyx_v_host); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_v_host); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 252, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 252, __pyx_L1_error) + __PYX_ERR(0, 256, __pyx_L1_error) - /* "ssh2/knownhost.pyx":251 + /* "ssh2/knownhost.pyx":255 * "Could not check known host entry for host %s " * "- error code %s", host, rc) * elif rc == c_ssh2.LIBSSH2_KNOWNHOST_CHECK_NOTFOUND: # <<<<<<<<<<<<<< @@ -3879,24 +3887,24 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_10checkp(struct __pyx_obj_ break; case LIBSSH2_KNOWNHOST_CHECK_MISMATCH: - /* "ssh2/knownhost.pyx":255 + /* "ssh2/knownhost.pyx":259 * "Host %s not found in known hosts collection", host) * elif rc == c_ssh2.LIBSSH2_KNOWNHOST_CHECK_MISMATCH: * raise KnownHostCheckMisMatchError( # <<<<<<<<<<<<<< * "Known host key for host %s does not match provided key - " * "error code %s", host, rc) */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_KnownHostCheckMisMatchError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 255, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_KnownHostCheckMisMatchError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - /* "ssh2/knownhost.pyx":257 + /* "ssh2/knownhost.pyx":261 * raise KnownHostCheckMisMatchError( * "Known host key for host %s does not match provided key - " * "error code %s", host, rc) # <<<<<<<<<<<<<< * raise KnownHostCheckError( * "Unknown error occurred checking known host %s", host) */ - __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 257, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_9 = NULL; __pyx_t_8 = 0; @@ -3913,7 +3921,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_10checkp(struct __pyx_obj_ #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_kp_s_Known_host_key_for_host_s_does_n, __pyx_v_host, __pyx_t_6}; - __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 255, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 259, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -3922,14 +3930,14 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_10checkp(struct __pyx_obj_ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_kp_s_Known_host_key_for_host_s_does_n, __pyx_v_host, __pyx_t_6}; - __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 255, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 259, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif { - __pyx_t_7 = PyTuple_New(3+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 255, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(3+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_9) { __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_9); __pyx_t_9 = NULL; @@ -3943,16 +3951,16 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_10checkp(struct __pyx_obj_ __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_t_6); __pyx_t_6 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 255, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 255, __pyx_L1_error) + __PYX_ERR(0, 259, __pyx_L1_error) - /* "ssh2/knownhost.pyx":254 + /* "ssh2/knownhost.pyx":258 * raise KnownHostCheckNotFoundError( * "Host %s not found in known hosts collection", host) * elif rc == c_ssh2.LIBSSH2_KNOWNHOST_CHECK_MISMATCH: # <<<<<<<<<<<<<< @@ -3963,17 +3971,17 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_10checkp(struct __pyx_obj_ default: break; } - /* "ssh2/knownhost.pyx":258 + /* "ssh2/knownhost.pyx":262 * "Known host key for host %s does not match provided key - " * "error code %s", host, rc) * raise KnownHostCheckError( # <<<<<<<<<<<<<< * "Unknown error occurred checking known host %s", host) * return entry */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_KnownHostCheckError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 258, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_KnownHostCheckError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 262, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - /* "ssh2/knownhost.pyx":259 + /* "ssh2/knownhost.pyx":263 * "error code %s", host, rc) * raise KnownHostCheckError( * "Unknown error occurred checking known host %s", host) # <<<<<<<<<<<<<< @@ -3995,7 +4003,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_10checkp(struct __pyx_obj_ #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_kp_s_Unknown_error_occurred_checking, __pyx_v_host}; - __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 258, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 262, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_3); } else @@ -4003,13 +4011,13 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_10checkp(struct __pyx_obj_ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_kp_s_Unknown_error_occurred_checking, __pyx_v_host}; - __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 258, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 262, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif { - __pyx_t_6 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 258, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 262, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_7) { __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); __pyx_t_7 = NULL; @@ -4020,16 +4028,16 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_10checkp(struct __pyx_obj_ __Pyx_INCREF(__pyx_v_host); __Pyx_GIVEREF(__pyx_v_host); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_v_host); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 258, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 262, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 258, __pyx_L1_error) + __PYX_ERR(0, 262, __pyx_L1_error) - /* "ssh2/knownhost.pyx":246 + /* "ssh2/knownhost.pyx":250 * rc = c_ssh2.libssh2_knownhost_checkp( * self._ptr, _host, port, _key, keylen, typemask, &entry._store) * if rc != c_ssh2.LIBSSH2_KNOWNHOST_CHECK_MATCH: # <<<<<<<<<<<<<< @@ -4038,7 +4046,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_10checkp(struct __pyx_obj_ */ } - /* "ssh2/knownhost.pyx":260 + /* "ssh2/knownhost.pyx":264 * raise KnownHostCheckError( * "Unknown error occurred checking known host %s", host) * return entry # <<<<<<<<<<<<<< @@ -4050,7 +4058,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_10checkp(struct __pyx_obj_ __pyx_r = ((PyObject *)__pyx_v_entry); goto __pyx_L0; - /* "ssh2/knownhost.pyx":202 + /* "ssh2/knownhost.pyx":206 * raise NotImplementedError * * def checkp(self, bytes host not None, int port, bytes key not None, # <<<<<<<<<<<<<< @@ -4074,7 +4082,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_10checkp(struct __pyx_obj_ return __pyx_r; } -/* "ssh2/knownhost.pyx":262 +/* "ssh2/knownhost.pyx":266 * return entry * * def delete(self, KnownHostEntry entry not None): # <<<<<<<<<<<<<< @@ -4092,7 +4100,7 @@ static PyObject *__pyx_pw_4ssh2_9knownhost_9KnownHost_13delete(PyObject *__pyx_v PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("delete (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_entry), __pyx_ptype_4ssh2_9knownhost_KnownHostEntry, 0, "entry", 0))) __PYX_ERR(0, 262, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_entry), __pyx_ptype_4ssh2_9knownhost_KnownHostEntry, 0, "entry", 0))) __PYX_ERR(0, 266, __pyx_L1_error) __pyx_r = __pyx_pf_4ssh2_9knownhost_9KnownHost_12delete(((struct __pyx_obj_4ssh2_9knownhost_KnownHost *)__pyx_v_self), ((struct __pyx_obj_4ssh2_9knownhost_KnownHostEntry *)__pyx_v_entry)); /* function exit code */ @@ -4120,7 +4128,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_12delete(struct __pyx_obj_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("delete", 0); - /* "ssh2/knownhost.pyx":271 + /* "ssh2/knownhost.pyx":275 * deleting host entry.""" * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -4135,7 +4143,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_12delete(struct __pyx_obj_ #endif /*try:*/ { - /* "ssh2/knownhost.pyx":272 + /* "ssh2/knownhost.pyx":276 * cdef int rc * with nogil: * rc = c_ssh2.libssh2_knownhost_del(self._ptr, entry._store) # <<<<<<<<<<<<<< @@ -4145,7 +4153,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_12delete(struct __pyx_obj_ __pyx_v_rc = libssh2_knownhost_del(__pyx_v_self->_ptr, __pyx_v_entry->_store); } - /* "ssh2/knownhost.pyx":271 + /* "ssh2/knownhost.pyx":275 * deleting host entry.""" * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -4164,7 +4172,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_12delete(struct __pyx_obj_ } } - /* "ssh2/knownhost.pyx":273 + /* "ssh2/knownhost.pyx":277 * with nogil: * rc = c_ssh2.libssh2_knownhost_del(self._ptr, entry._store) * if rc != 0: # <<<<<<<<<<<<<< @@ -4174,24 +4182,24 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_12delete(struct __pyx_obj_ __pyx_t_1 = ((__pyx_v_rc != 0) != 0); if (unlikely(__pyx_t_1)) { - /* "ssh2/knownhost.pyx":274 + /* "ssh2/knownhost.pyx":278 * rc = c_ssh2.libssh2_knownhost_del(self._ptr, entry._store) * if rc != 0: * raise KnownHostDeleteError( # <<<<<<<<<<<<<< * "Error deleting known host entry - error code %s", rc) * */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_KnownHostDeleteError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 274, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_KnownHostDeleteError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - /* "ssh2/knownhost.pyx":275 + /* "ssh2/knownhost.pyx":279 * if rc != 0: * raise KnownHostDeleteError( * "Error deleting known host entry - error code %s", rc) # <<<<<<<<<<<<<< * * def readline(self, bytes line not None, */ - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 275, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 279, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; @@ -4208,7 +4216,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_12delete(struct __pyx_obj_ #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_kp_s_Error_deleting_known_host_entry, __pyx_t_4}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 274, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 278, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -4217,14 +4225,14 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_12delete(struct __pyx_obj_ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_kp_s_Error_deleting_known_host_entry, __pyx_t_4}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 274, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 278, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif { - __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 274, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL; @@ -4235,16 +4243,16 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_12delete(struct __pyx_obj_ __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 274, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __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(0, 274, __pyx_L1_error) + __PYX_ERR(0, 278, __pyx_L1_error) - /* "ssh2/knownhost.pyx":273 + /* "ssh2/knownhost.pyx":277 * with nogil: * rc = c_ssh2.libssh2_knownhost_del(self._ptr, entry._store) * if rc != 0: # <<<<<<<<<<<<<< @@ -4253,7 +4261,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_12delete(struct __pyx_obj_ */ } - /* "ssh2/knownhost.pyx":262 + /* "ssh2/knownhost.pyx":266 * return entry * * def delete(self, KnownHostEntry entry not None): # <<<<<<<<<<<<<< @@ -4278,7 +4286,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_12delete(struct __pyx_obj_ return __pyx_r; } -/* "ssh2/knownhost.pyx":277 +/* "ssh2/knownhost.pyx":281 * "Error deleting known host entry - error code %s", rc) * * def readline(self, bytes line not None, # <<<<<<<<<<<<<< @@ -4325,7 +4333,7 @@ static PyObject *__pyx_pw_4ssh2_9knownhost_9KnownHost_15readline(PyObject *__pyx } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "readline") < 0)) __PYX_ERR(0, 277, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "readline") < 0)) __PYX_ERR(0, 281, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -4338,20 +4346,20 @@ static PyObject *__pyx_pw_4ssh2_9knownhost_9KnownHost_15readline(PyObject *__pyx } __pyx_v_line = ((PyObject*)values[0]); if (values[1]) { - __pyx_v_f_type = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_f_type == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 278, __pyx_L3_error) + __pyx_v_f_type = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_f_type == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 282, __pyx_L3_error) } else { __pyx_v_f_type = __pyx_k__3; } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("readline", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 277, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("readline", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 281, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.knownhost.KnownHost.readline", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_line), (&PyBytes_Type), 0, "line", 1))) __PYX_ERR(0, 277, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_line), (&PyBytes_Type), 0, "line", 1))) __PYX_ERR(0, 281, __pyx_L1_error) __pyx_r = __pyx_pf_4ssh2_9knownhost_9KnownHost_14readline(((struct __pyx_obj_4ssh2_9knownhost_KnownHost *)__pyx_v_self), __pyx_v_line, __pyx_v_f_type); /* function exit code */ @@ -4383,27 +4391,27 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_14readline(struct __pyx_ob int __pyx_clineno = 0; __Pyx_RefNannySetupContext("readline", 0); - /* "ssh2/knownhost.pyx":292 + /* "ssh2/knownhost.pyx":296 * reading line.""" * cdef int rc * cdef char *_line = line # <<<<<<<<<<<<<< * cdef size_t line_len = len(line) * with nogil: */ - __pyx_t_1 = __Pyx_PyBytes_AsWritableString(__pyx_v_line); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(0, 292, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBytes_AsWritableString(__pyx_v_line); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(0, 296, __pyx_L1_error) __pyx_v__line = __pyx_t_1; - /* "ssh2/knownhost.pyx":293 + /* "ssh2/knownhost.pyx":297 * cdef int rc * cdef char *_line = line * cdef size_t line_len = len(line) # <<<<<<<<<<<<<< * with nogil: * rc = c_ssh2.libssh2_knownhost_readline( */ - __pyx_t_2 = PyBytes_GET_SIZE(__pyx_v_line); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 293, __pyx_L1_error) + __pyx_t_2 = PyBytes_GET_SIZE(__pyx_v_line); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 297, __pyx_L1_error) __pyx_v_line_len = __pyx_t_2; - /* "ssh2/knownhost.pyx":294 + /* "ssh2/knownhost.pyx":298 * cdef char *_line = line * cdef size_t line_len = len(line) * with nogil: # <<<<<<<<<<<<<< @@ -4418,7 +4426,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_14readline(struct __pyx_ob #endif /*try:*/ { - /* "ssh2/knownhost.pyx":295 + /* "ssh2/knownhost.pyx":299 * cdef size_t line_len = len(line) * with nogil: * rc = c_ssh2.libssh2_knownhost_readline( # <<<<<<<<<<<<<< @@ -4428,7 +4436,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_14readline(struct __pyx_ob __pyx_v_rc = libssh2_knownhost_readline(__pyx_v_self->_ptr, __pyx_v__line, __pyx_v_line_len, __pyx_v_f_type); } - /* "ssh2/knownhost.pyx":294 + /* "ssh2/knownhost.pyx":298 * cdef char *_line = line * cdef size_t line_len = len(line) * with nogil: # <<<<<<<<<<<<<< @@ -4447,7 +4455,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_14readline(struct __pyx_ob } } - /* "ssh2/knownhost.pyx":297 + /* "ssh2/knownhost.pyx":301 * rc = c_ssh2.libssh2_knownhost_readline( * self._ptr, _line, line_len, f_type) * if rc != 0: # <<<<<<<<<<<<<< @@ -4457,24 +4465,24 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_14readline(struct __pyx_ob __pyx_t_3 = ((__pyx_v_rc != 0) != 0); if (unlikely(__pyx_t_3)) { - /* "ssh2/knownhost.pyx":298 + /* "ssh2/knownhost.pyx":302 * self._ptr, _line, line_len, f_type) * if rc != 0: * raise KnownHostReadLineError( # <<<<<<<<<<<<<< * "Error deleting line from known hosts - error code %s", rc) * */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_KnownHostReadLineError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 298, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_KnownHostReadLineError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 302, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - /* "ssh2/knownhost.pyx":299 + /* "ssh2/knownhost.pyx":303 * if rc != 0: * raise KnownHostReadLineError( * "Error deleting line from known hosts - error code %s", rc) # <<<<<<<<<<<<<< * * def readfile(self, filename not None, */ - __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 299, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_8 = 0; @@ -4491,7 +4499,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_14readline(struct __pyx_ob #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_kp_s_Error_deleting_line_from_known_h, __pyx_t_6}; - __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 298, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 302, __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; @@ -4500,14 +4508,14 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_14readline(struct __pyx_ob #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_kp_s_Error_deleting_line_from_known_h, __pyx_t_6}; - __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 298, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 302, __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_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 298, __pyx_L1_error) + __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 302, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (__pyx_t_7) { __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL; @@ -4518,16 +4526,16 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_14readline(struct __pyx_ob __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_6); __pyx_t_6 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 298, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 302, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __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, 298, __pyx_L1_error) + __PYX_ERR(0, 302, __pyx_L1_error) - /* "ssh2/knownhost.pyx":297 + /* "ssh2/knownhost.pyx":301 * rc = c_ssh2.libssh2_knownhost_readline( * self._ptr, _line, line_len, f_type) * if rc != 0: # <<<<<<<<<<<<<< @@ -4536,7 +4544,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_14readline(struct __pyx_ob */ } - /* "ssh2/knownhost.pyx":277 + /* "ssh2/knownhost.pyx":281 * "Error deleting known host entry - error code %s", rc) * * def readline(self, bytes line not None, # <<<<<<<<<<<<<< @@ -4561,7 +4569,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_14readline(struct __pyx_ob return __pyx_r; } -/* "ssh2/knownhost.pyx":301 +/* "ssh2/knownhost.pyx":305 * "Error deleting line from known hosts - error code %s", rc) * * def readfile(self, filename not None, # <<<<<<<<<<<<<< @@ -4608,7 +4616,7 @@ static PyObject *__pyx_pw_4ssh2_9knownhost_9KnownHost_17readfile(PyObject *__pyx } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "readfile") < 0)) __PYX_ERR(0, 301, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "readfile") < 0)) __PYX_ERR(0, 305, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -4621,21 +4629,21 @@ static PyObject *__pyx_pw_4ssh2_9knownhost_9KnownHost_17readfile(PyObject *__pyx } __pyx_v_filename = values[0]; if (values[1]) { - __pyx_v_f_type = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_f_type == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 302, __pyx_L3_error) + __pyx_v_f_type = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_f_type == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 306, __pyx_L3_error) } else { __pyx_v_f_type = __pyx_k__4; } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("readfile", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 301, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("readfile", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 305, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.knownhost.KnownHost.readfile", __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, 301, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "filename"); __PYX_ERR(0, 305, __pyx_L1_error) } __pyx_r = __pyx_pf_4ssh2_9knownhost_9KnownHost_16readfile(((struct __pyx_obj_4ssh2_9knownhost_KnownHost *)__pyx_v_self), __pyx_v_filename, __pyx_v_f_type); @@ -4667,19 +4675,19 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_16readfile(struct __pyx_ob int __pyx_clineno = 0; __Pyx_RefNannySetupContext("readfile", 0); - /* "ssh2/knownhost.pyx":315 + /* "ssh2/knownhost.pyx":319 * * :rtype: int""" * cdef bytes b_filename = to_bytes(filename) # <<<<<<<<<<<<<< * cdef char *_filename = b_filename * cdef int rc */ - __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_filename); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 315, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_filename); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 319, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_b_filename = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/knownhost.pyx":316 + /* "ssh2/knownhost.pyx":320 * :rtype: int""" * cdef bytes b_filename = to_bytes(filename) * cdef char *_filename = b_filename # <<<<<<<<<<<<<< @@ -4688,12 +4696,12 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_16readfile(struct __pyx_ob */ if (unlikely(__pyx_v_b_filename == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 316, __pyx_L1_error) + __PYX_ERR(0, 320, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_filename); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 316, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_filename); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 320, __pyx_L1_error) __pyx_v__filename = __pyx_t_2; - /* "ssh2/knownhost.pyx":318 + /* "ssh2/knownhost.pyx":322 * cdef char *_filename = b_filename * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -4708,7 +4716,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_16readfile(struct __pyx_ob #endif /*try:*/ { - /* "ssh2/knownhost.pyx":319 + /* "ssh2/knownhost.pyx":323 * cdef int rc * with nogil: * rc = c_ssh2.libssh2_knownhost_readfile( # <<<<<<<<<<<<<< @@ -4718,7 +4726,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_16readfile(struct __pyx_ob __pyx_v_rc = libssh2_knownhost_readfile(__pyx_v_self->_ptr, __pyx_v__filename, __pyx_v_f_type); } - /* "ssh2/knownhost.pyx":318 + /* "ssh2/knownhost.pyx":322 * cdef char *_filename = b_filename * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -4737,7 +4745,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_16readfile(struct __pyx_ob } } - /* "ssh2/knownhost.pyx":321 + /* "ssh2/knownhost.pyx":325 * rc = c_ssh2.libssh2_knownhost_readfile( * self._ptr, _filename, f_type) * if rc < 0: # <<<<<<<<<<<<<< @@ -4747,24 +4755,24 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_16readfile(struct __pyx_ob __pyx_t_3 = ((__pyx_v_rc < 0) != 0); if (unlikely(__pyx_t_3)) { - /* "ssh2/knownhost.pyx":322 + /* "ssh2/knownhost.pyx":326 * self._ptr, _filename, f_type) * if rc < 0: * raise KnownHostReadFileError( # <<<<<<<<<<<<<< * "Error reading known hosts file %s - error code %s", * filename, rc) */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_KnownHostReadFileError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 322, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_KnownHostReadFileError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 326, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - /* "ssh2/knownhost.pyx":324 + /* "ssh2/knownhost.pyx":328 * raise KnownHostReadFileError( * "Error reading known hosts file %s - error code %s", * filename, rc) # <<<<<<<<<<<<<< * return rc * */ - __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 324, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 328, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; __pyx_t_7 = 0; @@ -4781,7 +4789,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_16readfile(struct __pyx_ob #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[4] = {__pyx_t_6, __pyx_kp_s_Error_reading_known_hosts_file_s, __pyx_v_filename, __pyx_t_5}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 322, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 326, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -4790,14 +4798,14 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_16readfile(struct __pyx_ob #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[4] = {__pyx_t_6, __pyx_kp_s_Error_reading_known_hosts_file_s, __pyx_v_filename, __pyx_t_5}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 322, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 326, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif { - __pyx_t_8 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 322, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 326, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (__pyx_t_6) { __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL; @@ -4811,16 +4819,16 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_16readfile(struct __pyx_ob __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_7, __pyx_t_5); __pyx_t_5 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 322, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 326, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __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, 322, __pyx_L1_error) + __PYX_ERR(0, 326, __pyx_L1_error) - /* "ssh2/knownhost.pyx":321 + /* "ssh2/knownhost.pyx":325 * rc = c_ssh2.libssh2_knownhost_readfile( * self._ptr, _filename, f_type) * if rc < 0: # <<<<<<<<<<<<<< @@ -4829,7 +4837,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_16readfile(struct __pyx_ob */ } - /* "ssh2/knownhost.pyx":325 + /* "ssh2/knownhost.pyx":329 * "Error reading known hosts file %s - error code %s", * filename, rc) * return rc # <<<<<<<<<<<<<< @@ -4837,13 +4845,13 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_16readfile(struct __pyx_ob * def writeline(self, KnownHostEntry entry, */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 325, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 329, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/knownhost.pyx":301 + /* "ssh2/knownhost.pyx":305 * "Error deleting line from known hosts - error code %s", rc) * * def readfile(self, filename not None, # <<<<<<<<<<<<<< @@ -4867,7 +4875,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_16readfile(struct __pyx_ob return __pyx_r; } -/* "ssh2/knownhost.pyx":327 +/* "ssh2/knownhost.pyx":331 * return rc * * def writeline(self, KnownHostEntry entry, # <<<<<<<<<<<<<< @@ -4923,7 +4931,7 @@ static PyObject *__pyx_pw_4ssh2_9knownhost_9KnownHost_19writeline(PyObject *__py } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "writeline") < 0)) __PYX_ERR(0, 327, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "writeline") < 0)) __PYX_ERR(0, 331, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -4938,25 +4946,25 @@ static PyObject *__pyx_pw_4ssh2_9knownhost_9KnownHost_19writeline(PyObject *__py } __pyx_v_entry = ((struct __pyx_obj_4ssh2_9knownhost_KnownHostEntry *)values[0]); if (values[1]) { - __pyx_v_f_type = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_f_type == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 328, __pyx_L3_error) + __pyx_v_f_type = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_f_type == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 332, __pyx_L3_error) } else { __pyx_v_f_type = __pyx_k__5; } if (values[2]) { - __pyx_v_buf_len = __Pyx_PyInt_As_size_t(values[2]); if (unlikely((__pyx_v_buf_len == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 329, __pyx_L3_error) + __pyx_v_buf_len = __Pyx_PyInt_As_size_t(values[2]); if (unlikely((__pyx_v_buf_len == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 333, __pyx_L3_error) } else { __pyx_v_buf_len = ((size_t)0x400); } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("writeline", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 327, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("writeline", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 331, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.knownhost.KnownHost.writeline", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_entry), __pyx_ptype_4ssh2_9knownhost_KnownHostEntry, 1, "entry", 0))) __PYX_ERR(0, 327, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_entry), __pyx_ptype_4ssh2_9knownhost_KnownHostEntry, 1, "entry", 0))) __PYX_ERR(0, 331, __pyx_L1_error) __pyx_r = __pyx_pf_4ssh2_9knownhost_9KnownHost_18writeline(((struct __pyx_obj_4ssh2_9knownhost_KnownHost *)__pyx_v_self), __pyx_v_entry, __pyx_v_f_type, __pyx_v_buf_len); /* function exit code */ @@ -4995,7 +5003,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_18writeline(struct __pyx_o int __pyx_clineno = 0; __Pyx_RefNannySetupContext("writeline", 0); - /* "ssh2/knownhost.pyx":341 + /* "ssh2/knownhost.pyx":345 * * :rtype: bytes""" * cdef bytes output = b"" # <<<<<<<<<<<<<< @@ -5005,7 +5013,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_18writeline(struct __pyx_o __Pyx_INCREF(__pyx_kp_b__6); __pyx_v_output = __pyx_kp_b__6; - /* "ssh2/knownhost.pyx":342 + /* "ssh2/knownhost.pyx":346 * :rtype: bytes""" * cdef bytes output = b"" * cdef size_t outlen = 0 # <<<<<<<<<<<<<< @@ -5014,7 +5022,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_18writeline(struct __pyx_o */ __pyx_v_outlen = 0; - /* "ssh2/knownhost.pyx":345 + /* "ssh2/knownhost.pyx":349 * cdef char *buf * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -5029,7 +5037,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_18writeline(struct __pyx_o #endif /*try:*/ { - /* "ssh2/knownhost.pyx":346 + /* "ssh2/knownhost.pyx":350 * cdef int rc * with nogil: * buf = malloc(sizeof(char)*buf_len) # <<<<<<<<<<<<<< @@ -5038,7 +5046,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_18writeline(struct __pyx_o */ __pyx_v_buf = ((char *)malloc(((sizeof(char)) * __pyx_v_buf_len))); - /* "ssh2/knownhost.pyx":347 + /* "ssh2/knownhost.pyx":351 * with nogil: * buf = malloc(sizeof(char)*buf_len) * if buf is NULL: # <<<<<<<<<<<<<< @@ -5048,7 +5056,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_18writeline(struct __pyx_o __pyx_t_1 = ((__pyx_v_buf == NULL) != 0); if (__pyx_t_1) { - /* "ssh2/knownhost.pyx":348 + /* "ssh2/knownhost.pyx":352 * buf = malloc(sizeof(char)*buf_len) * if buf is NULL: * with gil: # <<<<<<<<<<<<<< @@ -5061,17 +5069,17 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_18writeline(struct __pyx_o #endif /*try:*/ { - /* "ssh2/knownhost.pyx":349 + /* "ssh2/knownhost.pyx":353 * if buf is NULL: * with gil: * raise MemoryError # <<<<<<<<<<<<<< * rc = c_ssh2.libssh2_knownhost_writeline( * self._ptr, entry._store, buf, buf_len, &outlen, f_type) */ - PyErr_NoMemory(); __PYX_ERR(0, 349, __pyx_L8_error) + PyErr_NoMemory(); __PYX_ERR(0, 353, __pyx_L8_error) } - /* "ssh2/knownhost.pyx":348 + /* "ssh2/knownhost.pyx":352 * buf = malloc(sizeof(char)*buf_len) * if buf is NULL: * with gil: # <<<<<<<<<<<<<< @@ -5088,7 +5096,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_18writeline(struct __pyx_o } } - /* "ssh2/knownhost.pyx":347 + /* "ssh2/knownhost.pyx":351 * with nogil: * buf = malloc(sizeof(char)*buf_len) * if buf is NULL: # <<<<<<<<<<<<<< @@ -5097,7 +5105,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_18writeline(struct __pyx_o */ } - /* "ssh2/knownhost.pyx":350 + /* "ssh2/knownhost.pyx":354 * with gil: * raise MemoryError * rc = c_ssh2.libssh2_knownhost_writeline( # <<<<<<<<<<<<<< @@ -5107,7 +5115,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_18writeline(struct __pyx_o __pyx_v_rc = libssh2_knownhost_writeline(__pyx_v_self->_ptr, __pyx_v_entry->_store, __pyx_v_buf, __pyx_v_buf_len, (&__pyx_v_outlen), __pyx_v_f_type); } - /* "ssh2/knownhost.pyx":345 + /* "ssh2/knownhost.pyx":349 * cdef char *buf * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -5133,7 +5141,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_18writeline(struct __pyx_o } } - /* "ssh2/knownhost.pyx":352 + /* "ssh2/knownhost.pyx":356 * rc = c_ssh2.libssh2_knownhost_writeline( * self._ptr, entry._store, buf, buf_len, &outlen, f_type) * try: # <<<<<<<<<<<<<< @@ -5142,7 +5150,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_18writeline(struct __pyx_o */ /*try:*/ { - /* "ssh2/knownhost.pyx":353 + /* "ssh2/knownhost.pyx":357 * self._ptr, entry._store, buf, buf_len, &outlen, f_type) * try: * if rc == _LIBSSH2_ERROR_BUFFER_TOO_SMALL: # <<<<<<<<<<<<<< @@ -5152,7 +5160,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_18writeline(struct __pyx_o __pyx_t_1 = ((__pyx_v_rc == LIBSSH2_ERROR_BUFFER_TOO_SMALL) != 0); if (__pyx_t_1) { - /* "ssh2/knownhost.pyx":354 + /* "ssh2/knownhost.pyx":358 * try: * if rc == _LIBSSH2_ERROR_BUFFER_TOO_SMALL: * return self.writeline(entry, buf_len=buf_len*2) # <<<<<<<<<<<<<< @@ -5160,20 +5168,20 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_18writeline(struct __pyx_o * raise KnownHostWriteLineError( */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_writeline); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 354, __pyx_L11_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_writeline); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 358, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 354, __pyx_L11_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 358, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_v_entry)); __Pyx_GIVEREF(((PyObject *)__pyx_v_entry)); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_entry)); - __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 354, __pyx_L11_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 358, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyInt_FromSize_t((__pyx_v_buf_len * 2)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 354, __pyx_L11_error) + __pyx_t_5 = __Pyx_PyInt_FromSize_t((__pyx_v_buf_len * 2)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 358, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_buf_len, __pyx_t_5) < 0) __PYX_ERR(0, 354, __pyx_L11_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_buf_len, __pyx_t_5) < 0) __PYX_ERR(0, 358, __pyx_L11_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 354, __pyx_L11_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 358, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -5182,7 +5190,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_18writeline(struct __pyx_o __pyx_t_5 = 0; goto __pyx_L10_return; - /* "ssh2/knownhost.pyx":353 + /* "ssh2/knownhost.pyx":357 * self._ptr, entry._store, buf, buf_len, &outlen, f_type) * try: * if rc == _LIBSSH2_ERROR_BUFFER_TOO_SMALL: # <<<<<<<<<<<<<< @@ -5191,7 +5199,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_18writeline(struct __pyx_o */ } - /* "ssh2/knownhost.pyx":355 + /* "ssh2/knownhost.pyx":359 * if rc == _LIBSSH2_ERROR_BUFFER_TOO_SMALL: * return self.writeline(entry, buf_len=buf_len*2) * elif rc != 0: # <<<<<<<<<<<<<< @@ -5201,24 +5209,24 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_18writeline(struct __pyx_o __pyx_t_1 = ((__pyx_v_rc != 0) != 0); if (unlikely(__pyx_t_1)) { - /* "ssh2/knownhost.pyx":356 + /* "ssh2/knownhost.pyx":360 * return self.writeline(entry, buf_len=buf_len*2) * elif rc != 0: * raise KnownHostWriteLineError( # <<<<<<<<<<<<<< * "Error writing line for known host entry - error code %s", * rc) */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_KnownHostWriteLineError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 356, __pyx_L11_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_KnownHostWriteLineError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 360, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_4); - /* "ssh2/knownhost.pyx":358 + /* "ssh2/knownhost.pyx":362 * raise KnownHostWriteLineError( * "Error writing line for known host entry - error code %s", * rc) # <<<<<<<<<<<<<< * if outlen > 0: * output = buf[:outlen] */ - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 358, __pyx_L11_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 362, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = NULL; __pyx_t_6 = 0; @@ -5235,7 +5243,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_18writeline(struct __pyx_o #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_kp_s_Error_writing_line_for_known_hos, __pyx_t_3}; - __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 356, __pyx_L11_error) + __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 360, __pyx_L11_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -5244,14 +5252,14 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_18writeline(struct __pyx_o #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_kp_s_Error_writing_line_for_known_hos, __pyx_t_3}; - __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 356, __pyx_L11_error) + __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 360, __pyx_L11_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif { - __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 356, __pyx_L11_error) + __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 360, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_2) { __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2); __pyx_t_2 = NULL; @@ -5262,16 +5270,16 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_18writeline(struct __pyx_o __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 356, __pyx_L11_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 360, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(0, 356, __pyx_L11_error) + __PYX_ERR(0, 360, __pyx_L11_error) - /* "ssh2/knownhost.pyx":355 + /* "ssh2/knownhost.pyx":359 * if rc == _LIBSSH2_ERROR_BUFFER_TOO_SMALL: * return self.writeline(entry, buf_len=buf_len*2) * elif rc != 0: # <<<<<<<<<<<<<< @@ -5280,7 +5288,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_18writeline(struct __pyx_o */ } - /* "ssh2/knownhost.pyx":359 + /* "ssh2/knownhost.pyx":363 * "Error writing line for known host entry - error code %s", * rc) * if outlen > 0: # <<<<<<<<<<<<<< @@ -5290,19 +5298,19 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_18writeline(struct __pyx_o __pyx_t_1 = ((__pyx_v_outlen > 0) != 0); if (__pyx_t_1) { - /* "ssh2/knownhost.pyx":360 + /* "ssh2/knownhost.pyx":364 * rc) * if outlen > 0: * output = buf[:outlen] # <<<<<<<<<<<<<< * finally: * free(buf) */ - __pyx_t_5 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_buf + 0, __pyx_v_outlen - 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 360, __pyx_L11_error) + __pyx_t_5 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_buf + 0, __pyx_v_outlen - 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 364, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF_SET(__pyx_v_output, ((PyObject*)__pyx_t_5)); __pyx_t_5 = 0; - /* "ssh2/knownhost.pyx":359 + /* "ssh2/knownhost.pyx":363 * "Error writing line for known host entry - error code %s", * rc) * if outlen > 0: # <<<<<<<<<<<<<< @@ -5312,7 +5320,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_18writeline(struct __pyx_o } } - /* "ssh2/knownhost.pyx":362 + /* "ssh2/knownhost.pyx":366 * output = buf[:outlen] * finally: * free(buf) # <<<<<<<<<<<<<< @@ -5371,7 +5379,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_18writeline(struct __pyx_o __pyx_L12:; } - /* "ssh2/knownhost.pyx":363 + /* "ssh2/knownhost.pyx":367 * finally: * free(buf) * return output # <<<<<<<<<<<<<< @@ -5383,7 +5391,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_18writeline(struct __pyx_o __pyx_r = __pyx_v_output; goto __pyx_L0; - /* "ssh2/knownhost.pyx":327 + /* "ssh2/knownhost.pyx":331 * return rc * * def writeline(self, KnownHostEntry entry, # <<<<<<<<<<<<<< @@ -5407,7 +5415,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_18writeline(struct __pyx_o return __pyx_r; } -/* "ssh2/knownhost.pyx":365 +/* "ssh2/knownhost.pyx":369 * return output * * def writefile(self, filename not None, # <<<<<<<<<<<<<< @@ -5454,7 +5462,7 @@ static PyObject *__pyx_pw_4ssh2_9knownhost_9KnownHost_21writefile(PyObject *__py } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "writefile") < 0)) __PYX_ERR(0, 365, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "writefile") < 0)) __PYX_ERR(0, 369, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -5467,21 +5475,21 @@ static PyObject *__pyx_pw_4ssh2_9knownhost_9KnownHost_21writefile(PyObject *__py } __pyx_v_filename = values[0]; if (values[1]) { - __pyx_v_f_type = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_f_type == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 366, __pyx_L3_error) + __pyx_v_f_type = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_f_type == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 370, __pyx_L3_error) } else { __pyx_v_f_type = __pyx_k__7; } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("writefile", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 365, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("writefile", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 369, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.knownhost.KnownHost.writefile", __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, 365, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "filename"); __PYX_ERR(0, 369, __pyx_L1_error) } __pyx_r = __pyx_pf_4ssh2_9knownhost_9KnownHost_20writefile(((struct __pyx_obj_4ssh2_9knownhost_KnownHost *)__pyx_v_self), __pyx_v_filename, __pyx_v_f_type); @@ -5512,19 +5520,19 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_20writefile(struct __pyx_o int __pyx_clineno = 0; __Pyx_RefNannySetupContext("writefile", 0); - /* "ssh2/knownhost.pyx":375 + /* "ssh2/knownhost.pyx":379 * :raises: :py:class:`ssh2.exceptions.KnownHostWriteFileError` on errors * writing to file.""" * cdef bytes b_filename = to_bytes(filename) # <<<<<<<<<<<<<< * cdef char *_filename = b_filename * cdef int rc */ - __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_filename); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 375, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_filename); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_b_filename = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/knownhost.pyx":376 + /* "ssh2/knownhost.pyx":380 * writing to file.""" * cdef bytes b_filename = to_bytes(filename) * cdef char *_filename = b_filename # <<<<<<<<<<<<<< @@ -5533,12 +5541,12 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_20writefile(struct __pyx_o */ if (unlikely(__pyx_v_b_filename == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 376, __pyx_L1_error) + __PYX_ERR(0, 380, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_filename); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 376, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_filename); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 380, __pyx_L1_error) __pyx_v__filename = __pyx_t_2; - /* "ssh2/knownhost.pyx":378 + /* "ssh2/knownhost.pyx":382 * cdef char *_filename = b_filename * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -5553,7 +5561,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_20writefile(struct __pyx_o #endif /*try:*/ { - /* "ssh2/knownhost.pyx":379 + /* "ssh2/knownhost.pyx":383 * cdef int rc * with nogil: * rc = c_ssh2.libssh2_knownhost_writefile( # <<<<<<<<<<<<<< @@ -5563,7 +5571,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_20writefile(struct __pyx_o __pyx_v_rc = libssh2_knownhost_writefile(__pyx_v_self->_ptr, __pyx_v__filename, __pyx_v_f_type); } - /* "ssh2/knownhost.pyx":378 + /* "ssh2/knownhost.pyx":382 * cdef char *_filename = b_filename * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -5582,7 +5590,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_20writefile(struct __pyx_o } } - /* "ssh2/knownhost.pyx":381 + /* "ssh2/knownhost.pyx":385 * rc = c_ssh2.libssh2_knownhost_writefile( * self._ptr, _filename, f_type) * if rc != 0: # <<<<<<<<<<<<<< @@ -5592,17 +5600,17 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_20writefile(struct __pyx_o __pyx_t_3 = ((__pyx_v_rc != 0) != 0); if (unlikely(__pyx_t_3)) { - /* "ssh2/knownhost.pyx":382 + /* "ssh2/knownhost.pyx":386 * self._ptr, _filename, f_type) * if rc != 0: * raise KnownHostWriteFileError( # <<<<<<<<<<<<<< * "Error writing known hosts to file %s", filename) * */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_KnownHostWriteFileError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 382, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_KnownHostWriteFileError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 386, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - /* "ssh2/knownhost.pyx":383 + /* "ssh2/knownhost.pyx":387 * if rc != 0: * raise KnownHostWriteFileError( * "Error writing known hosts to file %s", filename) # <<<<<<<<<<<<<< @@ -5624,7 +5632,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_20writefile(struct __pyx_o #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_kp_s_Error_writing_known_hosts_to_fil, __pyx_v_filename}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 382, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 386, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_1); } else @@ -5632,13 +5640,13 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_20writefile(struct __pyx_o #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_kp_s_Error_writing_known_hosts_to_fil, __pyx_v_filename}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 382, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 386, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { - __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 382, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 386, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL; @@ -5649,16 +5657,16 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_20writefile(struct __pyx_o __Pyx_INCREF(__pyx_v_filename); __Pyx_GIVEREF(__pyx_v_filename); PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_filename); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 382, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 386, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __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, 382, __pyx_L1_error) + __PYX_ERR(0, 386, __pyx_L1_error) - /* "ssh2/knownhost.pyx":381 + /* "ssh2/knownhost.pyx":385 * rc = c_ssh2.libssh2_knownhost_writefile( * self._ptr, _filename, f_type) * if rc != 0: # <<<<<<<<<<<<<< @@ -5667,7 +5675,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_20writefile(struct __pyx_o */ } - /* "ssh2/knownhost.pyx":365 + /* "ssh2/knownhost.pyx":369 * return output * * def writefile(self, filename not None, # <<<<<<<<<<<<<< @@ -5692,7 +5700,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_20writefile(struct __pyx_o return __pyx_r; } -/* "ssh2/knownhost.pyx":385 +/* "ssh2/knownhost.pyx":389 * "Error writing known hosts to file %s", filename) * * def get(self, KnownHostEntry prev=None): # <<<<<<<<<<<<<< @@ -5733,7 +5741,7 @@ static PyObject *__pyx_pw_4ssh2_9knownhost_9KnownHost_23get(PyObject *__pyx_v_se } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get") < 0)) __PYX_ERR(0, 385, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get") < 0)) __PYX_ERR(0, 389, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -5747,13 +5755,13 @@ static PyObject *__pyx_pw_4ssh2_9knownhost_9KnownHost_23get(PyObject *__pyx_v_se } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("get", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 385, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("get", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 389, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.knownhost.KnownHost.get", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_prev), __pyx_ptype_4ssh2_9knownhost_KnownHostEntry, 1, "prev", 0))) __PYX_ERR(0, 385, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_prev), __pyx_ptype_4ssh2_9knownhost_KnownHostEntry, 1, "prev", 0))) __PYX_ERR(0, 389, __pyx_L1_error) __pyx_r = __pyx_pf_4ssh2_9knownhost_9KnownHost_22get(((struct __pyx_obj_4ssh2_9knownhost_KnownHost *)__pyx_v_self), __pyx_v_prev); /* function exit code */ @@ -5787,7 +5795,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_22get(struct __pyx_obj_4ss int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get", 0); - /* "ssh2/knownhost.pyx":396 + /* "ssh2/knownhost.pyx":400 * * :rtype: list(:py:class:`ssh2.knownhost.KnownHostEntry`)""" * cdef c_ssh2.libssh2_knownhost *_store = NULL # <<<<<<<<<<<<<< @@ -5796,7 +5804,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_22get(struct __pyx_obj_4ss */ __pyx_v__store = NULL; - /* "ssh2/knownhost.pyx":397 + /* "ssh2/knownhost.pyx":401 * :rtype: list(:py:class:`ssh2.knownhost.KnownHostEntry`)""" * cdef c_ssh2.libssh2_knownhost *_store = NULL * cdef c_ssh2.libssh2_knownhost *_prev = NULL # <<<<<<<<<<<<<< @@ -5805,19 +5813,19 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_22get(struct __pyx_obj_4ss */ __pyx_v__prev = NULL; - /* "ssh2/knownhost.pyx":399 + /* "ssh2/knownhost.pyx":403 * cdef c_ssh2.libssh2_knownhost *_prev = NULL * cdef int rc * cdef list entries = [] # <<<<<<<<<<<<<< * if prev is not None: * _prev = prev._store */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 399, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 403, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_entries = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/knownhost.pyx":400 + /* "ssh2/knownhost.pyx":404 * cdef int rc * cdef list entries = [] * if prev is not None: # <<<<<<<<<<<<<< @@ -5828,7 +5836,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_22get(struct __pyx_obj_4ss __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { - /* "ssh2/knownhost.pyx":401 + /* "ssh2/knownhost.pyx":405 * cdef list entries = [] * if prev is not None: * _prev = prev._store # <<<<<<<<<<<<<< @@ -5838,7 +5846,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_22get(struct __pyx_obj_4ss __pyx_t_4 = __pyx_v_prev->_store; __pyx_v__prev = __pyx_t_4; - /* "ssh2/knownhost.pyx":400 + /* "ssh2/knownhost.pyx":404 * cdef int rc * cdef list entries = [] * if prev is not None: # <<<<<<<<<<<<<< @@ -5847,7 +5855,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_22get(struct __pyx_obj_4ss */ } - /* "ssh2/knownhost.pyx":402 + /* "ssh2/knownhost.pyx":406 * if prev is not None: * _prev = prev._store * with nogil: # <<<<<<<<<<<<<< @@ -5862,7 +5870,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_22get(struct __pyx_obj_4ss #endif /*try:*/ { - /* "ssh2/knownhost.pyx":403 + /* "ssh2/knownhost.pyx":407 * _prev = prev._store * with nogil: * rc = c_ssh2.libssh2_knownhost_get( # <<<<<<<<<<<<<< @@ -5872,7 +5880,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_22get(struct __pyx_obj_4ss __pyx_v_rc = libssh2_knownhost_get(__pyx_v_self->_ptr, (&__pyx_v__store), __pyx_v__prev); } - /* "ssh2/knownhost.pyx":402 + /* "ssh2/knownhost.pyx":406 * if prev is not None: * _prev = prev._store * with nogil: # <<<<<<<<<<<<<< @@ -5891,7 +5899,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_22get(struct __pyx_obj_4ss } } - /* "ssh2/knownhost.pyx":405 + /* "ssh2/knownhost.pyx":409 * rc = c_ssh2.libssh2_knownhost_get( * self._ptr, &_store, _prev) * while rc == 0: # <<<<<<<<<<<<<< @@ -5902,19 +5910,19 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_22get(struct __pyx_obj_4ss __pyx_t_3 = ((__pyx_v_rc == 0) != 0); if (!__pyx_t_3) break; - /* "ssh2/knownhost.pyx":406 + /* "ssh2/knownhost.pyx":410 * self._ptr, &_store, _prev) * while rc == 0: * entries.append(PyKnownHostEntry(_store)) # <<<<<<<<<<<<<< * _prev = _store * with nogil: */ - __pyx_t_1 = ((PyObject *)__pyx_f_4ssh2_9knownhost_PyKnownHostEntry(__pyx_v__store)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 406, __pyx_L1_error) + __pyx_t_1 = ((PyObject *)__pyx_f_4ssh2_9knownhost_PyKnownHostEntry(__pyx_v__store)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 410, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_entries, __pyx_t_1); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 406, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_entries, __pyx_t_1); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 410, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/knownhost.pyx":407 + /* "ssh2/knownhost.pyx":411 * while rc == 0: * entries.append(PyKnownHostEntry(_store)) * _prev = _store # <<<<<<<<<<<<<< @@ -5923,7 +5931,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_22get(struct __pyx_obj_4ss */ __pyx_v__prev = __pyx_v__store; - /* "ssh2/knownhost.pyx":408 + /* "ssh2/knownhost.pyx":412 * entries.append(PyKnownHostEntry(_store)) * _prev = _store * with nogil: # <<<<<<<<<<<<<< @@ -5938,7 +5946,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_22get(struct __pyx_obj_4ss #endif /*try:*/ { - /* "ssh2/knownhost.pyx":409 + /* "ssh2/knownhost.pyx":413 * _prev = _store * with nogil: * rc = c_ssh2.libssh2_knownhost_get( # <<<<<<<<<<<<<< @@ -5948,7 +5956,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_22get(struct __pyx_obj_4ss __pyx_v_rc = libssh2_knownhost_get(__pyx_v_self->_ptr, (&__pyx_v__store), __pyx_v__prev); } - /* "ssh2/knownhost.pyx":408 + /* "ssh2/knownhost.pyx":412 * entries.append(PyKnownHostEntry(_store)) * _prev = _store * with nogil: # <<<<<<<<<<<<<< @@ -5968,7 +5976,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_22get(struct __pyx_obj_4ss } } - /* "ssh2/knownhost.pyx":411 + /* "ssh2/knownhost.pyx":415 * rc = c_ssh2.libssh2_knownhost_get( * self._ptr, &_store, _prev) * if rc < 0: # <<<<<<<<<<<<<< @@ -5978,23 +5986,23 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_22get(struct __pyx_obj_4ss __pyx_t_3 = ((__pyx_v_rc < 0) != 0); if (unlikely(__pyx_t_3)) { - /* "ssh2/knownhost.pyx":412 + /* "ssh2/knownhost.pyx":416 * self._ptr, &_store, _prev) * if rc < 0: * raise KnownHostGetError( # <<<<<<<<<<<<<< * "Error retrieving known hosts - error code %s", rc) * return entries */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_KnownHostGetError); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 412, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_KnownHostGetError); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - /* "ssh2/knownhost.pyx":413 + /* "ssh2/knownhost.pyx":417 * if rc < 0: * raise KnownHostGetError( * "Error retrieving known hosts - error code %s", rc) # <<<<<<<<<<<<<< * return entries */ - __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 413, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 417, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = NULL; __pyx_t_9 = 0; @@ -6011,7 +6019,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_22get(struct __pyx_obj_4ss #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_kp_s_Error_retrieving_known_hosts_err, __pyx_t_7}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 412, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 416, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; @@ -6020,14 +6028,14 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_22get(struct __pyx_obj_4ss #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_kp_s_Error_retrieving_known_hosts_err, __pyx_t_7}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 412, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 416, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else #endif { - __pyx_t_10 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 412, __pyx_L1_error) + __pyx_t_10 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__pyx_t_8) { __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __pyx_t_8 = NULL; @@ -6038,16 +6046,16 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_22get(struct __pyx_obj_4ss __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_t_7); __pyx_t_7 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 412, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 412, __pyx_L1_error) + __PYX_ERR(0, 416, __pyx_L1_error) - /* "ssh2/knownhost.pyx":411 + /* "ssh2/knownhost.pyx":415 * rc = c_ssh2.libssh2_knownhost_get( * self._ptr, &_store, _prev) * if rc < 0: # <<<<<<<<<<<<<< @@ -6056,7 +6064,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_22get(struct __pyx_obj_4ss */ } - /* "ssh2/knownhost.pyx":414 + /* "ssh2/knownhost.pyx":418 * raise KnownHostGetError( * "Error retrieving known hosts - error code %s", rc) * return entries # <<<<<<<<<<<<<< @@ -6066,7 +6074,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_22get(struct __pyx_obj_4ss __pyx_r = __pyx_v_entries; goto __pyx_L0; - /* "ssh2/knownhost.pyx":385 + /* "ssh2/knownhost.pyx":389 * "Error writing known hosts to file %s", filename) * * def get(self, KnownHostEntry prev=None): # <<<<<<<<<<<<<< @@ -6540,6 +6548,10 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_LIBSSH2_KNOWNHOST_KEYENC_BASE64, __pyx_k_LIBSSH2_KNOWNHOST_KEYENC_BASE64, sizeof(__pyx_k_LIBSSH2_KNOWNHOST_KEYENC_BASE64), 0, 0, 1, 1}, {&__pyx_n_s_LIBSSH2_KNOWNHOST_KEYENC_MASK, __pyx_k_LIBSSH2_KNOWNHOST_KEYENC_MASK, sizeof(__pyx_k_LIBSSH2_KNOWNHOST_KEYENC_MASK), 0, 0, 1, 1}, {&__pyx_n_s_LIBSSH2_KNOWNHOST_KEYENC_RAW, __pyx_k_LIBSSH2_KNOWNHOST_KEYENC_RAW, sizeof(__pyx_k_LIBSSH2_KNOWNHOST_KEYENC_RAW), 0, 0, 1, 1}, + {&__pyx_n_s_LIBSSH2_KNOWNHOST_KEY_ECDSA_256, __pyx_k_LIBSSH2_KNOWNHOST_KEY_ECDSA_256, sizeof(__pyx_k_LIBSSH2_KNOWNHOST_KEY_ECDSA_256), 0, 0, 1, 1}, + {&__pyx_n_s_LIBSSH2_KNOWNHOST_KEY_ECDSA_384, __pyx_k_LIBSSH2_KNOWNHOST_KEY_ECDSA_384, sizeof(__pyx_k_LIBSSH2_KNOWNHOST_KEY_ECDSA_384), 0, 0, 1, 1}, + {&__pyx_n_s_LIBSSH2_KNOWNHOST_KEY_ECDSA_521, __pyx_k_LIBSSH2_KNOWNHOST_KEY_ECDSA_521, sizeof(__pyx_k_LIBSSH2_KNOWNHOST_KEY_ECDSA_521), 0, 0, 1, 1}, + {&__pyx_n_s_LIBSSH2_KNOWNHOST_KEY_ED25519, __pyx_k_LIBSSH2_KNOWNHOST_KEY_ED25519, sizeof(__pyx_k_LIBSSH2_KNOWNHOST_KEY_ED25519), 0, 0, 1, 1}, {&__pyx_n_s_LIBSSH2_KNOWNHOST_KEY_MASK, __pyx_k_LIBSSH2_KNOWNHOST_KEY_MASK, sizeof(__pyx_k_LIBSSH2_KNOWNHOST_KEY_MASK), 0, 0, 1, 1}, {&__pyx_n_s_LIBSSH2_KNOWNHOST_KEY_RSA1, __pyx_k_LIBSSH2_KNOWNHOST_KEY_RSA1, sizeof(__pyx_k_LIBSSH2_KNOWNHOST_KEY_RSA1), 0, 0, 1, 1}, {&__pyx_n_s_LIBSSH2_KNOWNHOST_KEY_SHIFT, __pyx_k_LIBSSH2_KNOWNHOST_KEY_SHIFT, sizeof(__pyx_k_LIBSSH2_KNOWNHOST_KEY_SHIFT), 0, 0, 1, 1}, @@ -6590,9 +6602,9 @@ 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, 72, __pyx_L1_error) + __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(0, 76, __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_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) __PYX_ERR(0, 140, __pyx_L1_error) + __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) __PYX_ERR(0, 144, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; @@ -6699,25 +6711,25 @@ static int __Pyx_modinit_type_init_code(void) { int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ - if (PyType_Ready(&__pyx_type_4ssh2_9knownhost_KnownHostEntry) < 0) __PYX_ERR(0, 82, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_4ssh2_9knownhost_KnownHostEntry) < 0) __PYX_ERR(0, 86, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_4ssh2_9knownhost_KnownHostEntry.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4ssh2_9knownhost_KnownHostEntry.tp_dictoffset && __pyx_type_4ssh2_9knownhost_KnownHostEntry.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_4ssh2_9knownhost_KnownHostEntry.tp_getattro = __Pyx_PyObject_GenericGetAttr; } - if (PyObject_SetAttr(__pyx_m, __pyx_n_s_KnownHostEntry, (PyObject *)&__pyx_type_4ssh2_9knownhost_KnownHostEntry) < 0) __PYX_ERR(0, 82, __pyx_L1_error) - if (__Pyx_setup_reduce((PyObject*)&__pyx_type_4ssh2_9knownhost_KnownHostEntry) < 0) __PYX_ERR(0, 82, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_KnownHostEntry, (PyObject *)&__pyx_type_4ssh2_9knownhost_KnownHostEntry) < 0) __PYX_ERR(0, 86, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_4ssh2_9knownhost_KnownHostEntry) < 0) __PYX_ERR(0, 86, __pyx_L1_error) __pyx_ptype_4ssh2_9knownhost_KnownHostEntry = &__pyx_type_4ssh2_9knownhost_KnownHostEntry; - if (PyType_Ready(&__pyx_type_4ssh2_9knownhost_KnownHost) < 0) __PYX_ERR(0, 126, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_4ssh2_9knownhost_KnownHost) < 0) __PYX_ERR(0, 130, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_4ssh2_9knownhost_KnownHost.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4ssh2_9knownhost_KnownHost.tp_dictoffset && __pyx_type_4ssh2_9knownhost_KnownHost.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_4ssh2_9knownhost_KnownHost.tp_getattro = __Pyx_PyObject_GenericGetAttr; } - if (PyObject_SetAttr(__pyx_m, __pyx_n_s_KnownHost, (PyObject *)&__pyx_type_4ssh2_9knownhost_KnownHost) < 0) __PYX_ERR(0, 126, __pyx_L1_error) - if (__Pyx_setup_reduce((PyObject*)&__pyx_type_4ssh2_9knownhost_KnownHost) < 0) __PYX_ERR(0, 126, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_KnownHost, (PyObject *)&__pyx_type_4ssh2_9knownhost_KnownHost) < 0) __PYX_ERR(0, 130, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_4ssh2_9knownhost_KnownHost) < 0) __PYX_ERR(0, 130, __pyx_L1_error) __pyx_ptype_4ssh2_9knownhost_KnownHost = &__pyx_type_4ssh2_9knownhost_KnownHost; __Pyx_RefNannyFinishContext(); return 0; @@ -7234,7 +7246,7 @@ if (!__Pyx_RefNanny) { * LIBSSH2_KNOWNHOST_KEY_SSHRSA = c_ssh2.LIBSSH2_KNOWNHOST_KEY_SSHRSA * LIBSSH2_KNOWNHOST_KEY_SSHDSS = c_ssh2.LIBSSH2_KNOWNHOST_KEY_SSHDSS # <<<<<<<<<<<<<< * IF EMBEDDED_LIB: - * LIBSSH2_KNOWNHOST_KEY_UNKNOWN = c_ssh2.LIBSSH2_KNOWNHOST_KEY_UNKNOWN + * LIBSSH2_KNOWNHOST_KEY_ECDSA_256 = c_ssh2.LIBSSH2_KNOWNHOST_KEY_ECDSA_256 */ __pyx_t_1 = __Pyx_PyInt_From_int(LIBSSH2_KNOWNHOST_KEY_SSHDSS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -7244,16 +7256,64 @@ if (!__Pyx_RefNanny) { /* "ssh2/knownhost.pyx":49 * LIBSSH2_KNOWNHOST_KEY_SSHDSS = c_ssh2.LIBSSH2_KNOWNHOST_KEY_SSHDSS * IF EMBEDDED_LIB: + * LIBSSH2_KNOWNHOST_KEY_ECDSA_256 = c_ssh2.LIBSSH2_KNOWNHOST_KEY_ECDSA_256 # <<<<<<<<<<<<<< + * LIBSSH2_KNOWNHOST_KEY_ECDSA_384 = c_ssh2.LIBSSH2_KNOWNHOST_KEY_ECDSA_384 + * LIBSSH2_KNOWNHOST_KEY_ECDSA_521 = c_ssh2.LIBSSH2_KNOWNHOST_KEY_ECDSA_521 + */ + __pyx_t_1 = __Pyx_PyInt_From_int(LIBSSH2_KNOWNHOST_KEY_ECDSA_256); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 49, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_KNOWNHOST_KEY_ECDSA_256, __pyx_t_1) < 0) __PYX_ERR(0, 49, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "ssh2/knownhost.pyx":50 + * IF EMBEDDED_LIB: + * LIBSSH2_KNOWNHOST_KEY_ECDSA_256 = c_ssh2.LIBSSH2_KNOWNHOST_KEY_ECDSA_256 + * LIBSSH2_KNOWNHOST_KEY_ECDSA_384 = c_ssh2.LIBSSH2_KNOWNHOST_KEY_ECDSA_384 # <<<<<<<<<<<<<< + * LIBSSH2_KNOWNHOST_KEY_ECDSA_521 = c_ssh2.LIBSSH2_KNOWNHOST_KEY_ECDSA_521 + * LIBSSH2_KNOWNHOST_KEY_ED25519 = c_ssh2.LIBSSH2_KNOWNHOST_KEY_ED25519 + */ + __pyx_t_1 = __Pyx_PyInt_From_int(LIBSSH2_KNOWNHOST_KEY_ECDSA_384); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 50, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_KNOWNHOST_KEY_ECDSA_384, __pyx_t_1) < 0) __PYX_ERR(0, 50, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "ssh2/knownhost.pyx":51 + * LIBSSH2_KNOWNHOST_KEY_ECDSA_256 = c_ssh2.LIBSSH2_KNOWNHOST_KEY_ECDSA_256 + * LIBSSH2_KNOWNHOST_KEY_ECDSA_384 = c_ssh2.LIBSSH2_KNOWNHOST_KEY_ECDSA_384 + * LIBSSH2_KNOWNHOST_KEY_ECDSA_521 = c_ssh2.LIBSSH2_KNOWNHOST_KEY_ECDSA_521 # <<<<<<<<<<<<<< + * LIBSSH2_KNOWNHOST_KEY_ED25519 = c_ssh2.LIBSSH2_KNOWNHOST_KEY_ED25519 + * LIBSSH2_KNOWNHOST_KEY_UNKNOWN = c_ssh2.LIBSSH2_KNOWNHOST_KEY_UNKNOWN + */ + __pyx_t_1 = __Pyx_PyInt_From_int(LIBSSH2_KNOWNHOST_KEY_ECDSA_521); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 51, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_KNOWNHOST_KEY_ECDSA_521, __pyx_t_1) < 0) __PYX_ERR(0, 51, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "ssh2/knownhost.pyx":52 + * LIBSSH2_KNOWNHOST_KEY_ECDSA_384 = c_ssh2.LIBSSH2_KNOWNHOST_KEY_ECDSA_384 + * LIBSSH2_KNOWNHOST_KEY_ECDSA_521 = c_ssh2.LIBSSH2_KNOWNHOST_KEY_ECDSA_521 + * LIBSSH2_KNOWNHOST_KEY_ED25519 = c_ssh2.LIBSSH2_KNOWNHOST_KEY_ED25519 # <<<<<<<<<<<<<< + * LIBSSH2_KNOWNHOST_KEY_UNKNOWN = c_ssh2.LIBSSH2_KNOWNHOST_KEY_UNKNOWN + * + */ + __pyx_t_1 = __Pyx_PyInt_From_int(LIBSSH2_KNOWNHOST_KEY_ED25519); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 52, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_KNOWNHOST_KEY_ED25519, __pyx_t_1) < 0) __PYX_ERR(0, 52, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "ssh2/knownhost.pyx":53 + * LIBSSH2_KNOWNHOST_KEY_ECDSA_521 = c_ssh2.LIBSSH2_KNOWNHOST_KEY_ECDSA_521 + * LIBSSH2_KNOWNHOST_KEY_ED25519 = c_ssh2.LIBSSH2_KNOWNHOST_KEY_ED25519 * LIBSSH2_KNOWNHOST_KEY_UNKNOWN = c_ssh2.LIBSSH2_KNOWNHOST_KEY_UNKNOWN # <<<<<<<<<<<<<< * * */ - __pyx_t_1 = __Pyx_PyInt_From_int(LIBSSH2_KNOWNHOST_KEY_UNKNOWN); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 49, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(LIBSSH2_KNOWNHOST_KEY_UNKNOWN); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_KNOWNHOST_KEY_UNKNOWN, __pyx_t_1) < 0) __PYX_ERR(0, 49, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_KNOWNHOST_KEY_UNKNOWN, __pyx_t_1) < 0) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/knownhost.pyx":278 + /* "ssh2/knownhost.pyx":282 * * def readline(self, bytes line not None, * int f_type=c_ssh2.LIBSSH2_KNOWNHOST_FILE_OPENSSH): # <<<<<<<<<<<<<< @@ -7262,7 +7322,7 @@ if (!__Pyx_RefNanny) { */ __pyx_k__3 = LIBSSH2_KNOWNHOST_FILE_OPENSSH; - /* "ssh2/knownhost.pyx":302 + /* "ssh2/knownhost.pyx":306 * * def readfile(self, filename not None, * int f_type=c_ssh2.LIBSSH2_KNOWNHOST_FILE_OPENSSH): # <<<<<<<<<<<<<< @@ -7271,7 +7331,7 @@ if (!__Pyx_RefNanny) { */ __pyx_k__4 = LIBSSH2_KNOWNHOST_FILE_OPENSSH; - /* "ssh2/knownhost.pyx":328 + /* "ssh2/knownhost.pyx":332 * * def writeline(self, KnownHostEntry entry, * int f_type=c_ssh2.LIBSSH2_KNOWNHOST_FILE_OPENSSH, # <<<<<<<<<<<<<< @@ -7280,7 +7340,7 @@ if (!__Pyx_RefNanny) { */ __pyx_k__5 = LIBSSH2_KNOWNHOST_FILE_OPENSSH; - /* "ssh2/knownhost.pyx":366 + /* "ssh2/knownhost.pyx":370 * * def writefile(self, filename not None, * int f_type=c_ssh2.LIBSSH2_KNOWNHOST_FILE_OPENSSH): # <<<<<<<<<<<<<< diff --git a/ssh2/knownhost.pyx b/ssh2/knownhost.pyx index a59ed9ca..d23eb396 100644 --- a/ssh2/knownhost.pyx +++ b/ssh2/knownhost.pyx @@ -46,6 +46,10 @@ LIBSSH2_KNOWNHOST_KEY_RSA1 = c_ssh2.LIBSSH2_KNOWNHOST_KEY_RSA1 LIBSSH2_KNOWNHOST_KEY_SSHRSA = c_ssh2.LIBSSH2_KNOWNHOST_KEY_SSHRSA LIBSSH2_KNOWNHOST_KEY_SSHDSS = c_ssh2.LIBSSH2_KNOWNHOST_KEY_SSHDSS IF EMBEDDED_LIB: + LIBSSH2_KNOWNHOST_KEY_ECDSA_256 = c_ssh2.LIBSSH2_KNOWNHOST_KEY_ECDSA_256 + LIBSSH2_KNOWNHOST_KEY_ECDSA_384 = c_ssh2.LIBSSH2_KNOWNHOST_KEY_ECDSA_384 + LIBSSH2_KNOWNHOST_KEY_ECDSA_521 = c_ssh2.LIBSSH2_KNOWNHOST_KEY_ECDSA_521 + LIBSSH2_KNOWNHOST_KEY_ED25519 = c_ssh2.LIBSSH2_KNOWNHOST_KEY_ED25519 LIBSSH2_KNOWNHOST_KEY_UNKNOWN = c_ssh2.LIBSSH2_KNOWNHOST_KEY_UNKNOWN diff --git a/ssh2/session.c b/ssh2/session.c index 6ba8db50..c31be297 100644 --- a/ssh2/session.c +++ b/ssh2/session.c @@ -988,7 +988,7 @@ struct __pyx_obj_4ssh2_7session_Session { }; -/* "ssh2/session.pyx":290 +/* "ssh2/session.pyx":305 * return handle_error_codes(rc) * * def userauth_keyboardinteractive(self, username not None, # <<<<<<<<<<<<<< @@ -1676,8 +1676,13 @@ static const char __pyx_k_LIBSSH2_HOSTKEY_HASH_MD5[] = "LIBSSH2_HOSTKEY_HASH_MD5 static const char __pyx_k_LIBSSH2_HOSTKEY_TYPE_DSS[] = "LIBSSH2_HOSTKEY_TYPE_DSS"; static const char __pyx_k_LIBSSH2_HOSTKEY_TYPE_RSA[] = "LIBSSH2_HOSTKEY_TYPE_RSA"; static const char __pyx_k_LIBSSH2_HOSTKEY_HASH_SHA1[] = "LIBSSH2_HOSTKEY_HASH_SHA1"; +static const char __pyx_k_LIBSSH2_HOSTKEY_HASH_SHA256[] = "LIBSSH2_HOSTKEY_HASH_SHA256"; +static const char __pyx_k_LIBSSH2_HOSTKEY_TYPE_ED25519[] = "LIBSSH2_HOSTKEY_TYPE_ED25519"; static const char __pyx_k_LIBSSH2_HOSTKEY_TYPE_UNKNOWN[] = "LIBSSH2_HOSTKEY_TYPE_UNKNOWN"; static const char __pyx_k_LIBSSH2_SESSION_BLOCK_INBOUND[] = "LIBSSH2_SESSION_BLOCK_INBOUND"; +static const char __pyx_k_LIBSSH2_HOSTKEY_TYPE_ECDSA_256[] = "LIBSSH2_HOSTKEY_TYPE_ECDSA_256"; +static const char __pyx_k_LIBSSH2_HOSTKEY_TYPE_ECDSA_384[] = "LIBSSH2_HOSTKEY_TYPE_ECDSA_384"; +static const char __pyx_k_LIBSSH2_HOSTKEY_TYPE_ECDSA_521[] = "LIBSSH2_HOSTKEY_TYPE_ECDSA_521"; static const char __pyx_k_LIBSSH2_SESSION_BLOCK_OUTBOUND[] = "LIBSSH2_SESSION_BLOCK_OUTBOUND"; static const char __pyx_k_Error_retrieving_server_host_key[] = "Error retrieving server host key for session"; static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__"; @@ -1688,7 +1693,12 @@ static PyObject *__pyx_kp_s_Error_retrieving_server_host_key; static PyObject *__pyx_n_s_KnownHostError; static PyObject *__pyx_n_s_LIBSSH2_HOSTKEY_HASH_MD5; static PyObject *__pyx_n_s_LIBSSH2_HOSTKEY_HASH_SHA1; +static PyObject *__pyx_n_s_LIBSSH2_HOSTKEY_HASH_SHA256; static PyObject *__pyx_n_s_LIBSSH2_HOSTKEY_TYPE_DSS; +static PyObject *__pyx_n_s_LIBSSH2_HOSTKEY_TYPE_ECDSA_256; +static PyObject *__pyx_n_s_LIBSSH2_HOSTKEY_TYPE_ECDSA_384; +static PyObject *__pyx_n_s_LIBSSH2_HOSTKEY_TYPE_ECDSA_521; +static PyObject *__pyx_n_s_LIBSSH2_HOSTKEY_TYPE_ED25519; static PyObject *__pyx_n_s_LIBSSH2_HOSTKEY_TYPE_RSA; static PyObject *__pyx_n_s_LIBSSH2_HOSTKEY_TYPE_UNKNOWN; static PyObject *__pyx_n_s_LIBSSH2_SESSION_BLOCK_INBOUND; @@ -1796,7 +1806,7 @@ static PyObject *__pyx_tuple__5; static PyObject *__pyx_codeobj__3; /* Late includes */ -/* "ssh2/session.pyx":50 +/* "ssh2/session.pyx":65 * * * cdef void kbd_callback(const char *name, int name_len, # <<<<<<<<<<<<<< @@ -1828,7 +1838,7 @@ static void __pyx_f_4ssh2_7session_kbd_callback(CYTHON_UNUSED char const *__pyx_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("kbd_callback", 0); - /* "ssh2/session.pyx":56 + /* "ssh2/session.pyx":71 * c_ssh2.LIBSSH2_USERAUTH_KBDINT_RESPONSE *responses, * void **abstract) except *: * py_sess = (c_dereference(abstract)) # <<<<<<<<<<<<<< @@ -1841,7 +1851,7 @@ static void __pyx_f_4ssh2_7session_kbd_callback(CYTHON_UNUSED char const *__pyx_ __pyx_v_py_sess = ((struct __pyx_obj_4ssh2_7session_Session *)__pyx_t_2); __pyx_t_2 = 0; - /* "ssh2/session.pyx":57 + /* "ssh2/session.pyx":72 * void **abstract) except *: * py_sess = (c_dereference(abstract)) * if py_sess._kbd_callback is None: # <<<<<<<<<<<<<< @@ -1852,7 +1862,7 @@ static void __pyx_f_4ssh2_7session_kbd_callback(CYTHON_UNUSED char const *__pyx_ __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { - /* "ssh2/session.pyx":58 + /* "ssh2/session.pyx":73 * py_sess = (c_dereference(abstract)) * if py_sess._kbd_callback is None: * return # <<<<<<<<<<<<<< @@ -1861,7 +1871,7 @@ static void __pyx_f_4ssh2_7session_kbd_callback(CYTHON_UNUSED char const *__pyx_ */ goto __pyx_L0; - /* "ssh2/session.pyx":57 + /* "ssh2/session.pyx":72 * void **abstract) except *: * py_sess = (c_dereference(abstract)) * if py_sess._kbd_callback is None: # <<<<<<<<<<<<<< @@ -1870,7 +1880,7 @@ static void __pyx_f_4ssh2_7session_kbd_callback(CYTHON_UNUSED char const *__pyx_ */ } - /* "ssh2/session.pyx":59 + /* "ssh2/session.pyx":74 * if py_sess._kbd_callback is None: * return * cdef bytes b_password = to_bytes(py_sess._kbd_callback()) # <<<<<<<<<<<<<< @@ -1890,16 +1900,16 @@ static void __pyx_f_4ssh2_7session_kbd_callback(CYTHON_UNUSED char const *__pyx_ } __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 59, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 59, __pyx_L1_error) + __pyx_t_5 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_b_password = ((PyObject*)__pyx_t_5); __pyx_t_5 = 0; - /* "ssh2/session.pyx":60 + /* "ssh2/session.pyx":75 * return * cdef bytes b_password = to_bytes(py_sess._kbd_callback()) * cdef size_t _len = len(b_password) # <<<<<<<<<<<<<< @@ -1908,12 +1918,12 @@ static void __pyx_f_4ssh2_7session_kbd_callback(CYTHON_UNUSED char const *__pyx_ */ if (unlikely(__pyx_v_b_password == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 60, __pyx_L1_error) + __PYX_ERR(0, 75, __pyx_L1_error) } - __pyx_t_7 = PyBytes_GET_SIZE(__pyx_v_b_password); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 60, __pyx_L1_error) + __pyx_t_7 = PyBytes_GET_SIZE(__pyx_v_b_password); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 75, __pyx_L1_error) __pyx_v__len = __pyx_t_7; - /* "ssh2/session.pyx":61 + /* "ssh2/session.pyx":76 * cdef bytes b_password = to_bytes(py_sess._kbd_callback()) * cdef size_t _len = len(b_password) * cdef char *_password = b_password # <<<<<<<<<<<<<< @@ -1922,12 +1932,12 @@ static void __pyx_f_4ssh2_7session_kbd_callback(CYTHON_UNUSED char const *__pyx_ */ if (unlikely(__pyx_v_b_password == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 61, __pyx_L1_error) + __PYX_ERR(0, 76, __pyx_L1_error) } - __pyx_t_8 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_password); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(0, 61, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_password); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(0, 76, __pyx_L1_error) __pyx_v__password = __pyx_t_8; - /* "ssh2/session.pyx":63 + /* "ssh2/session.pyx":78 * cdef char *_password = b_password * cdef char *_password_copy * if num_prompts == 1: # <<<<<<<<<<<<<< @@ -1937,7 +1947,7 @@ static void __pyx_f_4ssh2_7session_kbd_callback(CYTHON_UNUSED char const *__pyx_ __pyx_t_4 = ((__pyx_v_num_prompts == 1) != 0); if (__pyx_t_4) { - /* "ssh2/session.pyx":64 + /* "ssh2/session.pyx":79 * cdef char *_password_copy * if num_prompts == 1: * _password_copy = malloc(sizeof(char) * _len) # <<<<<<<<<<<<<< @@ -1946,7 +1956,7 @@ static void __pyx_f_4ssh2_7session_kbd_callback(CYTHON_UNUSED char const *__pyx_ */ __pyx_v__password_copy = ((char *)malloc(((sizeof(char)) * __pyx_v__len))); - /* "ssh2/session.pyx":65 + /* "ssh2/session.pyx":80 * if num_prompts == 1: * _password_copy = malloc(sizeof(char) * _len) * for i in range(_len): # <<<<<<<<<<<<<< @@ -1958,7 +1968,7 @@ static void __pyx_f_4ssh2_7session_kbd_callback(CYTHON_UNUSED char const *__pyx_ for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) { __pyx_v_i = __pyx_t_11; - /* "ssh2/session.pyx":66 + /* "ssh2/session.pyx":81 * _password_copy = malloc(sizeof(char) * _len) * for i in range(_len): * _password_copy[i] = _password[i] # <<<<<<<<<<<<<< @@ -1968,7 +1978,7 @@ static void __pyx_f_4ssh2_7session_kbd_callback(CYTHON_UNUSED char const *__pyx_ (__pyx_v__password_copy[__pyx_v_i]) = (__pyx_v__password[__pyx_v_i]); } - /* "ssh2/session.pyx":67 + /* "ssh2/session.pyx":82 * for i in range(_len): * _password_copy[i] = _password[i] * responses[0].text = _password_copy # <<<<<<<<<<<<<< @@ -1977,7 +1987,7 @@ static void __pyx_f_4ssh2_7session_kbd_callback(CYTHON_UNUSED char const *__pyx_ */ (__pyx_v_responses[0]).text = __pyx_v__password_copy; - /* "ssh2/session.pyx":68 + /* "ssh2/session.pyx":83 * _password_copy[i] = _password[i] * responses[0].text = _password_copy * responses[0].length = _len # <<<<<<<<<<<<<< @@ -1986,7 +1996,7 @@ static void __pyx_f_4ssh2_7session_kbd_callback(CYTHON_UNUSED char const *__pyx_ */ (__pyx_v_responses[0]).length = __pyx_v__len; - /* "ssh2/session.pyx":63 + /* "ssh2/session.pyx":78 * cdef char *_password = b_password * cdef char *_password_copy * if num_prompts == 1: # <<<<<<<<<<<<<< @@ -1995,7 +2005,7 @@ static void __pyx_f_4ssh2_7session_kbd_callback(CYTHON_UNUSED char const *__pyx_ */ } - /* "ssh2/session.pyx":50 + /* "ssh2/session.pyx":65 * * * cdef void kbd_callback(const char *name, int name_len, # <<<<<<<<<<<<<< @@ -2016,7 +2026,7 @@ static void __pyx_f_4ssh2_7session_kbd_callback(CYTHON_UNUSED char const *__pyx_ __Pyx_RefNannyFinishContext(); } -/* "ssh2/session.pyx":75 +/* "ssh2/session.pyx":90 * """LibSSH2 Session class providing session functions""" * * def __cinit__(self): # <<<<<<<<<<<<<< @@ -2049,7 +2059,7 @@ static int __pyx_pf_4ssh2_7session_7Session___cinit__(struct __pyx_obj_4ssh2_7se int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "ssh2/session.pyx":76 + /* "ssh2/session.pyx":91 * * def __cinit__(self): * self._session = c_ssh2.libssh2_session_init_ex( # <<<<<<<<<<<<<< @@ -2058,7 +2068,7 @@ static int __pyx_pf_4ssh2_7session_7Session___cinit__(struct __pyx_obj_4ssh2_7se */ __pyx_v_self->_session = libssh2_session_init_ex(NULL, NULL, NULL, ((void *)__pyx_v_self)); - /* "ssh2/session.pyx":78 + /* "ssh2/session.pyx":93 * self._session = c_ssh2.libssh2_session_init_ex( * NULL, NULL, NULL, self) * if self._session is NULL: # <<<<<<<<<<<<<< @@ -2068,16 +2078,16 @@ static int __pyx_pf_4ssh2_7session_7Session___cinit__(struct __pyx_obj_4ssh2_7se __pyx_t_1 = ((__pyx_v_self->_session == NULL) != 0); if (unlikely(__pyx_t_1)) { - /* "ssh2/session.pyx":79 + /* "ssh2/session.pyx":94 * NULL, NULL, NULL, self) * if self._session is NULL: * raise MemoryError # <<<<<<<<<<<<<< * self._sock = 0 * self.sock = None */ - PyErr_NoMemory(); __PYX_ERR(0, 79, __pyx_L1_error) + PyErr_NoMemory(); __PYX_ERR(0, 94, __pyx_L1_error) - /* "ssh2/session.pyx":78 + /* "ssh2/session.pyx":93 * self._session = c_ssh2.libssh2_session_init_ex( * NULL, NULL, NULL, self) * if self._session is NULL: # <<<<<<<<<<<<<< @@ -2086,7 +2096,7 @@ static int __pyx_pf_4ssh2_7session_7Session___cinit__(struct __pyx_obj_4ssh2_7se */ } - /* "ssh2/session.pyx":80 + /* "ssh2/session.pyx":95 * if self._session is NULL: * raise MemoryError * self._sock = 0 # <<<<<<<<<<<<<< @@ -2095,7 +2105,7 @@ static int __pyx_pf_4ssh2_7session_7Session___cinit__(struct __pyx_obj_4ssh2_7se */ __pyx_v_self->_sock = 0; - /* "ssh2/session.pyx":81 + /* "ssh2/session.pyx":96 * raise MemoryError * self._sock = 0 * self.sock = None # <<<<<<<<<<<<<< @@ -2108,7 +2118,7 @@ static int __pyx_pf_4ssh2_7session_7Session___cinit__(struct __pyx_obj_4ssh2_7se __Pyx_DECREF(__pyx_v_self->sock); __pyx_v_self->sock = Py_None; - /* "ssh2/session.pyx":82 + /* "ssh2/session.pyx":97 * self._sock = 0 * self.sock = None * self._kbd_callback = None # <<<<<<<<<<<<<< @@ -2121,7 +2131,7 @@ static int __pyx_pf_4ssh2_7session_7Session___cinit__(struct __pyx_obj_4ssh2_7se __Pyx_DECREF(__pyx_v_self->_kbd_callback); __pyx_v_self->_kbd_callback = Py_None; - /* "ssh2/session.pyx":75 + /* "ssh2/session.pyx":90 * """LibSSH2 Session class providing session functions""" * * def __cinit__(self): # <<<<<<<<<<<<<< @@ -2140,7 +2150,7 @@ static int __pyx_pf_4ssh2_7session_7Session___cinit__(struct __pyx_obj_4ssh2_7se return __pyx_r; } -/* "ssh2/session.pyx":84 +/* "ssh2/session.pyx":99 * self._kbd_callback = None * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -2164,7 +2174,7 @@ static void __pyx_pf_4ssh2_7session_7Session_2__dealloc__(struct __pyx_obj_4ssh2 int __pyx_t_1; __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "ssh2/session.pyx":85 + /* "ssh2/session.pyx":100 * * def __dealloc__(self): * if self._session is not NULL: # <<<<<<<<<<<<<< @@ -2174,7 +2184,7 @@ static void __pyx_pf_4ssh2_7session_7Session_2__dealloc__(struct __pyx_obj_4ssh2 __pyx_t_1 = ((__pyx_v_self->_session != NULL) != 0); if (__pyx_t_1) { - /* "ssh2/session.pyx":86 + /* "ssh2/session.pyx":101 * def __dealloc__(self): * if self._session is not NULL: * c_ssh2.libssh2_session_free(self._session) # <<<<<<<<<<<<<< @@ -2183,7 +2193,7 @@ static void __pyx_pf_4ssh2_7session_7Session_2__dealloc__(struct __pyx_obj_4ssh2 */ (void)(libssh2_session_free(__pyx_v_self->_session)); - /* "ssh2/session.pyx":85 + /* "ssh2/session.pyx":100 * * def __dealloc__(self): * if self._session is not NULL: # <<<<<<<<<<<<<< @@ -2192,7 +2202,7 @@ static void __pyx_pf_4ssh2_7session_7Session_2__dealloc__(struct __pyx_obj_4ssh2 */ } - /* "ssh2/session.pyx":87 + /* "ssh2/session.pyx":102 * if self._session is not NULL: * c_ssh2.libssh2_session_free(self._session) * self._session = NULL # <<<<<<<<<<<<<< @@ -2201,7 +2211,7 @@ static void __pyx_pf_4ssh2_7session_7Session_2__dealloc__(struct __pyx_obj_4ssh2 */ __pyx_v_self->_session = NULL; - /* "ssh2/session.pyx":84 + /* "ssh2/session.pyx":99 * self._kbd_callback = None * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -2213,7 +2223,7 @@ static void __pyx_pf_4ssh2_7session_7Session_2__dealloc__(struct __pyx_obj_4ssh2 __Pyx_RefNannyFinishContext(); } -/* "ssh2/session.pyx":89 +/* "ssh2/session.pyx":104 * self._session = NULL * * def disconnect(self): # <<<<<<<<<<<<<< @@ -2246,7 +2256,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_4disconnect(struct __pyx_obj_4 int __pyx_clineno = 0; __Pyx_RefNannySetupContext("disconnect", 0); - /* "ssh2/session.pyx":91 + /* "ssh2/session.pyx":106 * def disconnect(self): * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -2261,7 +2271,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_4disconnect(struct __pyx_obj_4 #endif /*try:*/ { - /* "ssh2/session.pyx":92 + /* "ssh2/session.pyx":107 * cdef int rc * with nogil: * rc = c_ssh2.libssh2_session_disconnect(self._session, b"end") # <<<<<<<<<<<<<< @@ -2271,7 +2281,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_4disconnect(struct __pyx_obj_4 __pyx_v_rc = libssh2_session_disconnect(__pyx_v_self->_session, ((char const *)"end")); } - /* "ssh2/session.pyx":91 + /* "ssh2/session.pyx":106 * def disconnect(self): * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -2290,7 +2300,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_4disconnect(struct __pyx_obj_4 } } - /* "ssh2/session.pyx":93 + /* "ssh2/session.pyx":108 * with nogil: * rc = c_ssh2.libssh2_session_disconnect(self._session, b"end") * return handle_error_codes(rc) # <<<<<<<<<<<<<< @@ -2298,14 +2308,14 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_4disconnect(struct __pyx_obj_4 * def handshake(self, sock 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, 93, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 93, __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, 108, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":89 + /* "ssh2/session.pyx":104 * self._session = NULL * * def disconnect(self): # <<<<<<<<<<<<<< @@ -2324,7 +2334,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_4disconnect(struct __pyx_obj_4 return __pyx_r; } -/* "ssh2/session.pyx":95 +/* "ssh2/session.pyx":110 * return handle_error_codes(rc) * * def handshake(self, sock not None): # <<<<<<<<<<<<<< @@ -2343,7 +2353,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, 95, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "sock"); __PYX_ERR(0, 110, __pyx_L1_error) } __pyx_r = __pyx_pf_4ssh2_7session_7Session_6handshake(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), ((PyObject *)__pyx_v_sock)); @@ -2368,17 +2378,17 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_6handshake(struct __pyx_obj_4s int __pyx_clineno = 0; __Pyx_RefNannySetupContext("handshake", 0); - /* "ssh2/session.pyx":99 + /* "ssh2/session.pyx":114 * * Must be called after Session initialisation.""" * cdef int _sock = PyObject_AsFileDescriptor(sock) # <<<<<<<<<<<<<< * cdef int rc * with nogil: */ - __pyx_t_1 = PyObject_AsFileDescriptor(__pyx_v_sock); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 99, __pyx_L1_error) + __pyx_t_1 = PyObject_AsFileDescriptor(__pyx_v_sock); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 114, __pyx_L1_error) __pyx_v__sock = __pyx_t_1; - /* "ssh2/session.pyx":101 + /* "ssh2/session.pyx":116 * cdef int _sock = PyObject_AsFileDescriptor(sock) * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -2393,7 +2403,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_6handshake(struct __pyx_obj_4s #endif /*try:*/ { - /* "ssh2/session.pyx":102 + /* "ssh2/session.pyx":117 * cdef int rc * with nogil: * rc = c_ssh2.libssh2_session_handshake(self._session, _sock) # <<<<<<<<<<<<<< @@ -2402,7 +2412,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":103 + /* "ssh2/session.pyx":118 * with nogil: * rc = c_ssh2.libssh2_session_handshake(self._session, _sock) * self._sock = _sock # <<<<<<<<<<<<<< @@ -2412,7 +2422,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_6handshake(struct __pyx_obj_4s __pyx_v_self->_sock = __pyx_v__sock; } - /* "ssh2/session.pyx":101 + /* "ssh2/session.pyx":116 * cdef int _sock = PyObject_AsFileDescriptor(sock) * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -2431,7 +2441,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_6handshake(struct __pyx_obj_4s } } - /* "ssh2/session.pyx":104 + /* "ssh2/session.pyx":119 * rc = c_ssh2.libssh2_session_handshake(self._session, _sock) * self._sock = _sock * self.sock = sock # <<<<<<<<<<<<<< @@ -2444,7 +2454,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_6handshake(struct __pyx_obj_4s __Pyx_DECREF(__pyx_v_self->sock); __pyx_v_self->sock = __pyx_v_sock; - /* "ssh2/session.pyx":105 + /* "ssh2/session.pyx":120 * self._sock = _sock * self.sock = sock * return handle_error_codes(rc) # <<<<<<<<<<<<<< @@ -2452,14 +2462,14 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_6handshake(struct __pyx_obj_4s * def startup(self, sock): */ __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, 105, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 105, __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, 120, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":95 + /* "ssh2/session.pyx":110 * return handle_error_codes(rc) * * def handshake(self, sock not None): # <<<<<<<<<<<<<< @@ -2478,7 +2488,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_6handshake(struct __pyx_obj_4s return __pyx_r; } -/* "ssh2/session.pyx":107 +/* "ssh2/session.pyx":122 * return handle_error_codes(rc) * * def startup(self, sock): # <<<<<<<<<<<<<< @@ -2512,17 +2522,17 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_8startup(struct __pyx_obj_4ssh int __pyx_clineno = 0; __Pyx_RefNannySetupContext("startup", 0); - /* "ssh2/session.pyx":109 + /* "ssh2/session.pyx":124 * def startup(self, sock): * """Deprecated - use self.handshake""" * cdef int _sock = PyObject_AsFileDescriptor(sock) # <<<<<<<<<<<<<< * cdef int rc * rc = c_ssh2.libssh2_session_startup(self._session, _sock) */ - __pyx_t_1 = PyObject_AsFileDescriptor(__pyx_v_sock); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 109, __pyx_L1_error) + __pyx_t_1 = PyObject_AsFileDescriptor(__pyx_v_sock); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 124, __pyx_L1_error) __pyx_v__sock = __pyx_t_1; - /* "ssh2/session.pyx":111 + /* "ssh2/session.pyx":126 * cdef int _sock = PyObject_AsFileDescriptor(sock) * cdef int rc * rc = c_ssh2.libssh2_session_startup(self._session, _sock) # <<<<<<<<<<<<<< @@ -2531,7 +2541,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":112 + /* "ssh2/session.pyx":127 * cdef int rc * rc = c_ssh2.libssh2_session_startup(self._session, _sock) * return handle_error_codes(rc) # <<<<<<<<<<<<<< @@ -2539,14 +2549,14 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_8startup(struct __pyx_obj_4ssh * def set_blocking(self, bint blocking): */ __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, 112, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 112, __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, 127, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(__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":107 + /* "ssh2/session.pyx":122 * return handle_error_codes(rc) * * def startup(self, sock): # <<<<<<<<<<<<<< @@ -2565,7 +2575,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_8startup(struct __pyx_obj_4ssh return __pyx_r; } -/* "ssh2/session.pyx":114 +/* "ssh2/session.pyx":129 * return handle_error_codes(rc) * * def set_blocking(self, bint blocking): # <<<<<<<<<<<<<< @@ -2585,7 +2595,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, 114, __pyx_L3_error) + __pyx_v_blocking = __Pyx_PyObject_IsTrue(__pyx_arg_blocking); if (unlikely((__pyx_v_blocking == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 129, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -2605,7 +2615,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_10set_blocking(struct __pyx_ob __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_blocking", 0); - /* "ssh2/session.pyx":120 + /* "ssh2/session.pyx":135 * Session default is blocking unless set otherwise. * :type blocking: bool""" * with nogil: # <<<<<<<<<<<<<< @@ -2620,7 +2630,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_10set_blocking(struct __pyx_ob #endif /*try:*/ { - /* "ssh2/session.pyx":121 + /* "ssh2/session.pyx":136 * :type blocking: bool""" * with nogil: * c_ssh2.libssh2_session_set_blocking( # <<<<<<<<<<<<<< @@ -2630,7 +2640,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":120 + /* "ssh2/session.pyx":135 * Session default is blocking unless set otherwise. * :type blocking: bool""" * with nogil: # <<<<<<<<<<<<<< @@ -2649,7 +2659,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_10set_blocking(struct __pyx_ob } } - /* "ssh2/session.pyx":114 + /* "ssh2/session.pyx":129 * return handle_error_codes(rc) * * def set_blocking(self, bint blocking): # <<<<<<<<<<<<<< @@ -2664,7 +2674,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_10set_blocking(struct __pyx_ob return __pyx_r; } -/* "ssh2/session.pyx":124 +/* "ssh2/session.pyx":139 * self._session, blocking) * * def get_blocking(self): # <<<<<<<<<<<<<< @@ -2697,7 +2707,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_12get_blocking(struct __pyx_ob int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_blocking", 0); - /* "ssh2/session.pyx":129 + /* "ssh2/session.pyx":144 * :rtype: bool""" * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -2712,7 +2722,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_12get_blocking(struct __pyx_ob #endif /*try:*/ { - /* "ssh2/session.pyx":130 + /* "ssh2/session.pyx":145 * cdef int rc * with nogil: * rc = c_ssh2.libssh2_session_get_blocking(self._session) # <<<<<<<<<<<<<< @@ -2722,7 +2732,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":129 + /* "ssh2/session.pyx":144 * :rtype: bool""" * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -2741,7 +2751,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_12get_blocking(struct __pyx_ob } } - /* "ssh2/session.pyx":131 + /* "ssh2/session.pyx":146 * with nogil: * rc = c_ssh2.libssh2_session_get_blocking(self._session) * return bool(rc) # <<<<<<<<<<<<<< @@ -2749,17 +2759,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, 131, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 146, __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, 131, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 146, __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, 131, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":124 + /* "ssh2/session.pyx":139 * self._session, blocking) * * def get_blocking(self): # <<<<<<<<<<<<<< @@ -2778,7 +2788,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_12get_blocking(struct __pyx_ob return __pyx_r; } -/* "ssh2/session.pyx":133 +/* "ssh2/session.pyx":148 * return bool(rc) * * def set_timeout(self, long timeout): # <<<<<<<<<<<<<< @@ -2798,7 +2808,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, 133, __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, 148, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -2818,7 +2828,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_14set_timeout(struct __pyx_obj __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_timeout", 0); - /* "ssh2/session.pyx":141 + /* "ssh2/session.pyx":156 * time out. * :param timeout: Milliseconds to wait before timeout.""" * with nogil: # <<<<<<<<<<<<<< @@ -2833,7 +2843,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_14set_timeout(struct __pyx_obj #endif /*try:*/ { - /* "ssh2/session.pyx":142 + /* "ssh2/session.pyx":157 * :param timeout: Milliseconds to wait before timeout.""" * with nogil: * c_ssh2.libssh2_session_set_timeout(self._session, timeout) # <<<<<<<<<<<<<< @@ -2843,7 +2853,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":141 + /* "ssh2/session.pyx":156 * time out. * :param timeout: Milliseconds to wait before timeout.""" * with nogil: # <<<<<<<<<<<<<< @@ -2862,7 +2872,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_14set_timeout(struct __pyx_obj } } - /* "ssh2/session.pyx":133 + /* "ssh2/session.pyx":148 * return bool(rc) * * def set_timeout(self, long timeout): # <<<<<<<<<<<<<< @@ -2877,7 +2887,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_14set_timeout(struct __pyx_obj return __pyx_r; } -/* "ssh2/session.pyx":144 +/* "ssh2/session.pyx":159 * c_ssh2.libssh2_session_set_timeout(self._session, timeout) * * def get_timeout(self): # <<<<<<<<<<<<<< @@ -2909,7 +2919,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_16get_timeout(struct __pyx_obj int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_timeout", 0); - /* "ssh2/session.pyx":147 + /* "ssh2/session.pyx":162 * """Get current session timeout setting""" * cdef long timeout * with nogil: # <<<<<<<<<<<<<< @@ -2924,7 +2934,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_16get_timeout(struct __pyx_obj #endif /*try:*/ { - /* "ssh2/session.pyx":148 + /* "ssh2/session.pyx":163 * cdef long timeout * with nogil: * timeout = c_ssh2.libssh2_session_get_timeout(self._session) # <<<<<<<<<<<<<< @@ -2934,7 +2944,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":147 + /* "ssh2/session.pyx":162 * """Get current session timeout setting""" * cdef long timeout * with nogil: # <<<<<<<<<<<<<< @@ -2953,7 +2963,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_16get_timeout(struct __pyx_obj } } - /* "ssh2/session.pyx":149 + /* "ssh2/session.pyx":164 * with nogil: * timeout = c_ssh2.libssh2_session_get_timeout(self._session) * return timeout # <<<<<<<<<<<<<< @@ -2961,13 +2971,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, 149, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_timeout); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":144 + /* "ssh2/session.pyx":159 * c_ssh2.libssh2_session_set_timeout(self._session, timeout) * * def get_timeout(self): # <<<<<<<<<<<<<< @@ -2986,7 +2996,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_16get_timeout(struct __pyx_obj return __pyx_r; } -/* "ssh2/session.pyx":151 +/* "ssh2/session.pyx":166 * return timeout * * def userauth_authenticated(self): # <<<<<<<<<<<<<< @@ -3019,7 +3029,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_18userauth_authenticated(struc int __pyx_clineno = 0; __Pyx_RefNannySetupContext("userauth_authenticated", 0); - /* "ssh2/session.pyx":156 + /* "ssh2/session.pyx":171 * :rtype: bool""" * cdef bint rc * with nogil: # <<<<<<<<<<<<<< @@ -3034,7 +3044,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_18userauth_authenticated(struc #endif /*try:*/ { - /* "ssh2/session.pyx":157 + /* "ssh2/session.pyx":172 * cdef bint rc * with nogil: * rc = c_ssh2.libssh2_userauth_authenticated(self._session) # <<<<<<<<<<<<<< @@ -3044,7 +3054,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_18userauth_authenticated(struc __pyx_v_rc = libssh2_userauth_authenticated(__pyx_v_self->_session); } - /* "ssh2/session.pyx":156 + /* "ssh2/session.pyx":171 * :rtype: bool""" * cdef bint rc * with nogil: # <<<<<<<<<<<<<< @@ -3063,7 +3073,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_18userauth_authenticated(struc } } - /* "ssh2/session.pyx":158 + /* "ssh2/session.pyx":173 * with nogil: * rc = c_ssh2.libssh2_userauth_authenticated(self._session) * return bool(rc) # <<<<<<<<<<<<<< @@ -3072,13 +3082,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, 158, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBool_FromLong((!(!__pyx_t_1))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":151 + /* "ssh2/session.pyx":166 * return timeout * * def userauth_authenticated(self): # <<<<<<<<<<<<<< @@ -3097,7 +3107,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_18userauth_authenticated(struc return __pyx_r; } -/* "ssh2/session.pyx":160 +/* "ssh2/session.pyx":175 * return bool(rc) * * def userauth_list(self, username not None): # <<<<<<<<<<<<<< @@ -3116,7 +3126,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, 160, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "username"); __PYX_ERR(0, 175, __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)); @@ -3146,19 +3156,19 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_20userauth_list(struct __pyx_o int __pyx_clineno = 0; __Pyx_RefNannySetupContext("userauth_list", 0); - /* "ssh2/session.pyx":164 + /* "ssh2/session.pyx":179 * * :rtype: list""" * cdef bytes b_username = to_bytes(username) # <<<<<<<<<<<<<< * cdef char *_username = b_username * cdef size_t username_len = len(b_username) */ - __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_username); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 164, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_username); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 179, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_b_username = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/session.pyx":165 + /* "ssh2/session.pyx":180 * :rtype: list""" * cdef bytes b_username = to_bytes(username) * cdef char *_username = b_username # <<<<<<<<<<<<<< @@ -3167,12 +3177,12 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_20userauth_list(struct __pyx_o */ if (unlikely(__pyx_v_b_username == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 165, __pyx_L1_error) + __PYX_ERR(0, 180, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_username); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 165, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_username); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 180, __pyx_L1_error) __pyx_v__username = __pyx_t_2; - /* "ssh2/session.pyx":166 + /* "ssh2/session.pyx":181 * cdef bytes b_username = to_bytes(username) * cdef char *_username = b_username * cdef size_t username_len = len(b_username) # <<<<<<<<<<<<<< @@ -3181,12 +3191,12 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_20userauth_list(struct __pyx_o */ if (unlikely(__pyx_v_b_username == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 166, __pyx_L1_error) + __PYX_ERR(0, 181, __pyx_L1_error) } - __pyx_t_3 = PyBytes_GET_SIZE(__pyx_v_b_username); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 166, __pyx_L1_error) + __pyx_t_3 = PyBytes_GET_SIZE(__pyx_v_b_username); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 181, __pyx_L1_error) __pyx_v_username_len = __pyx_t_3; - /* "ssh2/session.pyx":169 + /* "ssh2/session.pyx":184 * cdef char *_auth * cdef str auth * with nogil: # <<<<<<<<<<<<<< @@ -3201,7 +3211,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_20userauth_list(struct __pyx_o #endif /*try:*/ { - /* "ssh2/session.pyx":170 + /* "ssh2/session.pyx":185 * cdef str auth * with nogil: * _auth = c_ssh2.libssh2_userauth_list( # <<<<<<<<<<<<<< @@ -3211,7 +3221,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":169 + /* "ssh2/session.pyx":184 * cdef char *_auth * cdef str auth * with nogil: # <<<<<<<<<<<<<< @@ -3230,7 +3240,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_20userauth_list(struct __pyx_o } } - /* "ssh2/session.pyx":172 + /* "ssh2/session.pyx":187 * _auth = c_ssh2.libssh2_userauth_list( * self._session, _username, username_len) * if _auth is NULL: # <<<<<<<<<<<<<< @@ -3240,7 +3250,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_20userauth_list(struct __pyx_o __pyx_t_4 = ((__pyx_v__auth == NULL) != 0); if (__pyx_t_4) { - /* "ssh2/session.pyx":173 + /* "ssh2/session.pyx":188 * self._session, _username, username_len) * if _auth is NULL: * return # <<<<<<<<<<<<<< @@ -3251,7 +3261,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":172 + /* "ssh2/session.pyx":187 * _auth = c_ssh2.libssh2_userauth_list( * self._session, _username, username_len) * if _auth is NULL: # <<<<<<<<<<<<<< @@ -3260,20 +3270,20 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_20userauth_list(struct __pyx_o */ } - /* "ssh2/session.pyx":174 + /* "ssh2/session.pyx":189 * if _auth is NULL: * return * auth = to_str(_auth) # <<<<<<<<<<<<<< * return auth.split(',') * */ - __pyx_t_1 = __pyx_f_4ssh2_5utils_to_str(__pyx_v__auth); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 174, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_5utils_to_str(__pyx_v__auth); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 174, __pyx_L1_error) + if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 189, __pyx_L1_error) __pyx_v_auth = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/session.pyx":175 + /* "ssh2/session.pyx":190 * return * auth = to_str(_auth) * return auth.split(',') # <<<<<<<<<<<<<< @@ -3281,13 +3291,13 @@ 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_1 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyString_Type_split, __pyx_v_auth, __pyx_kp_s_); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 175, __pyx_L1_error) + __pyx_t_1 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyString_Type_split, __pyx_v_auth, __pyx_kp_s_); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":160 + /* "ssh2/session.pyx":175 * return bool(rc) * * def userauth_list(self, username not None): # <<<<<<<<<<<<<< @@ -3308,7 +3318,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_20userauth_list(struct __pyx_o return __pyx_r; } -/* "ssh2/session.pyx":177 +/* "ssh2/session.pyx":192 * return auth.split(',') * * def userauth_publickey_fromfile(self, username not None, # <<<<<<<<<<<<<< @@ -3335,7 +3345,7 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_23userauth_publickey_fromfile( PyObject* values[4] = {0,0,0,0}; values[2] = ((PyObject *)__pyx_kp_s__2); - /* "ssh2/session.pyx":180 + /* "ssh2/session.pyx":195 * privatekey not None, * passphrase='', * publickey=None): # <<<<<<<<<<<<<< @@ -3367,7 +3377,7 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_23userauth_publickey_fromfile( case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_privatekey)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("userauth_publickey_fromfile", 0, 2, 4, 1); __PYX_ERR(0, 177, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("userauth_publickey_fromfile", 0, 2, 4, 1); __PYX_ERR(0, 192, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -3383,7 +3393,7 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_23userauth_publickey_fromfile( } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "userauth_publickey_fromfile") < 0)) __PYX_ERR(0, 177, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "userauth_publickey_fromfile") < 0)) __PYX_ERR(0, 192, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -3404,21 +3414,21 @@ 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", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 177, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("userauth_publickey_fromfile", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 192, __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, 177, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "username"); __PYX_ERR(0, 192, __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, 178, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "privatekey"); __PYX_ERR(0, 193, __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_privatekey, __pyx_v_passphrase, __pyx_v_publickey); - /* "ssh2/session.pyx":177 + /* "ssh2/session.pyx":192 * return auth.split(',') * * def userauth_publickey_fromfile(self, username not None, # <<<<<<<<<<<<<< @@ -3458,19 +3468,19 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_22userauth_publickey_fromfile( int __pyx_clineno = 0; __Pyx_RefNannySetupContext("userauth_publickey_fromfile", 0); - /* "ssh2/session.pyx":185 + /* "ssh2/session.pyx":200 * :rtype: int""" * cdef int rc * cdef bytes b_username = to_bytes(username) # <<<<<<<<<<<<<< * cdef bytes b_publickey = to_bytes(publickey) \ * if publickey is not None else None */ - __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_username); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 185, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_username); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_b_username = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/session.pyx":187 + /* "ssh2/session.pyx":202 * cdef bytes b_username = to_bytes(username) * cdef bytes b_publickey = to_bytes(publickey) \ * if publickey is not None else None # <<<<<<<<<<<<<< @@ -3480,20 +3490,20 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_22userauth_publickey_fromfile( __pyx_t_2 = (__pyx_v_publickey != Py_None); if ((__pyx_t_2 != 0)) { - /* "ssh2/session.pyx":186 + /* "ssh2/session.pyx":201 * cdef int rc * cdef bytes b_username = to_bytes(username) * cdef bytes b_publickey = to_bytes(publickey) \ # <<<<<<<<<<<<<< * if publickey is not None else None * cdef bytes b_privatekey = to_bytes(privatekey) */ - __pyx_t_3 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_publickey); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 186, __pyx_L1_error) + __pyx_t_3 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_publickey); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { - /* "ssh2/session.pyx":187 + /* "ssh2/session.pyx":202 * cdef bytes b_username = to_bytes(username) * cdef bytes b_publickey = to_bytes(publickey) \ * if publickey is not None else None # <<<<<<<<<<<<<< @@ -3506,31 +3516,31 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_22userauth_publickey_fromfile( __pyx_v_b_publickey = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/session.pyx":188 + /* "ssh2/session.pyx":203 * cdef bytes b_publickey = to_bytes(publickey) \ * if publickey is not None else None * cdef bytes b_privatekey = to_bytes(privatekey) # <<<<<<<<<<<<<< * cdef bytes b_passphrase = to_bytes(passphrase) * cdef char *_username = b_username */ - __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_privatekey); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 188, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_privatekey); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_b_privatekey = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/session.pyx":189 + /* "ssh2/session.pyx":204 * if publickey is not None else None * cdef bytes b_privatekey = to_bytes(privatekey) * cdef bytes b_passphrase = to_bytes(passphrase) # <<<<<<<<<<<<<< * cdef char *_username = b_username * cdef char *_publickey = NULL */ - __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_passphrase); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 189, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_passphrase); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_b_passphrase = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/session.pyx":190 + /* "ssh2/session.pyx":205 * cdef bytes b_privatekey = to_bytes(privatekey) * cdef bytes b_passphrase = to_bytes(passphrase) * cdef char *_username = b_username # <<<<<<<<<<<<<< @@ -3539,12 +3549,12 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_22userauth_publickey_fromfile( */ if (unlikely(__pyx_v_b_username == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 190, __pyx_L1_error) + __PYX_ERR(0, 205, __pyx_L1_error) } - __pyx_t_4 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_username); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(0, 190, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_username); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(0, 205, __pyx_L1_error) __pyx_v__username = __pyx_t_4; - /* "ssh2/session.pyx":191 + /* "ssh2/session.pyx":206 * cdef bytes b_passphrase = to_bytes(passphrase) * cdef char *_username = b_username * cdef char *_publickey = NULL # <<<<<<<<<<<<<< @@ -3553,7 +3563,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_22userauth_publickey_fromfile( */ __pyx_v__publickey = NULL; - /* "ssh2/session.pyx":192 + /* "ssh2/session.pyx":207 * cdef char *_username = b_username * cdef char *_publickey = NULL * cdef char *_privatekey = b_privatekey # <<<<<<<<<<<<<< @@ -3562,12 +3572,12 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_22userauth_publickey_fromfile( */ if (unlikely(__pyx_v_b_privatekey == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 192, __pyx_L1_error) + __PYX_ERR(0, 207, __pyx_L1_error) } - __pyx_t_4 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_privatekey); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(0, 192, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_privatekey); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(0, 207, __pyx_L1_error) __pyx_v__privatekey = __pyx_t_4; - /* "ssh2/session.pyx":193 + /* "ssh2/session.pyx":208 * cdef char *_publickey = NULL * cdef char *_privatekey = b_privatekey * cdef char *_passphrase = b_passphrase # <<<<<<<<<<<<<< @@ -3576,12 +3586,12 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_22userauth_publickey_fromfile( */ if (unlikely(__pyx_v_b_passphrase == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 193, __pyx_L1_error) + __PYX_ERR(0, 208, __pyx_L1_error) } - __pyx_t_4 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_passphrase); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(0, 193, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_passphrase); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(0, 208, __pyx_L1_error) __pyx_v__passphrase = __pyx_t_4; - /* "ssh2/session.pyx":194 + /* "ssh2/session.pyx":209 * cdef char *_privatekey = b_privatekey * cdef char *_passphrase = b_passphrase * if b_publickey is not None: # <<<<<<<<<<<<<< @@ -3592,7 +3602,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_22userauth_publickey_fromfile( __pyx_t_5 = (__pyx_t_2 != 0); if (__pyx_t_5) { - /* "ssh2/session.pyx":195 + /* "ssh2/session.pyx":210 * cdef char *_passphrase = b_passphrase * if b_publickey is not None: * _publickey = b_publickey # <<<<<<<<<<<<<< @@ -3601,12 +3611,12 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_22userauth_publickey_fromfile( */ if (unlikely(__pyx_v_b_publickey == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 195, __pyx_L1_error) + __PYX_ERR(0, 210, __pyx_L1_error) } - __pyx_t_4 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_publickey); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(0, 195, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_publickey); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(0, 210, __pyx_L1_error) __pyx_v__publickey = __pyx_t_4; - /* "ssh2/session.pyx":194 + /* "ssh2/session.pyx":209 * cdef char *_privatekey = b_privatekey * cdef char *_passphrase = b_passphrase * if b_publickey is not None: # <<<<<<<<<<<<<< @@ -3615,7 +3625,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_22userauth_publickey_fromfile( */ } - /* "ssh2/session.pyx":196 + /* "ssh2/session.pyx":211 * if b_publickey is not None: * _publickey = b_publickey * with nogil: # <<<<<<<<<<<<<< @@ -3630,7 +3640,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_22userauth_publickey_fromfile( #endif /*try:*/ { - /* "ssh2/session.pyx":197 + /* "ssh2/session.pyx":212 * _publickey = b_publickey * with nogil: * rc = c_ssh2.libssh2_userauth_publickey_fromfile( # <<<<<<<<<<<<<< @@ -3640,7 +3650,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":196 + /* "ssh2/session.pyx":211 * if b_publickey is not None: * _publickey = b_publickey * with nogil: # <<<<<<<<<<<<<< @@ -3659,7 +3669,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_22userauth_publickey_fromfile( } } - /* "ssh2/session.pyx":199 + /* "ssh2/session.pyx":214 * rc = c_ssh2.libssh2_userauth_publickey_fromfile( * self._session, _username, _publickey, _privatekey, _passphrase) * return handle_error_codes(rc) # <<<<<<<<<<<<<< @@ -3667,14 +3677,14 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_22userauth_publickey_fromfile( * def userauth_publickey(self, username not None, */ __Pyx_XDECREF(__pyx_r); - __pyx_t_6 = __pyx_f_4ssh2_5utils_handle_error_codes(__pyx_v_rc, 0); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 199, __pyx_L1_error) - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 199, __pyx_L1_error) + __pyx_t_6 = __pyx_f_4ssh2_5utils_handle_error_codes(__pyx_v_rc, 0); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 214, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 214, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":177 + /* "ssh2/session.pyx":192 * return auth.split(',') * * def userauth_publickey_fromfile(self, username not None, # <<<<<<<<<<<<<< @@ -3698,7 +3708,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_22userauth_publickey_fromfile( return __pyx_r; } -/* "ssh2/session.pyx":201 +/* "ssh2/session.pyx":216 * return handle_error_codes(rc) * * def userauth_publickey(self, username not None, # <<<<<<<<<<<<<< @@ -3741,11 +3751,11 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_25userauth_publickey(PyObject case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pubkeydata)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("userauth_publickey", 1, 2, 2, 1); __PYX_ERR(0, 201, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("userauth_publickey", 1, 2, 2, 1); __PYX_ERR(0, 216, __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, 201, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "userauth_publickey") < 0)) __PYX_ERR(0, 216, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -3758,16 +3768,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, 201, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("userauth_publickey", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 216, __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, 201, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "username"); __PYX_ERR(0, 216, __pyx_L1_error) } - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pubkeydata), (&PyBytes_Type), 0, "pubkeydata", 1))) __PYX_ERR(0, 202, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pubkeydata), (&PyBytes_Type), 0, "pubkeydata", 1))) __PYX_ERR(0, 217, __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 */ @@ -3797,19 +3807,19 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_24userauth_publickey(struct __ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("userauth_publickey", 0); - /* "ssh2/session.pyx":212 + /* "ssh2/session.pyx":227 * :rtype: int""" * cdef int rc * cdef bytes b_username = to_bytes(username) # <<<<<<<<<<<<<< * cdef char *_username = b_username * cdef unsigned char *_pubkeydata = pubkeydata */ - __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_username); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 212, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_username); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_b_username = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/session.pyx":213 + /* "ssh2/session.pyx":228 * cdef int rc * cdef bytes b_username = to_bytes(username) * cdef char *_username = b_username # <<<<<<<<<<<<<< @@ -3818,32 +3828,32 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_24userauth_publickey(struct __ */ if (unlikely(__pyx_v_b_username == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 213, __pyx_L1_error) + __PYX_ERR(0, 228, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_username); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 213, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_username); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 228, __pyx_L1_error) __pyx_v__username = __pyx_t_2; - /* "ssh2/session.pyx":214 + /* "ssh2/session.pyx":229 * cdef bytes b_username = to_bytes(username) * cdef char *_username = b_username * cdef unsigned char *_pubkeydata = pubkeydata # <<<<<<<<<<<<<< * cdef size_t pubkeydata_len = len(pubkeydata) * with nogil: */ - __pyx_t_3 = __Pyx_PyBytes_AsWritableUString(__pyx_v_pubkeydata); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) __PYX_ERR(0, 214, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyBytes_AsWritableUString(__pyx_v_pubkeydata); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) __PYX_ERR(0, 229, __pyx_L1_error) __pyx_v__pubkeydata = __pyx_t_3; - /* "ssh2/session.pyx":215 + /* "ssh2/session.pyx":230 * cdef char *_username = b_username * cdef unsigned char *_pubkeydata = pubkeydata * cdef size_t pubkeydata_len = len(pubkeydata) # <<<<<<<<<<<<<< * with nogil: * rc = c_ssh2.libssh2_userauth_publickey( */ - __pyx_t_4 = PyBytes_GET_SIZE(__pyx_v_pubkeydata); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 215, __pyx_L1_error) + __pyx_t_4 = PyBytes_GET_SIZE(__pyx_v_pubkeydata); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 230, __pyx_L1_error) __pyx_v_pubkeydata_len = __pyx_t_4; - /* "ssh2/session.pyx":216 + /* "ssh2/session.pyx":231 * cdef unsigned char *_pubkeydata = pubkeydata * cdef size_t pubkeydata_len = len(pubkeydata) * with nogil: # <<<<<<<<<<<<<< @@ -3858,7 +3868,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_24userauth_publickey(struct __ #endif /*try:*/ { - /* "ssh2/session.pyx":217 + /* "ssh2/session.pyx":232 * cdef size_t pubkeydata_len = len(pubkeydata) * with nogil: * rc = c_ssh2.libssh2_userauth_publickey( # <<<<<<<<<<<<<< @@ -3868,7 +3878,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":216 + /* "ssh2/session.pyx":231 * cdef unsigned char *_pubkeydata = pubkeydata * cdef size_t pubkeydata_len = len(pubkeydata) * with nogil: # <<<<<<<<<<<<<< @@ -3887,7 +3897,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_24userauth_publickey(struct __ } } - /* "ssh2/session.pyx":220 + /* "ssh2/session.pyx":235 * self._session, _username, _pubkeydata, * pubkeydata_len, NULL, NULL) * return handle_error_codes(rc) # <<<<<<<<<<<<<< @@ -3895,14 +3905,14 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_24userauth_publickey(struct __ * def userauth_hostbased_fromfile(self, */ __Pyx_XDECREF(__pyx_r); - __pyx_t_5 = __pyx_f_4ssh2_5utils_handle_error_codes(__pyx_v_rc, 0); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 220, __pyx_L1_error) - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 220, __pyx_L1_error) + __pyx_t_5 = __pyx_f_4ssh2_5utils_handle_error_codes(__pyx_v_rc, 0); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 235, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":201 + /* "ssh2/session.pyx":216 * return handle_error_codes(rc) * * def userauth_publickey(self, username not None, # <<<<<<<<<<<<<< @@ -3922,7 +3932,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_24userauth_publickey(struct __ return __pyx_r; } -/* "ssh2/session.pyx":222 +/* "ssh2/session.pyx":237 * return handle_error_codes(rc) * * def userauth_hostbased_fromfile(self, # <<<<<<<<<<<<<< @@ -3949,7 +3959,7 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_27userauth_hostbased_fromfile( static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_username,&__pyx_n_s_privatekey,&__pyx_n_s_hostname,&__pyx_n_s_publickey,&__pyx_n_s_passphrase,0}; PyObject* values[5] = {0,0,0,0,0}; - /* "ssh2/session.pyx":226 + /* "ssh2/session.pyx":241 * privatekey not None, * hostname not None, * publickey=None, # <<<<<<<<<<<<<< @@ -3984,13 +3994,13 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_27userauth_hostbased_fromfile( case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_privatekey)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("userauth_hostbased_fromfile", 0, 3, 5, 1); __PYX_ERR(0, 222, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("userauth_hostbased_fromfile", 0, 3, 5, 1); __PYX_ERR(0, 237, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_hostname)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("userauth_hostbased_fromfile", 0, 3, 5, 2); __PYX_ERR(0, 222, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("userauth_hostbased_fromfile", 0, 3, 5, 2); __PYX_ERR(0, 237, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: @@ -4006,7 +4016,7 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_27userauth_hostbased_fromfile( } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "userauth_hostbased_fromfile") < 0)) __PYX_ERR(0, 222, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "userauth_hostbased_fromfile") < 0)) __PYX_ERR(0, 237, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -4029,24 +4039,24 @@ 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", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 222, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("userauth_hostbased_fromfile", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 237, __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, 223, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "username"); __PYX_ERR(0, 238, __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, 224, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "privatekey"); __PYX_ERR(0, 239, __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, 225, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "hostname"); __PYX_ERR(0, 240, __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_privatekey, __pyx_v_hostname, __pyx_v_publickey, __pyx_v_passphrase); - /* "ssh2/session.pyx":222 + /* "ssh2/session.pyx":237 * return handle_error_codes(rc) * * def userauth_hostbased_fromfile(self, # <<<<<<<<<<<<<< @@ -4088,19 +4098,19 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_26userauth_hostbased_fromfile( int __pyx_clineno = 0; __Pyx_RefNannySetupContext("userauth_hostbased_fromfile", 0); - /* "ssh2/session.pyx":229 + /* "ssh2/session.pyx":244 * passphrase=''): * cdef int rc * cdef bytes b_username = to_bytes(username) # <<<<<<<<<<<<<< * cdef bytes b_publickey = to_bytes(publickey) \ * if publickey is not None else None */ - __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_username); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_username); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_b_username = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/session.pyx":231 + /* "ssh2/session.pyx":246 * cdef bytes b_username = to_bytes(username) * cdef bytes b_publickey = to_bytes(publickey) \ * if publickey is not None else None # <<<<<<<<<<<<<< @@ -4110,20 +4120,20 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_26userauth_hostbased_fromfile( __pyx_t_2 = (__pyx_v_publickey != Py_None); if ((__pyx_t_2 != 0)) { - /* "ssh2/session.pyx":230 + /* "ssh2/session.pyx":245 * cdef int rc * cdef bytes b_username = to_bytes(username) * cdef bytes b_publickey = to_bytes(publickey) \ # <<<<<<<<<<<<<< * if publickey is not None else None * cdef bytes b_privatekey = to_bytes(privatekey) */ - __pyx_t_3 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_publickey); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 230, __pyx_L1_error) + __pyx_t_3 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_publickey); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { - /* "ssh2/session.pyx":231 + /* "ssh2/session.pyx":246 * cdef bytes b_username = to_bytes(username) * cdef bytes b_publickey = to_bytes(publickey) \ * if publickey is not None else None # <<<<<<<<<<<<<< @@ -4136,43 +4146,43 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_26userauth_hostbased_fromfile( __pyx_v_b_publickey = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/session.pyx":232 + /* "ssh2/session.pyx":247 * cdef bytes b_publickey = to_bytes(publickey) \ * if publickey is not None else None * cdef bytes b_privatekey = to_bytes(privatekey) # <<<<<<<<<<<<<< * cdef bytes b_passphrase = to_bytes(passphrase) * cdef bytes b_hostname = to_bytes(hostname) */ - __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_privatekey); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_privatekey); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_b_privatekey = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/session.pyx":233 + /* "ssh2/session.pyx":248 * if publickey is not None else None * cdef bytes b_privatekey = to_bytes(privatekey) * cdef bytes b_passphrase = to_bytes(passphrase) # <<<<<<<<<<<<<< * cdef bytes b_hostname = to_bytes(hostname) * cdef char *_username = b_username */ - __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_passphrase); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 233, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_passphrase); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_b_passphrase = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/session.pyx":234 + /* "ssh2/session.pyx":249 * cdef bytes b_privatekey = to_bytes(privatekey) * cdef bytes b_passphrase = to_bytes(passphrase) * cdef bytes b_hostname = to_bytes(hostname) # <<<<<<<<<<<<<< * cdef char *_username = b_username * cdef char *_publickey = NULL */ - __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_hostname); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_hostname); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_b_hostname = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/session.pyx":235 + /* "ssh2/session.pyx":250 * cdef bytes b_passphrase = to_bytes(passphrase) * cdef bytes b_hostname = to_bytes(hostname) * cdef char *_username = b_username # <<<<<<<<<<<<<< @@ -4181,12 +4191,12 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_26userauth_hostbased_fromfile( */ if (unlikely(__pyx_v_b_username == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 235, __pyx_L1_error) + __PYX_ERR(0, 250, __pyx_L1_error) } - __pyx_t_4 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_username); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(0, 235, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_username); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(0, 250, __pyx_L1_error) __pyx_v__username = __pyx_t_4; - /* "ssh2/session.pyx":236 + /* "ssh2/session.pyx":251 * cdef bytes b_hostname = to_bytes(hostname) * cdef char *_username = b_username * cdef char *_publickey = NULL # <<<<<<<<<<<<<< @@ -4195,7 +4205,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_26userauth_hostbased_fromfile( */ __pyx_v__publickey = NULL; - /* "ssh2/session.pyx":237 + /* "ssh2/session.pyx":252 * cdef char *_username = b_username * cdef char *_publickey = NULL * cdef char *_privatekey = b_privatekey # <<<<<<<<<<<<<< @@ -4204,12 +4214,12 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_26userauth_hostbased_fromfile( */ if (unlikely(__pyx_v_b_privatekey == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 237, __pyx_L1_error) + __PYX_ERR(0, 252, __pyx_L1_error) } - __pyx_t_4 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_privatekey); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(0, 237, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_privatekey); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(0, 252, __pyx_L1_error) __pyx_v__privatekey = __pyx_t_4; - /* "ssh2/session.pyx":238 + /* "ssh2/session.pyx":253 * cdef char *_publickey = NULL * cdef char *_privatekey = b_privatekey * cdef char *_passphrase = b_passphrase # <<<<<<<<<<<<<< @@ -4218,12 +4228,12 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_26userauth_hostbased_fromfile( */ if (unlikely(__pyx_v_b_passphrase == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 238, __pyx_L1_error) + __PYX_ERR(0, 253, __pyx_L1_error) } - __pyx_t_4 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_passphrase); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(0, 238, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_passphrase); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(0, 253, __pyx_L1_error) __pyx_v__passphrase = __pyx_t_4; - /* "ssh2/session.pyx":239 + /* "ssh2/session.pyx":254 * cdef char *_privatekey = b_privatekey * cdef char *_passphrase = b_passphrase * cdef char *_hostname = b_hostname # <<<<<<<<<<<<<< @@ -4232,12 +4242,12 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_26userauth_hostbased_fromfile( */ if (unlikely(__pyx_v_b_hostname == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 239, __pyx_L1_error) + __PYX_ERR(0, 254, __pyx_L1_error) } - __pyx_t_4 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_hostname); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(0, 239, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_hostname); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(0, 254, __pyx_L1_error) __pyx_v__hostname = __pyx_t_4; - /* "ssh2/session.pyx":240 + /* "ssh2/session.pyx":255 * cdef char *_passphrase = b_passphrase * cdef char *_hostname = b_hostname * if b_publickey is not None: # <<<<<<<<<<<<<< @@ -4248,7 +4258,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_26userauth_hostbased_fromfile( __pyx_t_5 = (__pyx_t_2 != 0); if (__pyx_t_5) { - /* "ssh2/session.pyx":241 + /* "ssh2/session.pyx":256 * cdef char *_hostname = b_hostname * if b_publickey is not None: * _publickey = b_publickey # <<<<<<<<<<<<<< @@ -4257,12 +4267,12 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_26userauth_hostbased_fromfile( */ if (unlikely(__pyx_v_b_publickey == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 241, __pyx_L1_error) + __PYX_ERR(0, 256, __pyx_L1_error) } - __pyx_t_4 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_publickey); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(0, 241, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_publickey); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(0, 256, __pyx_L1_error) __pyx_v__publickey = __pyx_t_4; - /* "ssh2/session.pyx":240 + /* "ssh2/session.pyx":255 * cdef char *_passphrase = b_passphrase * cdef char *_hostname = b_hostname * if b_publickey is not None: # <<<<<<<<<<<<<< @@ -4271,7 +4281,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_26userauth_hostbased_fromfile( */ } - /* "ssh2/session.pyx":242 + /* "ssh2/session.pyx":257 * if b_publickey is not None: * _publickey = b_publickey * with nogil: # <<<<<<<<<<<<<< @@ -4286,7 +4296,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_26userauth_hostbased_fromfile( #endif /*try:*/ { - /* "ssh2/session.pyx":243 + /* "ssh2/session.pyx":258 * _publickey = b_publickey * with nogil: * rc = c_ssh2.libssh2_userauth_hostbased_fromfile( # <<<<<<<<<<<<<< @@ -4296,7 +4306,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":242 + /* "ssh2/session.pyx":257 * if b_publickey is not None: * _publickey = b_publickey * with nogil: # <<<<<<<<<<<<<< @@ -4315,7 +4325,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_26userauth_hostbased_fromfile( } } - /* "ssh2/session.pyx":246 + /* "ssh2/session.pyx":261 * self._session, _username, _publickey, * _privatekey, _passphrase, _hostname) * return handle_error_codes(rc) # <<<<<<<<<<<<<< @@ -4323,14 +4333,14 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_26userauth_hostbased_fromfile( * IF EMBEDDED_LIB: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_6 = __pyx_f_4ssh2_5utils_handle_error_codes(__pyx_v_rc, 0); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 246, __pyx_L1_error) - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 246, __pyx_L1_error) + __pyx_t_6 = __pyx_f_4ssh2_5utils_handle_error_codes(__pyx_v_rc, 0); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 261, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_t_6); 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/session.pyx":222 + /* "ssh2/session.pyx":237 * return handle_error_codes(rc) * * def userauth_hostbased_fromfile(self, # <<<<<<<<<<<<<< @@ -4355,7 +4365,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_26userauth_hostbased_fromfile( return __pyx_r; } -/* "ssh2/session.pyx":249 +/* "ssh2/session.pyx":264 * * IF EMBEDDED_LIB: * def userauth_publickey_frommemory( # <<<<<<<<<<<<<< @@ -4382,7 +4392,7 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_29userauth_publickey_frommemor PyObject* values[4] = {0,0,0,0}; values[2] = ((PyObject *)__pyx_kp_s__2); - /* "ssh2/session.pyx":251 + /* "ssh2/session.pyx":266 * def userauth_publickey_frommemory( * self, username, bytes privatekeyfiledata, * passphrase='', bytes publickeyfiledata=None): # <<<<<<<<<<<<<< @@ -4414,7 +4424,7 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_29userauth_publickey_frommemor case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_privatekeyfiledata)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("userauth_publickey_frommemory", 0, 2, 4, 1); __PYX_ERR(0, 249, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("userauth_publickey_frommemory", 0, 2, 4, 1); __PYX_ERR(0, 264, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -4430,7 +4440,7 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_29userauth_publickey_frommemor } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "userauth_publickey_frommemory") < 0)) __PYX_ERR(0, 249, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "userauth_publickey_frommemory") < 0)) __PYX_ERR(0, 264, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -4451,17 +4461,17 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_29userauth_publickey_frommemor } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("userauth_publickey_frommemory", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 249, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("userauth_publickey_frommemory", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 264, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.session.Session.userauth_publickey_frommemory", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_privatekeyfiledata), (&PyBytes_Type), 1, "privatekeyfiledata", 1))) __PYX_ERR(0, 250, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_publickeyfiledata), (&PyBytes_Type), 1, "publickeyfiledata", 1))) __PYX_ERR(0, 251, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_privatekeyfiledata), (&PyBytes_Type), 1, "privatekeyfiledata", 1))) __PYX_ERR(0, 265, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_publickeyfiledata), (&PyBytes_Type), 1, "publickeyfiledata", 1))) __PYX_ERR(0, 266, __pyx_L1_error) __pyx_r = __pyx_pf_4ssh2_7session_7Session_28userauth_publickey_frommemory(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), __pyx_v_username, __pyx_v_privatekeyfiledata, __pyx_v_passphrase, __pyx_v_publickeyfiledata); - /* "ssh2/session.pyx":249 + /* "ssh2/session.pyx":264 * * IF EMBEDDED_LIB: * def userauth_publickey_frommemory( # <<<<<<<<<<<<<< @@ -4503,31 +4513,31 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_28userauth_publickey_frommemor int __pyx_clineno = 0; __Pyx_RefNannySetupContext("userauth_publickey_frommemory", 0); - /* "ssh2/session.pyx":253 + /* "ssh2/session.pyx":268 * passphrase='', bytes publickeyfiledata=None): * cdef int rc * cdef bytes b_username = to_bytes(username) # <<<<<<<<<<<<<< * cdef bytes b_passphrase = to_bytes(passphrase) * cdef char *_username = b_username */ - __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_username); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 253, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_username); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 268, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_b_username = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/session.pyx":254 + /* "ssh2/session.pyx":269 * cdef int rc * cdef bytes b_username = to_bytes(username) * cdef bytes b_passphrase = to_bytes(passphrase) # <<<<<<<<<<<<<< * cdef char *_username = b_username * cdef char *_passphrase = b_passphrase */ - __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_passphrase); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 254, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_passphrase); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_b_passphrase = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/session.pyx":255 + /* "ssh2/session.pyx":270 * cdef bytes b_username = to_bytes(username) * cdef bytes b_passphrase = to_bytes(passphrase) * cdef char *_username = b_username # <<<<<<<<<<<<<< @@ -4536,12 +4546,12 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_28userauth_publickey_frommemor */ if (unlikely(__pyx_v_b_username == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 255, __pyx_L1_error) + __PYX_ERR(0, 270, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_username); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 255, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_username); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 270, __pyx_L1_error) __pyx_v__username = __pyx_t_2; - /* "ssh2/session.pyx":256 + /* "ssh2/session.pyx":271 * cdef bytes b_passphrase = to_bytes(passphrase) * cdef char *_username = b_username * cdef char *_passphrase = b_passphrase # <<<<<<<<<<<<<< @@ -4550,12 +4560,12 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_28userauth_publickey_frommemor */ if (unlikely(__pyx_v_b_passphrase == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 256, __pyx_L1_error) + __PYX_ERR(0, 271, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_passphrase); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 256, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_passphrase); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 271, __pyx_L1_error) __pyx_v__passphrase = __pyx_t_2; - /* "ssh2/session.pyx":257 + /* "ssh2/session.pyx":272 * cdef char *_username = b_username * cdef char *_passphrase = b_passphrase * cdef char *_publickeyfiledata = NULL # <<<<<<<<<<<<<< @@ -4564,7 +4574,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_28userauth_publickey_frommemor */ __pyx_v__publickeyfiledata = NULL; - /* "ssh2/session.pyx":258 + /* "ssh2/session.pyx":273 * cdef char *_passphrase = b_passphrase * cdef char *_publickeyfiledata = NULL * cdef char *_privatekeyfiledata = privatekeyfiledata # <<<<<<<<<<<<<< @@ -4573,12 +4583,12 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_28userauth_publickey_frommemor */ if (unlikely(__pyx_v_privatekeyfiledata == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 258, __pyx_L1_error) + __PYX_ERR(0, 273, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_privatekeyfiledata); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 258, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_privatekeyfiledata); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 273, __pyx_L1_error) __pyx_v__privatekeyfiledata = __pyx_t_2; - /* "ssh2/session.pyx":260 + /* "ssh2/session.pyx":275 * cdef char *_privatekeyfiledata = privatekeyfiledata * cdef size_t username_len, privatekeydata_len * cdef size_t pubkeydata_len = 0 # <<<<<<<<<<<<<< @@ -4587,7 +4597,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_28userauth_publickey_frommemor */ __pyx_v_pubkeydata_len = 0; - /* "ssh2/session.pyx":262 + /* "ssh2/session.pyx":277 * cdef size_t pubkeydata_len = 0 * username_len, privatekeydata_len = \ * len(b_username), len(privatekeyfiledata) # <<<<<<<<<<<<<< @@ -4596,18 +4606,18 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_28userauth_publickey_frommemor */ if (unlikely(__pyx_v_b_username == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 262, __pyx_L1_error) + __PYX_ERR(0, 277, __pyx_L1_error) } - __pyx_t_3 = PyBytes_GET_SIZE(__pyx_v_b_username); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 262, __pyx_L1_error) + __pyx_t_3 = PyBytes_GET_SIZE(__pyx_v_b_username); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 277, __pyx_L1_error) if (unlikely(__pyx_v_privatekeyfiledata == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 262, __pyx_L1_error) + __PYX_ERR(0, 277, __pyx_L1_error) } - __pyx_t_4 = PyBytes_GET_SIZE(__pyx_v_privatekeyfiledata); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 262, __pyx_L1_error) + __pyx_t_4 = PyBytes_GET_SIZE(__pyx_v_privatekeyfiledata); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 277, __pyx_L1_error) __pyx_v_username_len = __pyx_t_3; __pyx_v_privatekeydata_len = __pyx_t_4; - /* "ssh2/session.pyx":263 + /* "ssh2/session.pyx":278 * username_len, privatekeydata_len = \ * len(b_username), len(privatekeyfiledata) * if publickeyfiledata is not None: # <<<<<<<<<<<<<< @@ -4618,7 +4628,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_28userauth_publickey_frommemor __pyx_t_6 = (__pyx_t_5 != 0); if (__pyx_t_6) { - /* "ssh2/session.pyx":264 + /* "ssh2/session.pyx":279 * len(b_username), len(privatekeyfiledata) * if publickeyfiledata is not None: * _publickeyfiledata = publickeyfiledata # <<<<<<<<<<<<<< @@ -4627,12 +4637,12 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_28userauth_publickey_frommemor */ if (unlikely(__pyx_v_publickeyfiledata == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 264, __pyx_L1_error) + __PYX_ERR(0, 279, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_publickeyfiledata); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 264, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_publickeyfiledata); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 279, __pyx_L1_error) __pyx_v__publickeyfiledata = __pyx_t_2; - /* "ssh2/session.pyx":265 + /* "ssh2/session.pyx":280 * if publickeyfiledata is not None: * _publickeyfiledata = publickeyfiledata * pubkeydata_len = len(publickeyfiledata) # <<<<<<<<<<<<<< @@ -4641,12 +4651,12 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_28userauth_publickey_frommemor */ if (unlikely(__pyx_v_publickeyfiledata == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 265, __pyx_L1_error) + __PYX_ERR(0, 280, __pyx_L1_error) } - __pyx_t_4 = PyBytes_GET_SIZE(__pyx_v_publickeyfiledata); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 265, __pyx_L1_error) + __pyx_t_4 = PyBytes_GET_SIZE(__pyx_v_publickeyfiledata); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 280, __pyx_L1_error) __pyx_v_pubkeydata_len = __pyx_t_4; - /* "ssh2/session.pyx":263 + /* "ssh2/session.pyx":278 * username_len, privatekeydata_len = \ * len(b_username), len(privatekeyfiledata) * if publickeyfiledata is not None: # <<<<<<<<<<<<<< @@ -4655,7 +4665,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_28userauth_publickey_frommemor */ } - /* "ssh2/session.pyx":266 + /* "ssh2/session.pyx":281 * _publickeyfiledata = publickeyfiledata * pubkeydata_len = len(publickeyfiledata) * with nogil: # <<<<<<<<<<<<<< @@ -4670,7 +4680,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_28userauth_publickey_frommemor #endif /*try:*/ { - /* "ssh2/session.pyx":267 + /* "ssh2/session.pyx":282 * pubkeydata_len = len(publickeyfiledata) * with nogil: * rc = c_ssh2.libssh2_userauth_publickey_frommemory( # <<<<<<<<<<<<<< @@ -4680,7 +4690,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_28userauth_publickey_frommemor __pyx_v_rc = libssh2_userauth_publickey_frommemory(__pyx_v_self->_session, __pyx_v__username, __pyx_v_username_len, __pyx_v__publickeyfiledata, __pyx_v_pubkeydata_len, __pyx_v__privatekeyfiledata, __pyx_v_privatekeydata_len, __pyx_v__passphrase); } - /* "ssh2/session.pyx":266 + /* "ssh2/session.pyx":281 * _publickeyfiledata = publickeyfiledata * pubkeydata_len = len(publickeyfiledata) * with nogil: # <<<<<<<<<<<<<< @@ -4699,7 +4709,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_28userauth_publickey_frommemor } } - /* "ssh2/session.pyx":271 + /* "ssh2/session.pyx":286 * pubkeydata_len, _privatekeyfiledata, * privatekeydata_len, _passphrase) * return handle_error_codes(rc) # <<<<<<<<<<<<<< @@ -4707,14 +4717,14 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_28userauth_publickey_frommemor * def userauth_password(self, username not None, password not None): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_7 = __pyx_f_4ssh2_5utils_handle_error_codes(__pyx_v_rc, 0); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 271, __pyx_L1_error) - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 271, __pyx_L1_error) + __pyx_t_7 = __pyx_f_4ssh2_5utils_handle_error_codes(__pyx_v_rc, 0); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 286, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":249 + /* "ssh2/session.pyx":264 * * IF EMBEDDED_LIB: * def userauth_publickey_frommemory( # <<<<<<<<<<<<<< @@ -4735,7 +4745,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_28userauth_publickey_frommemor return __pyx_r; } -/* "ssh2/session.pyx":273 +/* "ssh2/session.pyx":288 * return handle_error_codes(rc) * * def userauth_password(self, username not None, password not None): # <<<<<<<<<<<<<< @@ -4778,11 +4788,11 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_31userauth_password(PyObject * case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_password)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("userauth_password", 1, 2, 2, 1); __PYX_ERR(0, 273, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("userauth_password", 1, 2, 2, 1); __PYX_ERR(0, 288, __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, 273, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "userauth_password") < 0)) __PYX_ERR(0, 288, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -4795,17 +4805,17 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_31userauth_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, 273, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("userauth_password", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 288, __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, 273, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "username"); __PYX_ERR(0, 288, __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, 273, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "password"); __PYX_ERR(0, 288, __pyx_L1_error) } __pyx_r = __pyx_pf_4ssh2_7session_7Session_30userauth_password(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), __pyx_v_username, __pyx_v_password); @@ -4835,31 +4845,31 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_30userauth_password(struct __p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("userauth_password", 0); - /* "ssh2/session.pyx":281 + /* "ssh2/session.pyx":296 * :type password: str""" * cdef int rc * cdef bytes b_username = to_bytes(username) # <<<<<<<<<<<<<< * cdef bytes b_password = to_bytes(password) * cdef const char *_username = b_username */ - __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_username); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 281, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_username); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 296, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_b_username = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/session.pyx":282 + /* "ssh2/session.pyx":297 * cdef int rc * cdef bytes b_username = to_bytes(username) * cdef bytes b_password = to_bytes(password) # <<<<<<<<<<<<<< * cdef const char *_username = b_username * cdef const char *_password = b_password */ - __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_password); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 282, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_password); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 297, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_b_password = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/session.pyx":283 + /* "ssh2/session.pyx":298 * cdef bytes b_username = to_bytes(username) * cdef bytes b_password = to_bytes(password) * cdef const char *_username = b_username # <<<<<<<<<<<<<< @@ -4868,12 +4878,12 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_30userauth_password(struct __p */ if (unlikely(__pyx_v_b_username == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 283, __pyx_L1_error) + __PYX_ERR(0, 298, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyBytes_AsString(__pyx_v_b_username); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 283, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_AsString(__pyx_v_b_username); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 298, __pyx_L1_error) __pyx_v__username = __pyx_t_2; - /* "ssh2/session.pyx":284 + /* "ssh2/session.pyx":299 * cdef bytes b_password = to_bytes(password) * cdef const char *_username = b_username * cdef const char *_password = b_password # <<<<<<<<<<<<<< @@ -4882,12 +4892,12 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_30userauth_password(struct __p */ if (unlikely(__pyx_v_b_password == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 284, __pyx_L1_error) + __PYX_ERR(0, 299, __pyx_L1_error) } - __pyx_t_3 = __Pyx_PyBytes_AsString(__pyx_v_b_password); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) __PYX_ERR(0, 284, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyBytes_AsString(__pyx_v_b_password); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) __PYX_ERR(0, 299, __pyx_L1_error) __pyx_v__password = __pyx_t_3; - /* "ssh2/session.pyx":285 + /* "ssh2/session.pyx":300 * cdef const char *_username = b_username * cdef const char *_password = b_password * with nogil: # <<<<<<<<<<<<<< @@ -4902,7 +4912,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_30userauth_password(struct __p #endif /*try:*/ { - /* "ssh2/session.pyx":286 + /* "ssh2/session.pyx":301 * cdef const char *_password = b_password * with nogil: * rc = c_ssh2.libssh2_userauth_password( # <<<<<<<<<<<<<< @@ -4912,7 +4922,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_30userauth_password(struct __p __pyx_v_rc = libssh2_userauth_password(__pyx_v_self->_session, __pyx_v__username, __pyx_v__password); } - /* "ssh2/session.pyx":285 + /* "ssh2/session.pyx":300 * cdef const char *_username = b_username * cdef const char *_password = b_password * with nogil: # <<<<<<<<<<<<<< @@ -4931,7 +4941,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_30userauth_password(struct __p } } - /* "ssh2/session.pyx":288 + /* "ssh2/session.pyx":303 * rc = c_ssh2.libssh2_userauth_password( * self._session, _username, _password) * return handle_error_codes(rc) # <<<<<<<<<<<<<< @@ -4939,14 +4949,14 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_30userauth_password(struct __p * def userauth_keyboardinteractive(self, username not None, */ __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, 288, __pyx_L1_error) - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 288, __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, 303, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":273 + /* "ssh2/session.pyx":288 * return handle_error_codes(rc) * * def userauth_password(self, username not None, password not None): # <<<<<<<<<<<<<< @@ -4967,7 +4977,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_30userauth_password(struct __p return __pyx_r; } -/* "ssh2/session.pyx":290 +/* "ssh2/session.pyx":305 * return handle_error_codes(rc) * * def userauth_keyboardinteractive(self, username not None, # <<<<<<<<<<<<<< @@ -5010,11 +5020,11 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_33userauth_keyboardinteractive case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_password)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("userauth_keyboardinteractive", 1, 2, 2, 1); __PYX_ERR(0, 290, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("userauth_keyboardinteractive", 1, 2, 2, 1); __PYX_ERR(0, 305, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "userauth_keyboardinteractive") < 0)) __PYX_ERR(0, 290, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "userauth_keyboardinteractive") < 0)) __PYX_ERR(0, 305, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -5027,17 +5037,17 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_33userauth_keyboardinteractive } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("userauth_keyboardinteractive", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 290, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("userauth_keyboardinteractive", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 305, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.session.Session.userauth_keyboardinteractive", __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, 290, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "username"); __PYX_ERR(0, 305, __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, 291, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "password"); __PYX_ERR(0, 306, __pyx_L1_error) } __pyx_r = __pyx_pf_4ssh2_7session_7Session_32userauth_keyboardinteractive(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), __pyx_v_username, __pyx_v_password); @@ -5050,7 +5060,7 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_33userauth_keyboardinteractive return __pyx_r; } -/* "ssh2/session.pyx":303 +/* "ssh2/session.pyx":318 * cdef const char *_username = b_username * * def passwd(): # <<<<<<<<<<<<<< @@ -5084,7 +5094,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_28userauth_keyboardinteractive __pyx_outer_scope = (struct __pyx_obj_4ssh2_7session___pyx_scope_struct__userauth_keyboardinteractive *) __Pyx_CyFunction_GetClosure(__pyx_self); __pyx_cur_scope = __pyx_outer_scope; - /* "ssh2/session.pyx":304 + /* "ssh2/session.pyx":319 * * def passwd(): * return password # <<<<<<<<<<<<<< @@ -5092,12 +5102,12 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_28userauth_keyboardinteractive * self._kbd_callback = passwd */ __Pyx_XDECREF(__pyx_r); - if (unlikely(!__pyx_cur_scope->__pyx_v_password)) { __Pyx_RaiseClosureNameError("password"); __PYX_ERR(0, 304, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_v_password)) { __Pyx_RaiseClosureNameError("password"); __PYX_ERR(0, 319, __pyx_L1_error) } __Pyx_INCREF(__pyx_cur_scope->__pyx_v_password); __pyx_r = __pyx_cur_scope->__pyx_v_password; goto __pyx_L0; - /* "ssh2/session.pyx":303 + /* "ssh2/session.pyx":318 * cdef const char *_username = b_username * * def passwd(): # <<<<<<<<<<<<<< @@ -5115,7 +5125,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_28userauth_keyboardinteractive return __pyx_r; } -/* "ssh2/session.pyx":290 +/* "ssh2/session.pyx":305 * return handle_error_codes(rc) * * def userauth_keyboardinteractive(self, username not None, # <<<<<<<<<<<<<< @@ -5142,7 +5152,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_32userauth_keyboardinteractive if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_4ssh2_7session___pyx_scope_struct__userauth_keyboardinteractive *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 290, __pyx_L1_error) + __PYX_ERR(0, 305, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } @@ -5150,19 +5160,19 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_32userauth_keyboardinteractive __Pyx_INCREF(__pyx_cur_scope->__pyx_v_password); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_password); - /* "ssh2/session.pyx":300 + /* "ssh2/session.pyx":315 * """ * cdef int rc * cdef bytes b_username = to_bytes(username) # <<<<<<<<<<<<<< * cdef const char *_username = b_username * */ - __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_username); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 300, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_username); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 315, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_b_username = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/session.pyx":301 + /* "ssh2/session.pyx":316 * cdef int rc * cdef bytes b_username = to_bytes(username) * cdef const char *_username = b_username # <<<<<<<<<<<<<< @@ -5171,24 +5181,24 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_32userauth_keyboardinteractive */ if (unlikely(__pyx_v_b_username == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 301, __pyx_L1_error) + __PYX_ERR(0, 316, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyBytes_AsString(__pyx_v_b_username); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 301, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_AsString(__pyx_v_b_username); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 316, __pyx_L1_error) __pyx_v__username = __pyx_t_2; - /* "ssh2/session.pyx":303 + /* "ssh2/session.pyx":318 * cdef const char *_username = b_username * * def passwd(): # <<<<<<<<<<<<<< * return password * */ - __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4ssh2_7session_7Session_28userauth_keyboardinteractive_1passwd, 0, __pyx_n_s_userauth_keyboardinteractive_loc, ((PyObject*)__pyx_cur_scope), __pyx_n_s_ssh2_session, __pyx_d, ((PyObject *)__pyx_codeobj__3)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 303, __pyx_L1_error) + __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4ssh2_7session_7Session_28userauth_keyboardinteractive_1passwd, 0, __pyx_n_s_userauth_keyboardinteractive_loc, ((PyObject*)__pyx_cur_scope), __pyx_n_s_ssh2_session, __pyx_d, ((PyObject *)__pyx_codeobj__3)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_passwd = __pyx_t_1; __pyx_t_1 = 0; - /* "ssh2/session.pyx":306 + /* "ssh2/session.pyx":321 * return password * * self._kbd_callback = passwd # <<<<<<<<<<<<<< @@ -5201,7 +5211,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_32userauth_keyboardinteractive __Pyx_DECREF(__pyx_v_self->_kbd_callback); __pyx_v_self->_kbd_callback = __pyx_v_passwd; - /* "ssh2/session.pyx":307 + /* "ssh2/session.pyx":322 * * self._kbd_callback = passwd * rc = c_ssh2.libssh2_userauth_keyboard_interactive( # <<<<<<<<<<<<<< @@ -5210,7 +5220,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_32userauth_keyboardinteractive */ __pyx_v_rc = libssh2_userauth_keyboard_interactive(__pyx_v_self->_session, __pyx_v__username, (&__pyx_f_4ssh2_7session_kbd_callback)); - /* "ssh2/session.pyx":309 + /* "ssh2/session.pyx":324 * rc = c_ssh2.libssh2_userauth_keyboard_interactive( * self._session, _username, &kbd_callback) * self._kbd_callback = None # <<<<<<<<<<<<<< @@ -5223,7 +5233,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_32userauth_keyboardinteractive __Pyx_DECREF(__pyx_v_self->_kbd_callback); __pyx_v_self->_kbd_callback = Py_None; - /* "ssh2/session.pyx":310 + /* "ssh2/session.pyx":325 * self._session, _username, &kbd_callback) * self._kbd_callback = None * return handle_error_codes(rc) # <<<<<<<<<<<<<< @@ -5231,14 +5241,14 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_32userauth_keyboardinteractive * def agent_init(self): */ __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, 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_t_3 = __pyx_f_4ssh2_5utils_handle_error_codes(__pyx_v_rc, 0); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 325, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_t_3); 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/session.pyx":290 + /* "ssh2/session.pyx":305 * return handle_error_codes(rc) * * def userauth_keyboardinteractive(self, username not None, # <<<<<<<<<<<<<< @@ -5260,7 +5270,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_32userauth_keyboardinteractive return __pyx_r; } -/* "ssh2/session.pyx":312 +/* "ssh2/session.pyx":327 * return handle_error_codes(rc) * * def agent_init(self): # <<<<<<<<<<<<<< @@ -5293,7 +5303,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_34agent_init(struct __pyx_obj_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("agent_init", 0); - /* "ssh2/session.pyx":318 + /* "ssh2/session.pyx":333 * """ * cdef c_ssh2.LIBSSH2_AGENT *agent * with nogil: # <<<<<<<<<<<<<< @@ -5308,18 +5318,18 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_34agent_init(struct __pyx_obj_ #endif /*try:*/ { - /* "ssh2/session.pyx":319 + /* "ssh2/session.pyx":334 * cdef c_ssh2.LIBSSH2_AGENT *agent * with nogil: * agent = agent_init(self._session) # <<<<<<<<<<<<<< * return PyAgent(agent, self) * */ - __pyx_t_1 = __pyx_f_4ssh2_5agent_agent_init(__pyx_v_self->_session); if (unlikely(__pyx_t_1 == ((LIBSSH2_AGENT *)NULL))) __PYX_ERR(0, 319, __pyx_L4_error) + __pyx_t_1 = __pyx_f_4ssh2_5agent_agent_init(__pyx_v_self->_session); if (unlikely(__pyx_t_1 == ((LIBSSH2_AGENT *)NULL))) __PYX_ERR(0, 334, __pyx_L4_error) __pyx_v_agent = __pyx_t_1; } - /* "ssh2/session.pyx":318 + /* "ssh2/session.pyx":333 * """ * cdef c_ssh2.LIBSSH2_AGENT *agent * with nogil: # <<<<<<<<<<<<<< @@ -5345,7 +5355,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_34agent_init(struct __pyx_obj_ } } - /* "ssh2/session.pyx":320 + /* "ssh2/session.pyx":335 * with nogil: * agent = agent_init(self._session) * return PyAgent(agent, self) # <<<<<<<<<<<<<< @@ -5353,13 +5363,13 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_34agent_init(struct __pyx_obj_ * def agent_auth(self, username not None): */ __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, 320, __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, 335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":312 + /* "ssh2/session.pyx":327 * return handle_error_codes(rc) * * def agent_init(self): # <<<<<<<<<<<<<< @@ -5378,7 +5388,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_34agent_init(struct __pyx_obj_ return __pyx_r; } -/* "ssh2/session.pyx":322 +/* "ssh2/session.pyx":337 * return PyAgent(agent, self) * * def agent_auth(self, username not None): # <<<<<<<<<<<<<< @@ -5397,7 +5407,7 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_37agent_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, 322, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "username"); __PYX_ERR(0, 337, __pyx_L1_error) } __pyx_r = __pyx_pf_4ssh2_7session_7Session_36agent_auth(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), ((PyObject *)__pyx_v_username)); @@ -5427,19 +5437,19 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_36agent_auth(struct __pyx_obj_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("agent_auth", 0); - /* "ssh2/session.pyx":348 + /* "ssh2/session.pyx":363 * * :rtype: None""" * cdef bytes b_username = to_bytes(username) # <<<<<<<<<<<<<< * cdef char *_username = b_username * cdef c_ssh2.LIBSSH2_AGENT *agent = NULL */ - __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_username); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 348, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_username); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_b_username = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/session.pyx":349 + /* "ssh2/session.pyx":364 * :rtype: None""" * cdef bytes b_username = to_bytes(username) * cdef char *_username = b_username # <<<<<<<<<<<<<< @@ -5448,12 +5458,12 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_36agent_auth(struct __pyx_obj_ */ if (unlikely(__pyx_v_b_username == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 349, __pyx_L1_error) + __PYX_ERR(0, 364, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_username); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 349, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_username); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 364, __pyx_L1_error) __pyx_v__username = __pyx_t_2; - /* "ssh2/session.pyx":350 + /* "ssh2/session.pyx":365 * cdef bytes b_username = to_bytes(username) * cdef char *_username = b_username * cdef c_ssh2.LIBSSH2_AGENT *agent = NULL # <<<<<<<<<<<<<< @@ -5462,7 +5472,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_36agent_auth(struct __pyx_obj_ */ __pyx_v_agent = NULL; - /* "ssh2/session.pyx":351 + /* "ssh2/session.pyx":366 * cdef char *_username = b_username * cdef c_ssh2.LIBSSH2_AGENT *agent = NULL * cdef c_ssh2.libssh2_agent_publickey *identity = NULL # <<<<<<<<<<<<<< @@ -5471,7 +5481,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_36agent_auth(struct __pyx_obj_ */ __pyx_v_identity = NULL; - /* "ssh2/session.pyx":352 + /* "ssh2/session.pyx":367 * cdef c_ssh2.LIBSSH2_AGENT *agent = NULL * cdef c_ssh2.libssh2_agent_publickey *identity = NULL * cdef c_ssh2.libssh2_agent_publickey *prev = NULL # <<<<<<<<<<<<<< @@ -5480,17 +5490,17 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_36agent_auth(struct __pyx_obj_ */ __pyx_v_prev = NULL; - /* "ssh2/session.pyx":353 + /* "ssh2/session.pyx":368 * cdef c_ssh2.libssh2_agent_publickey *identity = NULL * cdef c_ssh2.libssh2_agent_publickey *prev = NULL * agent = init_connect_agent(self._session) # <<<<<<<<<<<<<< * with nogil: * agent_auth(_username, agent) */ - __pyx_t_3 = __pyx_f_4ssh2_5agent_init_connect_agent(__pyx_v_self->_session); if (unlikely(__pyx_t_3 == ((LIBSSH2_AGENT *)NULL))) __PYX_ERR(0, 353, __pyx_L1_error) + __pyx_t_3 = __pyx_f_4ssh2_5agent_init_connect_agent(__pyx_v_self->_session); if (unlikely(__pyx_t_3 == ((LIBSSH2_AGENT *)NULL))) __PYX_ERR(0, 368, __pyx_L1_error) __pyx_v_agent = __pyx_t_3; - /* "ssh2/session.pyx":354 + /* "ssh2/session.pyx":369 * cdef c_ssh2.libssh2_agent_publickey *prev = NULL * agent = init_connect_agent(self._session) * with nogil: # <<<<<<<<<<<<<< @@ -5505,17 +5515,17 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_36agent_auth(struct __pyx_obj_ #endif /*try:*/ { - /* "ssh2/session.pyx":355 + /* "ssh2/session.pyx":370 * agent = init_connect_agent(self._session) * with nogil: * agent_auth(_username, agent) # <<<<<<<<<<<<<< * * def open_session(self): */ - __pyx_t_4 = __pyx_f_4ssh2_5agent_agent_auth(__pyx_v__username, __pyx_v_agent); if (unlikely(__pyx_t_4 == ((int)1))) __PYX_ERR(0, 355, __pyx_L4_error) + __pyx_t_4 = __pyx_f_4ssh2_5agent_agent_auth(__pyx_v__username, __pyx_v_agent); if (unlikely(__pyx_t_4 == ((int)1))) __PYX_ERR(0, 370, __pyx_L4_error) } - /* "ssh2/session.pyx":354 + /* "ssh2/session.pyx":369 * cdef c_ssh2.libssh2_agent_publickey *prev = NULL * agent = init_connect_agent(self._session) * with nogil: # <<<<<<<<<<<<<< @@ -5541,7 +5551,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_36agent_auth(struct __pyx_obj_ } } - /* "ssh2/session.pyx":322 + /* "ssh2/session.pyx":337 * return PyAgent(agent, self) * * def agent_auth(self, username not None): # <<<<<<<<<<<<<< @@ -5563,7 +5573,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_36agent_auth(struct __pyx_obj_ return __pyx_r; } -/* "ssh2/session.pyx":357 +/* "ssh2/session.pyx":372 * agent_auth(_username, agent) * * def open_session(self): # <<<<<<<<<<<<<< @@ -5597,7 +5607,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_38open_session(struct __pyx_ob int __pyx_clineno = 0; __Pyx_RefNannySetupContext("open_session", 0); - /* "ssh2/session.pyx":363 + /* "ssh2/session.pyx":378 * """ * cdef c_ssh2.LIBSSH2_CHANNEL *channel * with nogil: # <<<<<<<<<<<<<< @@ -5612,7 +5622,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_38open_session(struct __pyx_ob #endif /*try:*/ { - /* "ssh2/session.pyx":364 + /* "ssh2/session.pyx":379 * cdef c_ssh2.LIBSSH2_CHANNEL *channel * with nogil: * channel = c_ssh2.libssh2_channel_open_session( # <<<<<<<<<<<<<< @@ -5622,7 +5632,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_38open_session(struct __pyx_ob __pyx_v_channel = libssh2_channel_open_session(__pyx_v_self->_session); } - /* "ssh2/session.pyx":363 + /* "ssh2/session.pyx":378 * """ * cdef c_ssh2.LIBSSH2_CHANNEL *channel * with nogil: # <<<<<<<<<<<<<< @@ -5641,7 +5651,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_38open_session(struct __pyx_ob } } - /* "ssh2/session.pyx":366 + /* "ssh2/session.pyx":381 * channel = c_ssh2.libssh2_channel_open_session( * self._session) * if channel is NULL: # <<<<<<<<<<<<<< @@ -5651,7 +5661,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_38open_session(struct __pyx_ob __pyx_t_1 = ((__pyx_v_channel == NULL) != 0); if (__pyx_t_1) { - /* "ssh2/session.pyx":367 + /* "ssh2/session.pyx":382 * self._session) * if channel is NULL: * return handle_error_codes(c_ssh2.libssh2_session_last_errno( # <<<<<<<<<<<<<< @@ -5660,29 +5670,29 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_38open_session(struct __pyx_ob */ __Pyx_XDECREF(__pyx_r); - /* "ssh2/session.pyx":368 + /* "ssh2/session.pyx":383 * if channel is NULL: * return handle_error_codes(c_ssh2.libssh2_session_last_errno( * self._session)) # <<<<<<<<<<<<<< * return PyChannel(channel, self) * */ - __pyx_t_2 = __pyx_f_4ssh2_5utils_handle_error_codes(libssh2_session_last_errno(__pyx_v_self->_session), 0); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 367, __pyx_L1_error) + __pyx_t_2 = __pyx_f_4ssh2_5utils_handle_error_codes(libssh2_session_last_errno(__pyx_v_self->_session), 0); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 382, __pyx_L1_error) - /* "ssh2/session.pyx":367 + /* "ssh2/session.pyx":382 * self._session) * if channel is NULL: * return handle_error_codes(c_ssh2.libssh2_session_last_errno( # <<<<<<<<<<<<<< * self._session)) * return PyChannel(channel, self) */ - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 367, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 382, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":366 + /* "ssh2/session.pyx":381 * channel = c_ssh2.libssh2_channel_open_session( * self._session) * if channel is NULL: # <<<<<<<<<<<<<< @@ -5691,7 +5701,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_38open_session(struct __pyx_ob */ } - /* "ssh2/session.pyx":369 + /* "ssh2/session.pyx":384 * return handle_error_codes(c_ssh2.libssh2_session_last_errno( * self._session)) * return PyChannel(channel, self) # <<<<<<<<<<<<<< @@ -5699,13 +5709,13 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_38open_session(struct __pyx_ob * def direct_tcpip_ex(self, host not None, int port, */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __pyx_f_4ssh2_7channel_PyChannel(__pyx_v_channel, __pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 369, __pyx_L1_error) + __pyx_t_3 = __pyx_f_4ssh2_7channel_PyChannel(__pyx_v_channel, __pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 384, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":357 + /* "ssh2/session.pyx":372 * agent_auth(_username, agent) * * def open_session(self): # <<<<<<<<<<<<<< @@ -5724,7 +5734,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_38open_session(struct __pyx_ob return __pyx_r; } -/* "ssh2/session.pyx":371 +/* "ssh2/session.pyx":386 * return PyChannel(channel, self) * * def direct_tcpip_ex(self, host not None, int port, # <<<<<<<<<<<<<< @@ -5773,23 +5783,23 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_41direct_tcpip_ex(PyObject *__ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_port)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("direct_tcpip_ex", 1, 4, 4, 1); __PYX_ERR(0, 371, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("direct_tcpip_ex", 1, 4, 4, 1); __PYX_ERR(0, 386, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shost)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("direct_tcpip_ex", 1, 4, 4, 2); __PYX_ERR(0, 371, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("direct_tcpip_ex", 1, 4, 4, 2); __PYX_ERR(0, 386, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sport)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("direct_tcpip_ex", 1, 4, 4, 3); __PYX_ERR(0, 371, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("direct_tcpip_ex", 1, 4, 4, 3); __PYX_ERR(0, 386, __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, 371, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "direct_tcpip_ex") < 0)) __PYX_ERR(0, 386, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; @@ -5800,23 +5810,23 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_41direct_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, 371, __pyx_L3_error) + __pyx_v_port = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_port == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 386, __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, 372, __pyx_L3_error) + __pyx_v_sport = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_sport == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 387, __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, 371, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("direct_tcpip_ex", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 386, __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, 371, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "host"); __PYX_ERR(0, 386, __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, 372, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "shost"); __PYX_ERR(0, 387, __pyx_L1_error) } __pyx_r = __pyx_pf_4ssh2_7session_7Session_40direct_tcpip_ex(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), __pyx_v_host, __pyx_v_port, __pyx_v_shost, __pyx_v_sport); @@ -5846,31 +5856,31 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_40direct_tcpip_ex(struct __pyx int __pyx_clineno = 0; __Pyx_RefNannySetupContext("direct_tcpip_ex", 0); - /* "ssh2/session.pyx":374 + /* "ssh2/session.pyx":389 * shost not None, int sport): * cdef c_ssh2.LIBSSH2_CHANNEL *channel * cdef bytes b_host = to_bytes(host) # <<<<<<<<<<<<<< * cdef bytes b_shost = to_bytes(shost) * cdef char *_host = b_host */ - __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_host); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 374, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_host); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_b_host = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/session.pyx":375 + /* "ssh2/session.pyx":390 * cdef c_ssh2.LIBSSH2_CHANNEL *channel * cdef bytes b_host = to_bytes(host) * cdef bytes b_shost = to_bytes(shost) # <<<<<<<<<<<<<< * cdef char *_host = b_host * cdef char *_shost = b_shost */ - __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_shost); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 375, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_shost); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 390, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_b_shost = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/session.pyx":376 + /* "ssh2/session.pyx":391 * cdef bytes b_host = to_bytes(host) * cdef bytes b_shost = to_bytes(shost) * cdef char *_host = b_host # <<<<<<<<<<<<<< @@ -5879,12 +5889,12 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_40direct_tcpip_ex(struct __pyx */ if (unlikely(__pyx_v_b_host == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 376, __pyx_L1_error) + __PYX_ERR(0, 391, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_host); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 376, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_host); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 391, __pyx_L1_error) __pyx_v__host = __pyx_t_2; - /* "ssh2/session.pyx":377 + /* "ssh2/session.pyx":392 * cdef bytes b_shost = to_bytes(shost) * cdef char *_host = b_host * cdef char *_shost = b_shost # <<<<<<<<<<<<<< @@ -5893,12 +5903,12 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_40direct_tcpip_ex(struct __pyx */ if (unlikely(__pyx_v_b_shost == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 377, __pyx_L1_error) + __PYX_ERR(0, 392, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_shost); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 377, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_shost); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 392, __pyx_L1_error) __pyx_v__shost = __pyx_t_2; - /* "ssh2/session.pyx":378 + /* "ssh2/session.pyx":393 * cdef char *_host = b_host * cdef char *_shost = b_shost * with nogil: # <<<<<<<<<<<<<< @@ -5913,7 +5923,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_40direct_tcpip_ex(struct __pyx #endif /*try:*/ { - /* "ssh2/session.pyx":379 + /* "ssh2/session.pyx":394 * cdef char *_shost = b_shost * with nogil: * channel = c_ssh2.libssh2_channel_direct_tcpip_ex( # <<<<<<<<<<<<<< @@ -5923,7 +5933,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_40direct_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":378 + /* "ssh2/session.pyx":393 * cdef char *_host = b_host * cdef char *_shost = b_shost * with nogil: # <<<<<<<<<<<<<< @@ -5942,7 +5952,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_40direct_tcpip_ex(struct __pyx } } - /* "ssh2/session.pyx":381 + /* "ssh2/session.pyx":396 * channel = c_ssh2.libssh2_channel_direct_tcpip_ex( * self._session, _host, port, _shost, sport) * if channel is NULL: # <<<<<<<<<<<<<< @@ -5952,7 +5962,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_40direct_tcpip_ex(struct __pyx __pyx_t_3 = ((__pyx_v_channel == NULL) != 0); if (__pyx_t_3) { - /* "ssh2/session.pyx":382 + /* "ssh2/session.pyx":397 * self._session, _host, port, _shost, sport) * if channel is NULL: * return handle_error_codes(c_ssh2.libssh2_session_last_errno( # <<<<<<<<<<<<<< @@ -5961,29 +5971,29 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_40direct_tcpip_ex(struct __pyx */ __Pyx_XDECREF(__pyx_r); - /* "ssh2/session.pyx":383 + /* "ssh2/session.pyx":398 * if channel is NULL: * return handle_error_codes(c_ssh2.libssh2_session_last_errno( * self._session)) # <<<<<<<<<<<<<< * return PyChannel(channel, self) * */ - __pyx_t_4 = __pyx_f_4ssh2_5utils_handle_error_codes(libssh2_session_last_errno(__pyx_v_self->_session), 0); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 382, __pyx_L1_error) + __pyx_t_4 = __pyx_f_4ssh2_5utils_handle_error_codes(libssh2_session_last_errno(__pyx_v_self->_session), 0); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 397, __pyx_L1_error) - /* "ssh2/session.pyx":382 + /* "ssh2/session.pyx":397 * self._session, _host, port, _shost, sport) * if channel is NULL: * return handle_error_codes(c_ssh2.libssh2_session_last_errno( # <<<<<<<<<<<<<< * self._session)) * return PyChannel(channel, self) */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 382, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 397, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":381 + /* "ssh2/session.pyx":396 * channel = c_ssh2.libssh2_channel_direct_tcpip_ex( * self._session, _host, port, _shost, sport) * if channel is NULL: # <<<<<<<<<<<<<< @@ -5992,7 +6002,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_40direct_tcpip_ex(struct __pyx */ } - /* "ssh2/session.pyx":384 + /* "ssh2/session.pyx":399 * return handle_error_codes(c_ssh2.libssh2_session_last_errno( * self._session)) * return PyChannel(channel, self) # <<<<<<<<<<<<<< @@ -6000,13 +6010,13 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_40direct_tcpip_ex(struct __pyx * def direct_tcpip(self, host not None, int port): */ __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, 384, __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, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":371 + /* "ssh2/session.pyx":386 * return PyChannel(channel, self) * * def direct_tcpip_ex(self, host not None, int port, # <<<<<<<<<<<<<< @@ -6027,7 +6037,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_40direct_tcpip_ex(struct __pyx return __pyx_r; } -/* "ssh2/session.pyx":386 +/* "ssh2/session.pyx":401 * return PyChannel(channel, self) * * def direct_tcpip(self, host not None, int port): # <<<<<<<<<<<<<< @@ -6070,11 +6080,11 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_43direct_tcpip(PyObject *__pyx case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_port)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("direct_tcpip", 1, 2, 2, 1); __PYX_ERR(0, 386, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("direct_tcpip", 1, 2, 2, 1); __PYX_ERR(0, 401, __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, 386, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "direct_tcpip") < 0)) __PYX_ERR(0, 401, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -6083,18 +6093,18 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_43direct_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, 386, __pyx_L3_error) + __pyx_v_port = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_port == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 401, __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, 386, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("direct_tcpip", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 401, __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, 386, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "host"); __PYX_ERR(0, 401, __pyx_L1_error) } __pyx_r = __pyx_pf_4ssh2_7session_7Session_42direct_tcpip(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), __pyx_v_host, __pyx_v_port); @@ -6122,19 +6132,19 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_42direct_tcpip(struct __pyx_ob int __pyx_clineno = 0; __Pyx_RefNannySetupContext("direct_tcpip", 0); - /* "ssh2/session.pyx":393 + /* "ssh2/session.pyx":408 * """ * cdef c_ssh2.LIBSSH2_CHANNEL *channel * cdef bytes b_host = to_bytes(host) # <<<<<<<<<<<<<< * cdef char *_host = b_host * with nogil: */ - __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_host); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 393, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_host); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 408, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_b_host = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/session.pyx":394 + /* "ssh2/session.pyx":409 * cdef c_ssh2.LIBSSH2_CHANNEL *channel * cdef bytes b_host = to_bytes(host) * cdef char *_host = b_host # <<<<<<<<<<<<<< @@ -6143,12 +6153,12 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_42direct_tcpip(struct __pyx_ob */ if (unlikely(__pyx_v_b_host == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 394, __pyx_L1_error) + __PYX_ERR(0, 409, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_host); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 394, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_host); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 409, __pyx_L1_error) __pyx_v__host = __pyx_t_2; - /* "ssh2/session.pyx":395 + /* "ssh2/session.pyx":410 * cdef bytes b_host = to_bytes(host) * cdef char *_host = b_host * with nogil: # <<<<<<<<<<<<<< @@ -6163,7 +6173,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_42direct_tcpip(struct __pyx_ob #endif /*try:*/ { - /* "ssh2/session.pyx":396 + /* "ssh2/session.pyx":411 * cdef char *_host = b_host * with nogil: * channel = c_ssh2.libssh2_channel_direct_tcpip( # <<<<<<<<<<<<<< @@ -6173,7 +6183,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_42direct_tcpip(struct __pyx_ob __pyx_v_channel = libssh2_channel_direct_tcpip(__pyx_v_self->_session, __pyx_v__host, __pyx_v_port); } - /* "ssh2/session.pyx":395 + /* "ssh2/session.pyx":410 * cdef bytes b_host = to_bytes(host) * cdef char *_host = b_host * with nogil: # <<<<<<<<<<<<<< @@ -6192,7 +6202,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_42direct_tcpip(struct __pyx_ob } } - /* "ssh2/session.pyx":398 + /* "ssh2/session.pyx":413 * channel = c_ssh2.libssh2_channel_direct_tcpip( * self._session, _host, port) * if channel is NULL: # <<<<<<<<<<<<<< @@ -6202,7 +6212,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_42direct_tcpip(struct __pyx_ob __pyx_t_3 = ((__pyx_v_channel == NULL) != 0); if (__pyx_t_3) { - /* "ssh2/session.pyx":399 + /* "ssh2/session.pyx":414 * self._session, _host, port) * if channel is NULL: * return handle_error_codes(c_ssh2.libssh2_session_last_errno( # <<<<<<<<<<<<<< @@ -6211,29 +6221,29 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_42direct_tcpip(struct __pyx_ob */ __Pyx_XDECREF(__pyx_r); - /* "ssh2/session.pyx":400 + /* "ssh2/session.pyx":415 * if channel is NULL: * return handle_error_codes(c_ssh2.libssh2_session_last_errno( * self._session)) # <<<<<<<<<<<<<< * return PyChannel(channel, self) * */ - __pyx_t_4 = __pyx_f_4ssh2_5utils_handle_error_codes(libssh2_session_last_errno(__pyx_v_self->_session), 0); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 399, __pyx_L1_error) + __pyx_t_4 = __pyx_f_4ssh2_5utils_handle_error_codes(libssh2_session_last_errno(__pyx_v_self->_session), 0); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 414, __pyx_L1_error) - /* "ssh2/session.pyx":399 + /* "ssh2/session.pyx":414 * self._session, _host, port) * if channel is NULL: * return handle_error_codes(c_ssh2.libssh2_session_last_errno( # <<<<<<<<<<<<<< * self._session)) * return PyChannel(channel, self) */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 399, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":398 + /* "ssh2/session.pyx":413 * channel = c_ssh2.libssh2_channel_direct_tcpip( * self._session, _host, port) * if channel is NULL: # <<<<<<<<<<<<<< @@ -6242,7 +6252,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_42direct_tcpip(struct __pyx_ob */ } - /* "ssh2/session.pyx":401 + /* "ssh2/session.pyx":416 * return handle_error_codes(c_ssh2.libssh2_session_last_errno( * self._session)) * return PyChannel(channel, self) # <<<<<<<<<<<<<< @@ -6250,13 +6260,13 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_42direct_tcpip(struct __pyx_ob * def block_directions(self): */ __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, 401, __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, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":386 + /* "ssh2/session.pyx":401 * return PyChannel(channel, self) * * def direct_tcpip(self, host not None, int port): # <<<<<<<<<<<<<< @@ -6276,7 +6286,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_42direct_tcpip(struct __pyx_ob return __pyx_r; } -/* "ssh2/session.pyx":403 +/* "ssh2/session.pyx":418 * return PyChannel(channel, self) * * def block_directions(self): # <<<<<<<<<<<<<< @@ -6308,7 +6318,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_44block_directions(struct __py int __pyx_clineno = 0; __Pyx_RefNannySetupContext("block_directions", 0); - /* "ssh2/session.pyx":425 + /* "ssh2/session.pyx":440 * :rtype: int""" * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -6323,7 +6333,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_44block_directions(struct __py #endif /*try:*/ { - /* "ssh2/session.pyx":426 + /* "ssh2/session.pyx":441 * cdef int rc * with nogil: * rc = c_ssh2.libssh2_session_block_directions( # <<<<<<<<<<<<<< @@ -6333,7 +6343,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_44block_directions(struct __py __pyx_v_rc = libssh2_session_block_directions(__pyx_v_self->_session); } - /* "ssh2/session.pyx":425 + /* "ssh2/session.pyx":440 * :rtype: int""" * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -6352,7 +6362,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_44block_directions(struct __py } } - /* "ssh2/session.pyx":428 + /* "ssh2/session.pyx":443 * rc = c_ssh2.libssh2_session_block_directions( * self._session) * return rc # <<<<<<<<<<<<<< @@ -6360,13 +6370,13 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_44block_directions(struct __py * 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, 428, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 443, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":403 + /* "ssh2/session.pyx":418 * return PyChannel(channel, self) * * def block_directions(self): # <<<<<<<<<<<<<< @@ -6385,7 +6395,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_44block_directions(struct __py return __pyx_r; } -/* "ssh2/session.pyx":430 +/* "ssh2/session.pyx":445 * return rc * * def forward_listen(self, int port): # <<<<<<<<<<<<<< @@ -6405,7 +6415,7 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_47forward_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, 430, __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, 445, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -6432,7 +6442,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_46forward_listen(struct __pyx_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("forward_listen", 0); - /* "ssh2/session.pyx":438 + /* "ssh2/session.pyx":453 * :rtype: :py:class:`ssh2.listener.Listener` or None""" * cdef c_ssh2.LIBSSH2_LISTENER *listener * with nogil: # <<<<<<<<<<<<<< @@ -6447,7 +6457,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_46forward_listen(struct __pyx_ #endif /*try:*/ { - /* "ssh2/session.pyx":439 + /* "ssh2/session.pyx":454 * cdef c_ssh2.LIBSSH2_LISTENER *listener * with nogil: * listener = c_ssh2.libssh2_channel_forward_listen( # <<<<<<<<<<<<<< @@ -6457,7 +6467,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_46forward_listen(struct __pyx_ __pyx_v_listener = libssh2_channel_forward_listen(__pyx_v_self->_session, __pyx_v_port); } - /* "ssh2/session.pyx":438 + /* "ssh2/session.pyx":453 * :rtype: :py:class:`ssh2.listener.Listener` or None""" * cdef c_ssh2.LIBSSH2_LISTENER *listener * with nogil: # <<<<<<<<<<<<<< @@ -6476,7 +6486,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_46forward_listen(struct __pyx_ } } - /* "ssh2/session.pyx":441 + /* "ssh2/session.pyx":456 * listener = c_ssh2.libssh2_channel_forward_listen( * self._session, port) * if listener is NULL: # <<<<<<<<<<<<<< @@ -6486,7 +6496,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_46forward_listen(struct __pyx_ __pyx_t_1 = ((__pyx_v_listener == NULL) != 0); if (__pyx_t_1) { - /* "ssh2/session.pyx":442 + /* "ssh2/session.pyx":457 * self._session, port) * if listener is NULL: * return handle_error_codes(c_ssh2.libssh2_session_last_errno( # <<<<<<<<<<<<<< @@ -6495,29 +6505,29 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_46forward_listen(struct __pyx_ */ __Pyx_XDECREF(__pyx_r); - /* "ssh2/session.pyx":443 + /* "ssh2/session.pyx":458 * if listener is NULL: * return handle_error_codes(c_ssh2.libssh2_session_last_errno( * self._session)) # <<<<<<<<<<<<<< * return PyListener(listener, self) * */ - __pyx_t_2 = __pyx_f_4ssh2_5utils_handle_error_codes(libssh2_session_last_errno(__pyx_v_self->_session), 0); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 442, __pyx_L1_error) + __pyx_t_2 = __pyx_f_4ssh2_5utils_handle_error_codes(libssh2_session_last_errno(__pyx_v_self->_session), 0); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 457, __pyx_L1_error) - /* "ssh2/session.pyx":442 + /* "ssh2/session.pyx":457 * self._session, port) * if listener is NULL: * return handle_error_codes(c_ssh2.libssh2_session_last_errno( # <<<<<<<<<<<<<< * self._session)) * return PyListener(listener, self) */ - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 442, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 457, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":441 + /* "ssh2/session.pyx":456 * listener = c_ssh2.libssh2_channel_forward_listen( * self._session, port) * if listener is NULL: # <<<<<<<<<<<<<< @@ -6526,7 +6536,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_46forward_listen(struct __pyx_ */ } - /* "ssh2/session.pyx":444 + /* "ssh2/session.pyx":459 * return handle_error_codes(c_ssh2.libssh2_session_last_errno( * self._session)) * return PyListener(listener, self) # <<<<<<<<<<<<<< @@ -6534,13 +6544,13 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_46forward_listen(struct __pyx_ * def forward_listen_ex(self, int queue_maxsize, host=None, int port=0): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __pyx_f_4ssh2_8listener_PyListener(__pyx_v_listener, __pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 444, __pyx_L1_error) + __pyx_t_3 = __pyx_f_4ssh2_8listener_PyListener(__pyx_v_listener, __pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 459, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":430 + /* "ssh2/session.pyx":445 * return rc * * def forward_listen(self, int port): # <<<<<<<<<<<<<< @@ -6559,7 +6569,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_46forward_listen(struct __pyx_ return __pyx_r; } -/* "ssh2/session.pyx":446 +/* "ssh2/session.pyx":461 * return PyListener(listener, self) * * def forward_listen_ex(self, int queue_maxsize, host=None, int port=0): # <<<<<<<<<<<<<< @@ -6616,7 +6626,7 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_49forward_listen_ex(PyObject * } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "forward_listen_ex") < 0)) __PYX_ERR(0, 446, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "forward_listen_ex") < 0)) __PYX_ERR(0, 461, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -6629,17 +6639,17 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_49forward_listen_ex(PyObject * default: goto __pyx_L5_argtuple_error; } } - __pyx_v_queue_maxsize = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_queue_maxsize == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 446, __pyx_L3_error) + __pyx_v_queue_maxsize = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_queue_maxsize == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 461, __pyx_L3_error) __pyx_v_host = values[1]; if (values[2]) { - __pyx_v_port = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_port == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 446, __pyx_L3_error) + __pyx_v_port = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_port == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 461, __pyx_L3_error) } else { __pyx_v_port = ((int)0); } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("forward_listen_ex", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 446, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("forward_listen_ex", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 461, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.session.Session.forward_listen_ex", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -6671,7 +6681,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_48forward_listen_ex(struct __p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("forward_listen_ex", 0); - /* "ssh2/session.pyx":468 + /* "ssh2/session.pyx":483 * """ * cdef c_ssh2.LIBSSH2_LISTENER *listener * cdef bytes b_host = None if host is None else to_bytes(host) # <<<<<<<<<<<<<< @@ -6683,7 +6693,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_48forward_listen_ex(struct __p __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } else { - __pyx_t_3 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_host); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_3 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_host); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 483, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; @@ -6691,7 +6701,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_48forward_listen_ex(struct __p __pyx_v_b_host = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/session.pyx":469 + /* "ssh2/session.pyx":484 * cdef c_ssh2.LIBSSH2_LISTENER *listener * cdef bytes b_host = None if host is None else to_bytes(host) * cdef char *_host = NULL # <<<<<<<<<<<<<< @@ -6700,7 +6710,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_48forward_listen_ex(struct __p */ __pyx_v__host = NULL; - /* "ssh2/session.pyx":470 + /* "ssh2/session.pyx":485 * cdef bytes b_host = None if host is None else to_bytes(host) * cdef char *_host = NULL * if b_host is not None: # <<<<<<<<<<<<<< @@ -6711,7 +6721,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_48forward_listen_ex(struct __p __pyx_t_4 = (__pyx_t_2 != 0); if (__pyx_t_4) { - /* "ssh2/session.pyx":471 + /* "ssh2/session.pyx":486 * cdef char *_host = NULL * if b_host is not None: * _host = b_host # <<<<<<<<<<<<<< @@ -6720,12 +6730,12 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_48forward_listen_ex(struct __p */ if (unlikely(__pyx_v_b_host == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 471, __pyx_L1_error) + __PYX_ERR(0, 486, __pyx_L1_error) } - __pyx_t_5 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_host); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) __PYX_ERR(0, 471, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_host); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) __PYX_ERR(0, 486, __pyx_L1_error) __pyx_v__host = __pyx_t_5; - /* "ssh2/session.pyx":470 + /* "ssh2/session.pyx":485 * cdef bytes b_host = None if host is None else to_bytes(host) * cdef char *_host = NULL * if b_host is not None: # <<<<<<<<<<<<<< @@ -6734,7 +6744,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_48forward_listen_ex(struct __p */ } - /* "ssh2/session.pyx":472 + /* "ssh2/session.pyx":487 * if b_host is not None: * _host = b_host * cdef int bound_port = 0 # <<<<<<<<<<<<<< @@ -6743,7 +6753,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_48forward_listen_ex(struct __p */ __pyx_v_bound_port = 0; - /* "ssh2/session.pyx":473 + /* "ssh2/session.pyx":488 * _host = b_host * cdef int bound_port = 0 * with nogil: # <<<<<<<<<<<<<< @@ -6758,7 +6768,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_48forward_listen_ex(struct __p #endif /*try:*/ { - /* "ssh2/session.pyx":474 + /* "ssh2/session.pyx":489 * cdef int bound_port = 0 * with nogil: * listener = c_ssh2.libssh2_channel_forward_listen_ex( # <<<<<<<<<<<<<< @@ -6768,7 +6778,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_48forward_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":473 + /* "ssh2/session.pyx":488 * _host = b_host * cdef int bound_port = 0 * with nogil: # <<<<<<<<<<<<<< @@ -6787,7 +6797,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_48forward_listen_ex(struct __p } } - /* "ssh2/session.pyx":476 + /* "ssh2/session.pyx":491 * listener = c_ssh2.libssh2_channel_forward_listen_ex( * self._session, _host, port, &bound_port, queue_maxsize) * if listener is NULL: # <<<<<<<<<<<<<< @@ -6797,7 +6807,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_48forward_listen_ex(struct __p __pyx_t_4 = ((__pyx_v_listener == NULL) != 0); if (__pyx_t_4) { - /* "ssh2/session.pyx":477 + /* "ssh2/session.pyx":492 * self._session, _host, port, &bound_port, queue_maxsize) * if listener is NULL: * return (handle_error_codes(c_ssh2.libssh2_session_last_errno( # <<<<<<<<<<<<<< @@ -6806,25 +6816,25 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_48forward_listen_ex(struct __p */ __Pyx_XDECREF(__pyx_r); - /* "ssh2/session.pyx":478 + /* "ssh2/session.pyx":493 * if listener is NULL: * return (handle_error_codes(c_ssh2.libssh2_session_last_errno( * self._session)), 0) # <<<<<<<<<<<<<< * return (PyListener(listener, self), bound_port) * */ - __pyx_t_6 = __pyx_f_4ssh2_5utils_handle_error_codes(libssh2_session_last_errno(__pyx_v_self->_session), 0); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 477, __pyx_L1_error) + __pyx_t_6 = __pyx_f_4ssh2_5utils_handle_error_codes(libssh2_session_last_errno(__pyx_v_self->_session), 0); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 492, __pyx_L1_error) - /* "ssh2/session.pyx":477 + /* "ssh2/session.pyx":492 * self._session, _host, port, &bound_port, queue_maxsize) * if listener is NULL: * return (handle_error_codes(c_ssh2.libssh2_session_last_errno( # <<<<<<<<<<<<<< * self._session)), 0) * return (PyListener(listener, self), bound_port) */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 477, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 492, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 477, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 492, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); @@ -6836,7 +6846,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_48forward_listen_ex(struct __p __pyx_t_3 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":476 + /* "ssh2/session.pyx":491 * listener = c_ssh2.libssh2_channel_forward_listen_ex( * self._session, _host, port, &bound_port, queue_maxsize) * if listener is NULL: # <<<<<<<<<<<<<< @@ -6845,7 +6855,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_48forward_listen_ex(struct __p */ } - /* "ssh2/session.pyx":479 + /* "ssh2/session.pyx":494 * return (handle_error_codes(c_ssh2.libssh2_session_last_errno( * self._session)), 0) * return (PyListener(listener, self), bound_port) # <<<<<<<<<<<<<< @@ -6853,11 +6863,11 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_48forward_listen_ex(struct __p * def sftp_init(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __pyx_f_4ssh2_8listener_PyListener(__pyx_v_listener, __pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 479, __pyx_L1_error) + __pyx_t_3 = __pyx_f_4ssh2_8listener_PyListener(__pyx_v_listener, __pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 494, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_bound_port); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 479, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_bound_port); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 494, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 479, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 494, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); @@ -6869,7 +6879,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_48forward_listen_ex(struct __p __pyx_t_7 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":446 + /* "ssh2/session.pyx":461 * return PyListener(listener, self) * * def forward_listen_ex(self, int queue_maxsize, host=None, int port=0): # <<<<<<<<<<<<<< @@ -6891,7 +6901,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_48forward_listen_ex(struct __p return __pyx_r; } -/* "ssh2/session.pyx":481 +/* "ssh2/session.pyx":496 * return (PyListener(listener, self), bound_port) * * def sftp_init(self): # <<<<<<<<<<<<<< @@ -6925,7 +6935,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_50sftp_init(struct __pyx_obj_4 int __pyx_clineno = 0; __Pyx_RefNannySetupContext("sftp_init", 0); - /* "ssh2/session.pyx":487 + /* "ssh2/session.pyx":502 * """ * cdef c_sftp.LIBSSH2_SFTP *_sftp * with nogil: # <<<<<<<<<<<<<< @@ -6940,7 +6950,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_50sftp_init(struct __pyx_obj_4 #endif /*try:*/ { - /* "ssh2/session.pyx":488 + /* "ssh2/session.pyx":503 * cdef c_sftp.LIBSSH2_SFTP *_sftp * with nogil: * _sftp = c_sftp.libssh2_sftp_init(self._session) # <<<<<<<<<<<<<< @@ -6950,7 +6960,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_50sftp_init(struct __pyx_obj_4 __pyx_v__sftp = libssh2_sftp_init(__pyx_v_self->_session); } - /* "ssh2/session.pyx":487 + /* "ssh2/session.pyx":502 * """ * cdef c_sftp.LIBSSH2_SFTP *_sftp * with nogil: # <<<<<<<<<<<<<< @@ -6969,7 +6979,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_50sftp_init(struct __pyx_obj_4 } } - /* "ssh2/session.pyx":489 + /* "ssh2/session.pyx":504 * with nogil: * _sftp = c_sftp.libssh2_sftp_init(self._session) * if _sftp is NULL: # <<<<<<<<<<<<<< @@ -6979,7 +6989,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_50sftp_init(struct __pyx_obj_4 __pyx_t_1 = ((__pyx_v__sftp == NULL) != 0); if (__pyx_t_1) { - /* "ssh2/session.pyx":490 + /* "ssh2/session.pyx":505 * _sftp = c_sftp.libssh2_sftp_init(self._session) * if _sftp is NULL: * return handle_error_codes(c_ssh2.libssh2_session_last_errno( # <<<<<<<<<<<<<< @@ -6988,29 +6998,29 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_50sftp_init(struct __pyx_obj_4 */ __Pyx_XDECREF(__pyx_r); - /* "ssh2/session.pyx":491 + /* "ssh2/session.pyx":506 * if _sftp is NULL: * return handle_error_codes(c_ssh2.libssh2_session_last_errno( * self._session)) # <<<<<<<<<<<<<< * return PySFTP(_sftp, self) * */ - __pyx_t_2 = __pyx_f_4ssh2_5utils_handle_error_codes(libssh2_session_last_errno(__pyx_v_self->_session), 0); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 490, __pyx_L1_error) + __pyx_t_2 = __pyx_f_4ssh2_5utils_handle_error_codes(libssh2_session_last_errno(__pyx_v_self->_session), 0); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 505, __pyx_L1_error) - /* "ssh2/session.pyx":490 + /* "ssh2/session.pyx":505 * _sftp = c_sftp.libssh2_sftp_init(self._session) * if _sftp is NULL: * return handle_error_codes(c_ssh2.libssh2_session_last_errno( # <<<<<<<<<<<<<< * self._session)) * return PySFTP(_sftp, self) */ - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 490, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 505, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":489 + /* "ssh2/session.pyx":504 * with nogil: * _sftp = c_sftp.libssh2_sftp_init(self._session) * if _sftp is NULL: # <<<<<<<<<<<<<< @@ -7019,7 +7029,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_50sftp_init(struct __pyx_obj_4 */ } - /* "ssh2/session.pyx":492 + /* "ssh2/session.pyx":507 * return handle_error_codes(c_ssh2.libssh2_session_last_errno( * self._session)) * return PySFTP(_sftp, self) # <<<<<<<<<<<<<< @@ -7027,13 +7037,13 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_50sftp_init(struct __pyx_obj_4 * def last_error(self, size_t msg_size=1024): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __pyx_f_4ssh2_4sftp_PySFTP(__pyx_v__sftp, __pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 492, __pyx_L1_error) + __pyx_t_3 = __pyx_f_4ssh2_4sftp_PySFTP(__pyx_v__sftp, __pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 507, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":481 + /* "ssh2/session.pyx":496 * return (PyListener(listener, self), bound_port) * * def sftp_init(self): # <<<<<<<<<<<<<< @@ -7052,7 +7062,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_50sftp_init(struct __pyx_obj_4 return __pyx_r; } -/* "ssh2/session.pyx":494 +/* "ssh2/session.pyx":509 * return PySFTP(_sftp, self) * * def last_error(self, size_t msg_size=1024): # <<<<<<<<<<<<<< @@ -7092,7 +7102,7 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_53last_error(PyObject *__pyx_v } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "last_error") < 0)) __PYX_ERR(0, 494, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "last_error") < 0)) __PYX_ERR(0, 509, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -7103,14 +7113,14 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_53last_error(PyObject *__pyx_v } } if (values[0]) { - __pyx_v_msg_size = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_msg_size == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 494, __pyx_L3_error) + __pyx_v_msg_size = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_msg_size == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 509, __pyx_L3_error) } else { __pyx_v_msg_size = ((size_t)0x400); } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("last_error", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 494, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("last_error", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 509, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.session.Session.last_error", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -7145,7 +7155,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_52last_error(struct __pyx_obj_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("last_error", 0); - /* "ssh2/session.pyx":501 + /* "ssh2/session.pyx":516 * """ * cdef char *_error_msg * cdef bytes msg = b'' # <<<<<<<<<<<<<< @@ -7155,7 +7165,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_52last_error(struct __pyx_obj_ __Pyx_INCREF(__pyx_kp_b__2); __pyx_v_msg = __pyx_kp_b__2; - /* "ssh2/session.pyx":502 + /* "ssh2/session.pyx":517 * cdef char *_error_msg * cdef bytes msg = b'' * cdef int errmsg_len = 0 # <<<<<<<<<<<<<< @@ -7164,7 +7174,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_52last_error(struct __pyx_obj_ */ __pyx_v_errmsg_len = 0; - /* "ssh2/session.pyx":503 + /* "ssh2/session.pyx":518 * cdef bytes msg = b'' * cdef int errmsg_len = 0 * with nogil: # <<<<<<<<<<<<<< @@ -7179,7 +7189,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_52last_error(struct __pyx_obj_ #endif /*try:*/ { - /* "ssh2/session.pyx":504 + /* "ssh2/session.pyx":519 * cdef int errmsg_len = 0 * with nogil: * _error_msg = malloc(sizeof(char) * msg_size) # <<<<<<<<<<<<<< @@ -7188,7 +7198,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_52last_error(struct __pyx_obj_ */ __pyx_v__error_msg = ((char *)malloc(((sizeof(char)) * __pyx_v_msg_size))); - /* "ssh2/session.pyx":505 + /* "ssh2/session.pyx":520 * with nogil: * _error_msg = malloc(sizeof(char) * msg_size) * c_ssh2.libssh2_session_last_error( # <<<<<<<<<<<<<< @@ -7198,7 +7208,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_52last_error(struct __pyx_obj_ (void)(libssh2_session_last_error(__pyx_v_self->_session, (&__pyx_v__error_msg), (&__pyx_v_errmsg_len), 1)); } - /* "ssh2/session.pyx":503 + /* "ssh2/session.pyx":518 * cdef bytes msg = b'' * cdef int errmsg_len = 0 * with nogil: # <<<<<<<<<<<<<< @@ -7217,7 +7227,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_52last_error(struct __pyx_obj_ } } - /* "ssh2/session.pyx":507 + /* "ssh2/session.pyx":522 * c_ssh2.libssh2_session_last_error( * self._session, &_error_msg, &errmsg_len, 1) * try: # <<<<<<<<<<<<<< @@ -7226,7 +7236,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_52last_error(struct __pyx_obj_ */ /*try:*/ { - /* "ssh2/session.pyx":508 + /* "ssh2/session.pyx":523 * self._session, &_error_msg, &errmsg_len, 1) * try: * if errmsg_len > 0: # <<<<<<<<<<<<<< @@ -7236,19 +7246,19 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_52last_error(struct __pyx_obj_ __pyx_t_1 = ((__pyx_v_errmsg_len > 0) != 0); if (__pyx_t_1) { - /* "ssh2/session.pyx":509 + /* "ssh2/session.pyx":524 * try: * if errmsg_len > 0: * msg = _error_msg[:errmsg_len] # <<<<<<<<<<<<<< * return msg * finally: */ - __pyx_t_2 = __Pyx_PyBytes_FromStringAndSize(__pyx_v__error_msg + 0, __pyx_v_errmsg_len - 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 509, __pyx_L7_error) + __pyx_t_2 = __Pyx_PyBytes_FromStringAndSize(__pyx_v__error_msg + 0, __pyx_v_errmsg_len - 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 524, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_msg, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 0; - /* "ssh2/session.pyx":508 + /* "ssh2/session.pyx":523 * self._session, &_error_msg, &errmsg_len, 1) * try: * if errmsg_len > 0: # <<<<<<<<<<<<<< @@ -7257,7 +7267,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_52last_error(struct __pyx_obj_ */ } - /* "ssh2/session.pyx":510 + /* "ssh2/session.pyx":525 * if errmsg_len > 0: * msg = _error_msg[:errmsg_len] * return msg # <<<<<<<<<<<<<< @@ -7270,7 +7280,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_52last_error(struct __pyx_obj_ goto __pyx_L6_return; } - /* "ssh2/session.pyx":512 + /* "ssh2/session.pyx":527 * return msg * finally: * free(_error_msg) # <<<<<<<<<<<<<< @@ -7320,7 +7330,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_52last_error(struct __pyx_obj_ } } - /* "ssh2/session.pyx":494 + /* "ssh2/session.pyx":509 * return PySFTP(_sftp, self) * * def last_error(self, size_t msg_size=1024): # <<<<<<<<<<<<<< @@ -7340,7 +7350,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_52last_error(struct __pyx_obj_ return __pyx_r; } -/* "ssh2/session.pyx":514 +/* "ssh2/session.pyx":529 * free(_error_msg) * * def last_errno(self): # <<<<<<<<<<<<<< @@ -7372,7 +7382,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_54last_errno(struct __pyx_obj_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("last_errno", 0); - /* "ssh2/session.pyx":521 + /* "ssh2/session.pyx":536 * """ * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -7387,7 +7397,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_54last_errno(struct __pyx_obj_ #endif /*try:*/ { - /* "ssh2/session.pyx":522 + /* "ssh2/session.pyx":537 * cdef int rc * with nogil: * rc = c_ssh2.libssh2_session_last_errno( # <<<<<<<<<<<<<< @@ -7397,7 +7407,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_54last_errno(struct __pyx_obj_ __pyx_v_rc = libssh2_session_last_errno(__pyx_v_self->_session); } - /* "ssh2/session.pyx":521 + /* "ssh2/session.pyx":536 * """ * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -7416,7 +7426,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_54last_errno(struct __pyx_obj_ } } - /* "ssh2/session.pyx":524 + /* "ssh2/session.pyx":539 * rc = c_ssh2.libssh2_session_last_errno( * self._session) * return rc # <<<<<<<<<<<<<< @@ -7424,13 +7434,13 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_54last_errno(struct __pyx_obj_ * 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, 524, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 539, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":514 + /* "ssh2/session.pyx":529 * free(_error_msg) * * def last_errno(self): # <<<<<<<<<<<<<< @@ -7449,7 +7459,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_54last_errno(struct __pyx_obj_ return __pyx_r; } -/* "ssh2/session.pyx":527 +/* "ssh2/session.pyx":542 * * IF EMBEDDED_LIB: * def set_last_error(self, int errcode, errmsg not None): # <<<<<<<<<<<<<< @@ -7492,11 +7502,11 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_57set_last_error(PyObject *__p case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_errmsg)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("set_last_error", 1, 2, 2, 1); __PYX_ERR(0, 527, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("set_last_error", 1, 2, 2, 1); __PYX_ERR(0, 542, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_last_error") < 0)) __PYX_ERR(0, 527, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_last_error") < 0)) __PYX_ERR(0, 542, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -7504,19 +7514,19 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_57set_last_error(PyObject *__p values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } - __pyx_v_errcode = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_errcode == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 527, __pyx_L3_error) + __pyx_v_errcode = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_errcode == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 542, __pyx_L3_error) __pyx_v_errmsg = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("set_last_error", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 527, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("set_last_error", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 542, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.session.Session.set_last_error", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(((PyObject *)__pyx_v_errmsg) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "errmsg"); __PYX_ERR(0, 527, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "errmsg"); __PYX_ERR(0, 542, __pyx_L1_error) } __pyx_r = __pyx_pf_4ssh2_7session_7Session_56set_last_error(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), __pyx_v_errcode, __pyx_v_errmsg); @@ -7542,19 +7552,19 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_56set_last_error(struct __pyx_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_last_error", 0); - /* "ssh2/session.pyx":528 + /* "ssh2/session.pyx":543 * IF EMBEDDED_LIB: * def set_last_error(self, int errcode, errmsg not None): * cdef bytes b_errmsg = to_bytes(errmsg) # <<<<<<<<<<<<<< * cdef char *_errmsg = b_errmsg * cdef int rc */ - __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_errmsg); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 528, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_errmsg); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 543, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_b_errmsg = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/session.pyx":529 + /* "ssh2/session.pyx":544 * def set_last_error(self, int errcode, errmsg not None): * cdef bytes b_errmsg = to_bytes(errmsg) * cdef char *_errmsg = b_errmsg # <<<<<<<<<<<<<< @@ -7563,12 +7573,12 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_56set_last_error(struct __pyx_ */ if (unlikely(__pyx_v_b_errmsg == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 529, __pyx_L1_error) + __PYX_ERR(0, 544, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_errmsg); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_errmsg); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 544, __pyx_L1_error) __pyx_v__errmsg = __pyx_t_2; - /* "ssh2/session.pyx":531 + /* "ssh2/session.pyx":546 * cdef char *_errmsg = b_errmsg * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -7583,7 +7593,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_56set_last_error(struct __pyx_ #endif /*try:*/ { - /* "ssh2/session.pyx":532 + /* "ssh2/session.pyx":547 * cdef int rc * with nogil: * rc = c_ssh2.libssh2_session_set_last_error( # <<<<<<<<<<<<<< @@ -7593,7 +7603,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_56set_last_error(struct __pyx_ __pyx_v_rc = libssh2_session_set_last_error(__pyx_v_self->_session, __pyx_v_errcode, __pyx_v__errmsg); } - /* "ssh2/session.pyx":531 + /* "ssh2/session.pyx":546 * cdef char *_errmsg = b_errmsg * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -7612,7 +7622,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_56set_last_error(struct __pyx_ } } - /* "ssh2/session.pyx":534 + /* "ssh2/session.pyx":549 * rc = c_ssh2.libssh2_session_set_last_error( * self._session, errcode, _errmsg) * return rc # <<<<<<<<<<<<<< @@ -7620,13 +7630,13 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_56set_last_error(struct __pyx_ * def scp_recv(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, 534, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 549, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":527 + /* "ssh2/session.pyx":542 * * IF EMBEDDED_LIB: * def set_last_error(self, int errcode, errmsg not None): # <<<<<<<<<<<<<< @@ -7646,7 +7656,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_56set_last_error(struct __pyx_ return __pyx_r; } -/* "ssh2/session.pyx":536 +/* "ssh2/session.pyx":551 * return rc * * def scp_recv(self, path not None): # <<<<<<<<<<<<<< @@ -7665,7 +7675,7 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_59scp_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, 536, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "path"); __PYX_ERR(0, 551, __pyx_L1_error) } __pyx_r = __pyx_pf_4ssh2_7session_7Session_58scp_recv(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), ((PyObject *)__pyx_v_path)); @@ -7695,19 +7705,19 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_58scp_recv(struct __pyx_obj_4s int __pyx_clineno = 0; __Pyx_RefNannySetupContext("scp_recv", 0); - /* "ssh2/session.pyx":546 + /* "ssh2/session.pyx":561 * :rtype: tuple(:py:class:`ssh2.channel.Channel`, * :py:class:`ssh2.statinfo.StatInfo`) or None""" * cdef bytes b_path = to_bytes(path) # <<<<<<<<<<<<<< * cdef char *_path = b_path * cdef StatInfo statinfo = StatInfo() */ - __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 546, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 561, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_b_path = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/session.pyx":547 + /* "ssh2/session.pyx":562 * :py:class:`ssh2.statinfo.StatInfo`) or None""" * cdef bytes b_path = to_bytes(path) * cdef char *_path = b_path # <<<<<<<<<<<<<< @@ -7716,24 +7726,24 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_58scp_recv(struct __pyx_obj_4s */ if (unlikely(__pyx_v_b_path == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 547, __pyx_L1_error) + __PYX_ERR(0, 562, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_path); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 547, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_path); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 562, __pyx_L1_error) __pyx_v__path = __pyx_t_2; - /* "ssh2/session.pyx":548 + /* "ssh2/session.pyx":563 * cdef bytes b_path = to_bytes(path) * cdef char *_path = b_path * cdef StatInfo statinfo = StatInfo() # <<<<<<<<<<<<<< * cdef c_ssh2.LIBSSH2_CHANNEL *channel * with nogil: */ - __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_4ssh2_8statinfo_StatInfo)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 548, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_4ssh2_8statinfo_StatInfo)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 563, __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":550 + /* "ssh2/session.pyx":565 * cdef StatInfo statinfo = StatInfo() * cdef c_ssh2.LIBSSH2_CHANNEL *channel * with nogil: # <<<<<<<<<<<<<< @@ -7748,7 +7758,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_58scp_recv(struct __pyx_obj_4s #endif /*try:*/ { - /* "ssh2/session.pyx":551 + /* "ssh2/session.pyx":566 * cdef c_ssh2.LIBSSH2_CHANNEL *channel * with nogil: * channel = c_ssh2.libssh2_scp_recv( # <<<<<<<<<<<<<< @@ -7758,7 +7768,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_58scp_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":550 + /* "ssh2/session.pyx":565 * cdef StatInfo statinfo = StatInfo() * cdef c_ssh2.LIBSSH2_CHANNEL *channel * with nogil: # <<<<<<<<<<<<<< @@ -7777,7 +7787,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_58scp_recv(struct __pyx_obj_4s } } - /* "ssh2/session.pyx":553 + /* "ssh2/session.pyx":568 * channel = c_ssh2.libssh2_scp_recv( * self._session, _path, statinfo._stat) * if channel is NULL: # <<<<<<<<<<<<<< @@ -7787,7 +7797,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_58scp_recv(struct __pyx_obj_4s __pyx_t_3 = ((__pyx_v_channel == NULL) != 0); if (__pyx_t_3) { - /* "ssh2/session.pyx":554 + /* "ssh2/session.pyx":569 * self._session, _path, statinfo._stat) * if channel is NULL: * return handle_error_codes(c_ssh2.libssh2_session_last_errno( # <<<<<<<<<<<<<< @@ -7796,29 +7806,29 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_58scp_recv(struct __pyx_obj_4s */ __Pyx_XDECREF(__pyx_r); - /* "ssh2/session.pyx":555 + /* "ssh2/session.pyx":570 * if channel is NULL: * return handle_error_codes(c_ssh2.libssh2_session_last_errno( * self._session)) # <<<<<<<<<<<<<< * return PyChannel(channel, self), statinfo * */ - __pyx_t_4 = __pyx_f_4ssh2_5utils_handle_error_codes(libssh2_session_last_errno(__pyx_v_self->_session), 0); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 554, __pyx_L1_error) + __pyx_t_4 = __pyx_f_4ssh2_5utils_handle_error_codes(libssh2_session_last_errno(__pyx_v_self->_session), 0); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 569, __pyx_L1_error) - /* "ssh2/session.pyx":554 + /* "ssh2/session.pyx":569 * self._session, _path, statinfo._stat) * if channel is NULL: * return handle_error_codes(c_ssh2.libssh2_session_last_errno( # <<<<<<<<<<<<<< * self._session)) * return PyChannel(channel, self), statinfo */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 554, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 569, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":553 + /* "ssh2/session.pyx":568 * channel = c_ssh2.libssh2_scp_recv( * self._session, _path, statinfo._stat) * if channel is NULL: # <<<<<<<<<<<<<< @@ -7827,7 +7837,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_58scp_recv(struct __pyx_obj_4s */ } - /* "ssh2/session.pyx":556 + /* "ssh2/session.pyx":571 * return handle_error_codes(c_ssh2.libssh2_session_last_errno( * self._session)) * return PyChannel(channel, self), statinfo # <<<<<<<<<<<<<< @@ -7835,9 +7845,9 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_58scp_recv(struct __pyx_obj_4s * 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, 556, __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, 571, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 556, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 571, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); @@ -7849,7 +7859,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_58scp_recv(struct __pyx_obj_4s __pyx_t_5 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":536 + /* "ssh2/session.pyx":551 * return rc * * def scp_recv(self, path not None): # <<<<<<<<<<<<<< @@ -7871,7 +7881,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_58scp_recv(struct __pyx_obj_4s return __pyx_r; } -/* "ssh2/session.pyx":559 +/* "ssh2/session.pyx":574 * * IF EMBEDDED_LIB: * def scp_recv2(self, path not None): # <<<<<<<<<<<<<< @@ -7890,7 +7900,7 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_61scp_recv2(PyObject *__pyx_v_ __Pyx_RefNannyDeclarations __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, 559, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "path"); __PYX_ERR(0, 574, __pyx_L1_error) } __pyx_r = __pyx_pf_4ssh2_7session_7Session_60scp_recv2(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), ((PyObject *)__pyx_v_path)); @@ -7920,31 +7930,31 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_60scp_recv2(struct __pyx_obj_4 int __pyx_clineno = 0; __Pyx_RefNannySetupContext("scp_recv2", 0); - /* "ssh2/session.pyx":569 + /* "ssh2/session.pyx":584 * :rtype: tuple(:py:class:`ssh2.channel.Channel`, * :py:class:`ssh2.fileinfo.FileInfo`) or ``None``""" * cdef FileInfo fileinfo = FileInfo() # <<<<<<<<<<<<<< * cdef bytes b_path = to_bytes(path) * cdef char *_path = b_path */ - __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_4ssh2_8fileinfo_FileInfo)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 569, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_4ssh2_8fileinfo_FileInfo)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 584, __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":570 + /* "ssh2/session.pyx":585 * :py:class:`ssh2.fileinfo.FileInfo`) or ``None``""" * cdef FileInfo fileinfo = FileInfo() * cdef bytes b_path = to_bytes(path) # <<<<<<<<<<<<<< * cdef char *_path = b_path * cdef c_ssh2.LIBSSH2_CHANNEL *channel */ - __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 570, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 585, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_b_path = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/session.pyx":571 + /* "ssh2/session.pyx":586 * cdef FileInfo fileinfo = FileInfo() * cdef bytes b_path = to_bytes(path) * cdef char *_path = b_path # <<<<<<<<<<<<<< @@ -7953,12 +7963,12 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_60scp_recv2(struct __pyx_obj_4 */ if (unlikely(__pyx_v_b_path == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 571, __pyx_L1_error) + __PYX_ERR(0, 586, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_path); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 571, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_path); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 586, __pyx_L1_error) __pyx_v__path = __pyx_t_2; - /* "ssh2/session.pyx":573 + /* "ssh2/session.pyx":588 * cdef char *_path = b_path * cdef c_ssh2.LIBSSH2_CHANNEL *channel * with nogil: # <<<<<<<<<<<<<< @@ -7973,7 +7983,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_60scp_recv2(struct __pyx_obj_4 #endif /*try:*/ { - /* "ssh2/session.pyx":574 + /* "ssh2/session.pyx":589 * cdef c_ssh2.LIBSSH2_CHANNEL *channel * with nogil: * channel = c_ssh2.libssh2_scp_recv2( # <<<<<<<<<<<<<< @@ -7983,7 +7993,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_60scp_recv2(struct __pyx_obj_4 __pyx_v_channel = libssh2_scp_recv2(__pyx_v_self->_session, __pyx_v__path, __pyx_v_fileinfo->_stat); } - /* "ssh2/session.pyx":573 + /* "ssh2/session.pyx":588 * cdef char *_path = b_path * cdef c_ssh2.LIBSSH2_CHANNEL *channel * with nogil: # <<<<<<<<<<<<<< @@ -8002,7 +8012,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_60scp_recv2(struct __pyx_obj_4 } } - /* "ssh2/session.pyx":576 + /* "ssh2/session.pyx":591 * channel = c_ssh2.libssh2_scp_recv2( * self._session, _path, fileinfo._stat) * if channel is NULL: # <<<<<<<<<<<<<< @@ -8012,7 +8022,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_60scp_recv2(struct __pyx_obj_4 __pyx_t_3 = ((__pyx_v_channel == NULL) != 0); if (__pyx_t_3) { - /* "ssh2/session.pyx":577 + /* "ssh2/session.pyx":592 * self._session, _path, fileinfo._stat) * if channel is NULL: * return handle_error_codes(c_ssh2.libssh2_session_last_errno( # <<<<<<<<<<<<<< @@ -8021,29 +8031,29 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_60scp_recv2(struct __pyx_obj_4 */ __Pyx_XDECREF(__pyx_r); - /* "ssh2/session.pyx":578 + /* "ssh2/session.pyx":593 * if channel is NULL: * return handle_error_codes(c_ssh2.libssh2_session_last_errno( * self._session)) # <<<<<<<<<<<<<< * return PyChannel(channel, self), fileinfo * */ - __pyx_t_4 = __pyx_f_4ssh2_5utils_handle_error_codes(libssh2_session_last_errno(__pyx_v_self->_session), 0); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 577, __pyx_L1_error) + __pyx_t_4 = __pyx_f_4ssh2_5utils_handle_error_codes(libssh2_session_last_errno(__pyx_v_self->_session), 0); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 592, __pyx_L1_error) - /* "ssh2/session.pyx":577 + /* "ssh2/session.pyx":592 * self._session, _path, fileinfo._stat) * if channel is NULL: * return handle_error_codes(c_ssh2.libssh2_session_last_errno( # <<<<<<<<<<<<<< * self._session)) * return PyChannel(channel, self), fileinfo */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 577, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 592, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":576 + /* "ssh2/session.pyx":591 * channel = c_ssh2.libssh2_scp_recv2( * self._session, _path, fileinfo._stat) * if channel is NULL: # <<<<<<<<<<<<<< @@ -8052,7 +8062,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_60scp_recv2(struct __pyx_obj_4 */ } - /* "ssh2/session.pyx":579 + /* "ssh2/session.pyx":594 * return handle_error_codes(c_ssh2.libssh2_session_last_errno( * self._session)) * return PyChannel(channel, self), fileinfo # <<<<<<<<<<<<<< @@ -8060,9 +8070,9 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_60scp_recv2(struct __pyx_obj_4 * def scp_send(self, path not None, int mode, size_t size): */ __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, 579, __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, 594, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 579, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 594, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); @@ -8074,7 +8084,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_60scp_recv2(struct __pyx_obj_4 __pyx_t_5 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":559 + /* "ssh2/session.pyx":574 * * IF EMBEDDED_LIB: * def scp_recv2(self, path not None): # <<<<<<<<<<<<<< @@ -8096,7 +8106,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_60scp_recv2(struct __pyx_obj_4 return __pyx_r; } -/* "ssh2/session.pyx":581 +/* "ssh2/session.pyx":596 * return PyChannel(channel, self), fileinfo * * def scp_send(self, path not None, int mode, size_t size): # <<<<<<<<<<<<<< @@ -8142,17 +8152,17 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_63scp_send(PyObject *__pyx_v_s case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("scp_send", 1, 3, 3, 1); __PYX_ERR(0, 581, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("scp_send", 1, 3, 3, 1); __PYX_ERR(0, 596, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("scp_send", 1, 3, 3, 2); __PYX_ERR(0, 581, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("scp_send", 1, 3, 3, 2); __PYX_ERR(0, 596, __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, 581, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "scp_send") < 0)) __PYX_ERR(0, 596, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -8162,19 +8172,19 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_63scp_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, 581, __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, 581, __pyx_L3_error) + __pyx_v_mode = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_mode == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 596, __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, 596, __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, 581, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("scp_send", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 596, __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, 581, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "path"); __PYX_ERR(0, 596, __pyx_L1_error) } __pyx_r = __pyx_pf_4ssh2_7session_7Session_62scp_send(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), __pyx_v_path, __pyx_v_mode, __pyx_v_size); @@ -8202,19 +8212,19 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_62scp_send(struct __pyx_obj_4s int __pyx_clineno = 0; __Pyx_RefNannySetupContext("scp_send", 0); - /* "ssh2/session.pyx":592 + /* "ssh2/session.pyx":607 * * :rtype: :py:class:`ssh2.channel.Channel`""" * cdef bytes b_path = to_bytes(path) # <<<<<<<<<<<<<< * cdef char *_path = b_path * cdef c_ssh2.LIBSSH2_CHANNEL *channel */ - __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 592, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 607, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_b_path = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/session.pyx":593 + /* "ssh2/session.pyx":608 * :rtype: :py:class:`ssh2.channel.Channel`""" * cdef bytes b_path = to_bytes(path) * cdef char *_path = b_path # <<<<<<<<<<<<<< @@ -8223,12 +8233,12 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_62scp_send(struct __pyx_obj_4s */ if (unlikely(__pyx_v_b_path == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 593, __pyx_L1_error) + __PYX_ERR(0, 608, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_path); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 593, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_path); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 608, __pyx_L1_error) __pyx_v__path = __pyx_t_2; - /* "ssh2/session.pyx":595 + /* "ssh2/session.pyx":610 * cdef char *_path = b_path * cdef c_ssh2.LIBSSH2_CHANNEL *channel * with nogil: # <<<<<<<<<<<<<< @@ -8243,7 +8253,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_62scp_send(struct __pyx_obj_4s #endif /*try:*/ { - /* "ssh2/session.pyx":596 + /* "ssh2/session.pyx":611 * cdef c_ssh2.LIBSSH2_CHANNEL *channel * with nogil: * channel = c_ssh2.libssh2_scp_send( # <<<<<<<<<<<<<< @@ -8253,7 +8263,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_62scp_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":595 + /* "ssh2/session.pyx":610 * cdef char *_path = b_path * cdef c_ssh2.LIBSSH2_CHANNEL *channel * with nogil: # <<<<<<<<<<<<<< @@ -8272,7 +8282,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_62scp_send(struct __pyx_obj_4s } } - /* "ssh2/session.pyx":598 + /* "ssh2/session.pyx":613 * channel = c_ssh2.libssh2_scp_send( * self._session, _path, mode, size) * if channel is NULL: # <<<<<<<<<<<<<< @@ -8282,7 +8292,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_62scp_send(struct __pyx_obj_4s __pyx_t_3 = ((__pyx_v_channel == NULL) != 0); if (__pyx_t_3) { - /* "ssh2/session.pyx":599 + /* "ssh2/session.pyx":614 * self._session, _path, mode, size) * if channel is NULL: * return handle_error_codes(c_ssh2.libssh2_session_last_errno( # <<<<<<<<<<<<<< @@ -8291,29 +8301,29 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_62scp_send(struct __pyx_obj_4s */ __Pyx_XDECREF(__pyx_r); - /* "ssh2/session.pyx":600 + /* "ssh2/session.pyx":615 * if channel is NULL: * return handle_error_codes(c_ssh2.libssh2_session_last_errno( * self._session)) # <<<<<<<<<<<<<< * return PyChannel(channel, self) * */ - __pyx_t_4 = __pyx_f_4ssh2_5utils_handle_error_codes(libssh2_session_last_errno(__pyx_v_self->_session), 0); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 599, __pyx_L1_error) + __pyx_t_4 = __pyx_f_4ssh2_5utils_handle_error_codes(libssh2_session_last_errno(__pyx_v_self->_session), 0); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 614, __pyx_L1_error) - /* "ssh2/session.pyx":599 + /* "ssh2/session.pyx":614 * self._session, _path, mode, size) * if channel is NULL: * return handle_error_codes(c_ssh2.libssh2_session_last_errno( # <<<<<<<<<<<<<< * self._session)) * return PyChannel(channel, self) */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 599, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 614, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":598 + /* "ssh2/session.pyx":613 * channel = c_ssh2.libssh2_scp_send( * self._session, _path, mode, size) * if channel is NULL: # <<<<<<<<<<<<<< @@ -8322,7 +8332,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_62scp_send(struct __pyx_obj_4s */ } - /* "ssh2/session.pyx":601 + /* "ssh2/session.pyx":616 * return handle_error_codes(c_ssh2.libssh2_session_last_errno( * self._session)) * return PyChannel(channel, self) # <<<<<<<<<<<<<< @@ -8330,13 +8340,13 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_62scp_send(struct __pyx_obj_4s * def scp_send64(self, path not None, int mode, c_ssh2.libssh2_uint64_t size, */ __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, 601, __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, 616, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":581 + /* "ssh2/session.pyx":596 * return PyChannel(channel, self), fileinfo * * def scp_send(self, path not None, int mode, size_t size): # <<<<<<<<<<<<<< @@ -8356,7 +8366,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_62scp_send(struct __pyx_obj_4s return __pyx_r; } -/* "ssh2/session.pyx":603 +/* "ssh2/session.pyx":618 * return PyChannel(channel, self) * * def scp_send64(self, path not None, int mode, c_ssh2.libssh2_uint64_t size, # <<<<<<<<<<<<<< @@ -8408,29 +8418,29 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_65scp_send64(PyObject *__pyx_v case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("scp_send64", 1, 5, 5, 1); __PYX_ERR(0, 603, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("scp_send64", 1, 5, 5, 1); __PYX_ERR(0, 618, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("scp_send64", 1, 5, 5, 2); __PYX_ERR(0, 603, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("scp_send64", 1, 5, 5, 2); __PYX_ERR(0, 618, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mtime)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("scp_send64", 1, 5, 5, 3); __PYX_ERR(0, 603, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("scp_send64", 1, 5, 5, 3); __PYX_ERR(0, 618, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_atime)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("scp_send64", 1, 5, 5, 4); __PYX_ERR(0, 603, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("scp_send64", 1, 5, 5, 4); __PYX_ERR(0, 618, __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, 603, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "scp_send64") < 0)) __PYX_ERR(0, 618, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 5) { goto __pyx_L5_argtuple_error; @@ -8442,21 +8452,21 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_65scp_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, 603, __pyx_L3_error) - __pyx_v_size = __Pyx_PyInt_As_libssh2_uint64_t(values[2]); if (unlikely((__pyx_v_size == ((libssh2_uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 603, __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, 604, __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, 604, __pyx_L3_error) + __pyx_v_mode = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_mode == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 618, __pyx_L3_error) + __pyx_v_size = __Pyx_PyInt_As_libssh2_uint64_t(values[2]); if (unlikely((__pyx_v_size == ((libssh2_uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 618, __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, 619, __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, 619, __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, 603, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("scp_send64", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 618, __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, 603, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "path"); __PYX_ERR(0, 618, __pyx_L1_error) } __pyx_r = __pyx_pf_4ssh2_7session_7Session_64scp_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); @@ -8484,19 +8494,19 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_64scp_send64(struct __pyx_obj_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("scp_send64", 0); - /* "ssh2/session.pyx":615 + /* "ssh2/session.pyx":630 * * :rtype: :py:class:`ssh2.channel.Channel`""" * cdef bytes b_path = to_bytes(path) # <<<<<<<<<<<<<< * cdef char *_path = b_path * cdef c_ssh2.LIBSSH2_CHANNEL *channel */ - __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 615, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 630, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_b_path = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/session.pyx":616 + /* "ssh2/session.pyx":631 * :rtype: :py:class:`ssh2.channel.Channel`""" * cdef bytes b_path = to_bytes(path) * cdef char *_path = b_path # <<<<<<<<<<<<<< @@ -8505,12 +8515,12 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_64scp_send64(struct __pyx_obj_ */ if (unlikely(__pyx_v_b_path == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 616, __pyx_L1_error) + __PYX_ERR(0, 631, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_path); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 616, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_path); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 631, __pyx_L1_error) __pyx_v__path = __pyx_t_2; - /* "ssh2/session.pyx":618 + /* "ssh2/session.pyx":633 * cdef char *_path = b_path * cdef c_ssh2.LIBSSH2_CHANNEL *channel * with nogil: # <<<<<<<<<<<<<< @@ -8525,7 +8535,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_64scp_send64(struct __pyx_obj_ #endif /*try:*/ { - /* "ssh2/session.pyx":619 + /* "ssh2/session.pyx":634 * cdef c_ssh2.LIBSSH2_CHANNEL *channel * with nogil: * channel = c_ssh2.libssh2_scp_send64( # <<<<<<<<<<<<<< @@ -8535,7 +8545,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_64scp_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":618 + /* "ssh2/session.pyx":633 * cdef char *_path = b_path * cdef c_ssh2.LIBSSH2_CHANNEL *channel * with nogil: # <<<<<<<<<<<<<< @@ -8554,7 +8564,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_64scp_send64(struct __pyx_obj_ } } - /* "ssh2/session.pyx":621 + /* "ssh2/session.pyx":636 * channel = c_ssh2.libssh2_scp_send64( * self._session, _path, mode, size, mtime, atime) * if channel is NULL: # <<<<<<<<<<<<<< @@ -8564,7 +8574,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_64scp_send64(struct __pyx_obj_ __pyx_t_3 = ((__pyx_v_channel == NULL) != 0); if (__pyx_t_3) { - /* "ssh2/session.pyx":622 + /* "ssh2/session.pyx":637 * self._session, _path, mode, size, mtime, atime) * if channel is NULL: * return handle_error_codes(c_ssh2.libssh2_session_last_errno( # <<<<<<<<<<<<<< @@ -8573,29 +8583,29 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_64scp_send64(struct __pyx_obj_ */ __Pyx_XDECREF(__pyx_r); - /* "ssh2/session.pyx":623 + /* "ssh2/session.pyx":638 * if channel is NULL: * return handle_error_codes(c_ssh2.libssh2_session_last_errno( * self._session)) # <<<<<<<<<<<<<< * return PyChannel(channel, self) * */ - __pyx_t_4 = __pyx_f_4ssh2_5utils_handle_error_codes(libssh2_session_last_errno(__pyx_v_self->_session), 0); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 622, __pyx_L1_error) + __pyx_t_4 = __pyx_f_4ssh2_5utils_handle_error_codes(libssh2_session_last_errno(__pyx_v_self->_session), 0); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 637, __pyx_L1_error) - /* "ssh2/session.pyx":622 + /* "ssh2/session.pyx":637 * self._session, _path, mode, size, mtime, atime) * if channel is NULL: * return handle_error_codes(c_ssh2.libssh2_session_last_errno( # <<<<<<<<<<<<<< * self._session)) * return PyChannel(channel, self) */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 622, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 637, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":621 + /* "ssh2/session.pyx":636 * channel = c_ssh2.libssh2_scp_send64( * self._session, _path, mode, size, mtime, atime) * if channel is NULL: # <<<<<<<<<<<<<< @@ -8604,7 +8614,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_64scp_send64(struct __pyx_obj_ */ } - /* "ssh2/session.pyx":624 + /* "ssh2/session.pyx":639 * return handle_error_codes(c_ssh2.libssh2_session_last_errno( * self._session)) * return PyChannel(channel, self) # <<<<<<<<<<<<<< @@ -8612,13 +8622,13 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_64scp_send64(struct __pyx_obj_ * def publickey_init(self): */ __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, 624, __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, 639, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":603 + /* "ssh2/session.pyx":618 * return PyChannel(channel, self) * * def scp_send64(self, path not None, int mode, c_ssh2.libssh2_uint64_t size, # <<<<<<<<<<<<<< @@ -8638,7 +8648,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_64scp_send64(struct __pyx_obj_ return __pyx_r; } -/* "ssh2/session.pyx":626 +/* "ssh2/session.pyx":641 * return PyChannel(channel, self) * * def publickey_init(self): # <<<<<<<<<<<<<< @@ -8671,7 +8681,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_66publickey_init(struct __pyx_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("publickey_init", 0); - /* "ssh2/session.pyx":630 + /* "ssh2/session.pyx":645 * public keys""" * cdef c_pkey.LIBSSH2_PUBLICKEY *_pkey * with nogil: # <<<<<<<<<<<<<< @@ -8686,7 +8696,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_66publickey_init(struct __pyx_ #endif /*try:*/ { - /* "ssh2/session.pyx":631 + /* "ssh2/session.pyx":646 * cdef c_pkey.LIBSSH2_PUBLICKEY *_pkey * with nogil: * _pkey = c_pkey.libssh2_publickey_init(self._session) # <<<<<<<<<<<<<< @@ -8696,7 +8706,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_66publickey_init(struct __pyx_ __pyx_v__pkey = libssh2_publickey_init(__pyx_v_self->_session); } - /* "ssh2/session.pyx":630 + /* "ssh2/session.pyx":645 * public keys""" * cdef c_pkey.LIBSSH2_PUBLICKEY *_pkey * with nogil: # <<<<<<<<<<<<<< @@ -8715,7 +8725,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_66publickey_init(struct __pyx_ } } - /* "ssh2/session.pyx":632 + /* "ssh2/session.pyx":647 * with nogil: * _pkey = c_pkey.libssh2_publickey_init(self._session) * if _pkey is NULL: # <<<<<<<<<<<<<< @@ -8725,20 +8735,20 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_66publickey_init(struct __pyx_ __pyx_t_1 = ((__pyx_v__pkey == NULL) != 0); if (unlikely(__pyx_t_1)) { - /* "ssh2/session.pyx":633 + /* "ssh2/session.pyx":648 * _pkey = c_pkey.libssh2_publickey_init(self._session) * if _pkey is NULL: * raise PublicKeyInitError # <<<<<<<<<<<<<< * return PyPublicKeySystem(_pkey, self) * */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_PublicKeyInitError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 633, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_PublicKeyInitError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 648, __pyx_L1_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, 633, __pyx_L1_error) + __PYX_ERR(0, 648, __pyx_L1_error) - /* "ssh2/session.pyx":632 + /* "ssh2/session.pyx":647 * with nogil: * _pkey = c_pkey.libssh2_publickey_init(self._session) * if _pkey is NULL: # <<<<<<<<<<<<<< @@ -8747,7 +8757,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_66publickey_init(struct __pyx_ */ } - /* "ssh2/session.pyx":634 + /* "ssh2/session.pyx":649 * if _pkey is NULL: * raise PublicKeyInitError * return PyPublicKeySystem(_pkey, self) # <<<<<<<<<<<<<< @@ -8755,13 +8765,13 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_66publickey_init(struct __pyx_ * def hostkey_hash(self, int hash_type): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __pyx_f_4ssh2_9publickey_PyPublicKeySystem(__pyx_v__pkey, __pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 634, __pyx_L1_error) + __pyx_t_2 = __pyx_f_4ssh2_9publickey_PyPublicKeySystem(__pyx_v__pkey, __pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 649, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":626 + /* "ssh2/session.pyx":641 * return PyChannel(channel, self) * * def publickey_init(self): # <<<<<<<<<<<<<< @@ -8780,7 +8790,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_66publickey_init(struct __pyx_ return __pyx_r; } -/* "ssh2/session.pyx":636 +/* "ssh2/session.pyx":651 * return PyPublicKeySystem(_pkey, self) * * def hostkey_hash(self, int hash_type): # <<<<<<<<<<<<<< @@ -8800,7 +8810,7 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_69hostkey_hash(PyObject *__pyx __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("hostkey_hash (wrapper)", 0); assert(__pyx_arg_hash_type); { - __pyx_v_hash_type = __Pyx_PyInt_As_int(__pyx_arg_hash_type); if (unlikely((__pyx_v_hash_type == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 636, __pyx_L3_error) + __pyx_v_hash_type = __Pyx_PyInt_As_int(__pyx_arg_hash_type); if (unlikely((__pyx_v_hash_type == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 651, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -8827,7 +8837,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_68hostkey_hash(struct __pyx_ob int __pyx_clineno = 0; __Pyx_RefNannySetupContext("hostkey_hash", 0); - /* "ssh2/session.pyx":646 + /* "ssh2/session.pyx":661 * cdef const char *_hash * cdef bytes b_hash * with nogil: # <<<<<<<<<<<<<< @@ -8842,7 +8852,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_68hostkey_hash(struct __pyx_ob #endif /*try:*/ { - /* "ssh2/session.pyx":647 + /* "ssh2/session.pyx":662 * cdef bytes b_hash * with nogil: * _hash = c_ssh2.libssh2_hostkey_hash(self._session, hash_type) # <<<<<<<<<<<<<< @@ -8852,7 +8862,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_68hostkey_hash(struct __pyx_ob __pyx_v__hash = libssh2_hostkey_hash(__pyx_v_self->_session, __pyx_v_hash_type); } - /* "ssh2/session.pyx":646 + /* "ssh2/session.pyx":661 * cdef const char *_hash * cdef bytes b_hash * with nogil: # <<<<<<<<<<<<<< @@ -8871,7 +8881,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_68hostkey_hash(struct __pyx_ob } } - /* "ssh2/session.pyx":648 + /* "ssh2/session.pyx":663 * with nogil: * _hash = c_ssh2.libssh2_hostkey_hash(self._session, hash_type) * if _hash is NULL: # <<<<<<<<<<<<<< @@ -8881,7 +8891,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_68hostkey_hash(struct __pyx_ob __pyx_t_1 = ((__pyx_v__hash == NULL) != 0); if (__pyx_t_1) { - /* "ssh2/session.pyx":649 + /* "ssh2/session.pyx":664 * _hash = c_ssh2.libssh2_hostkey_hash(self._session, hash_type) * if _hash is NULL: * return # <<<<<<<<<<<<<< @@ -8892,7 +8902,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_68hostkey_hash(struct __pyx_ob __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "ssh2/session.pyx":648 + /* "ssh2/session.pyx":663 * with nogil: * _hash = c_ssh2.libssh2_hostkey_hash(self._session, hash_type) * if _hash is NULL: # <<<<<<<<<<<<<< @@ -8901,19 +8911,19 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_68hostkey_hash(struct __pyx_ob */ } - /* "ssh2/session.pyx":650 + /* "ssh2/session.pyx":665 * if _hash is NULL: * return * b_hash = _hash # <<<<<<<<<<<<<< * return b_hash * */ - __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v__hash); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 650, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v__hash); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 665, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_b_hash = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "ssh2/session.pyx":651 + /* "ssh2/session.pyx":666 * return * b_hash = _hash * return b_hash # <<<<<<<<<<<<<< @@ -8925,7 +8935,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_68hostkey_hash(struct __pyx_ob __pyx_r = __pyx_v_b_hash; goto __pyx_L0; - /* "ssh2/session.pyx":636 + /* "ssh2/session.pyx":651 * return PyPublicKeySystem(_pkey, self) * * def hostkey_hash(self, int hash_type): # <<<<<<<<<<<<<< @@ -8945,7 +8955,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_68hostkey_hash(struct __pyx_ob return __pyx_r; } -/* "ssh2/session.pyx":653 +/* "ssh2/session.pyx":668 * return b_hash * * def hostkey(self): # <<<<<<<<<<<<<< @@ -8983,7 +8993,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_70hostkey(struct __pyx_obj_4ss int __pyx_clineno = 0; __Pyx_RefNannySetupContext("hostkey", 0); - /* "ssh2/session.pyx":662 + /* "ssh2/session.pyx":677 * * :rtype: tuple(bytes, int)""" * cdef bytes key = b"" # <<<<<<<<<<<<<< @@ -8993,7 +9003,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_70hostkey(struct __pyx_obj_4ss __Pyx_INCREF(__pyx_kp_b__2); __pyx_v_key = __pyx_kp_b__2; - /* "ssh2/session.pyx":664 + /* "ssh2/session.pyx":679 * cdef bytes key = b"" * cdef const char *_key * cdef size_t key_len = 0 # <<<<<<<<<<<<<< @@ -9002,7 +9012,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_70hostkey(struct __pyx_obj_4ss */ __pyx_v_key_len = 0; - /* "ssh2/session.pyx":665 + /* "ssh2/session.pyx":680 * cdef const char *_key * cdef size_t key_len = 0 * cdef int key_type = 0 # <<<<<<<<<<<<<< @@ -9011,7 +9021,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_70hostkey(struct __pyx_obj_4ss */ __pyx_v_key_type = 0; - /* "ssh2/session.pyx":666 + /* "ssh2/session.pyx":681 * cdef size_t key_len = 0 * cdef int key_type = 0 * with nogil: # <<<<<<<<<<<<<< @@ -9026,7 +9036,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_70hostkey(struct __pyx_obj_4ss #endif /*try:*/ { - /* "ssh2/session.pyx":667 + /* "ssh2/session.pyx":682 * cdef int key_type = 0 * with nogil: * _key = c_ssh2.libssh2_session_hostkey( # <<<<<<<<<<<<<< @@ -9036,7 +9046,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_70hostkey(struct __pyx_obj_4ss __pyx_v__key = libssh2_session_hostkey(__pyx_v_self->_session, (&__pyx_v_key_len), (&__pyx_v_key_type)); } - /* "ssh2/session.pyx":666 + /* "ssh2/session.pyx":681 * cdef size_t key_len = 0 * cdef int key_type = 0 * with nogil: # <<<<<<<<<<<<<< @@ -9055,7 +9065,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_70hostkey(struct __pyx_obj_4ss } } - /* "ssh2/session.pyx":669 + /* "ssh2/session.pyx":684 * _key = c_ssh2.libssh2_session_hostkey( * self._session, &key_len, &key_type) * if _key is NULL: # <<<<<<<<<<<<<< @@ -9065,14 +9075,14 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_70hostkey(struct __pyx_obj_4ss __pyx_t_1 = ((__pyx_v__key == NULL) != 0); if (unlikely(__pyx_t_1)) { - /* "ssh2/session.pyx":670 + /* "ssh2/session.pyx":685 * self._session, &key_len, &key_type) * if _key is NULL: * raise SessionHostKeyError( # <<<<<<<<<<<<<< * "Error retrieving server host key for session") * key = _key[:key_len] */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_SessionHostKeyError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 670, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_SessionHostKeyError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 685, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { @@ -9086,14 +9096,14 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_70hostkey(struct __pyx_obj_4ss } __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_kp_s_Error_retrieving_server_host_key) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_s_Error_retrieving_server_host_key); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 670, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 685, __pyx_L1_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(0, 670, __pyx_L1_error) + __PYX_ERR(0, 685, __pyx_L1_error) - /* "ssh2/session.pyx":669 + /* "ssh2/session.pyx":684 * _key = c_ssh2.libssh2_session_hostkey( * self._session, &key_len, &key_type) * if _key is NULL: # <<<<<<<<<<<<<< @@ -9102,19 +9112,19 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_70hostkey(struct __pyx_obj_4ss */ } - /* "ssh2/session.pyx":672 + /* "ssh2/session.pyx":687 * raise SessionHostKeyError( * "Error retrieving server host key for session") * key = _key[:key_len] # <<<<<<<<<<<<<< * return key, key_type * */ - __pyx_t_2 = __Pyx_PyBytes_FromStringAndSize(__pyx_v__key + 0, __pyx_v_key_len - 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 672, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_FromStringAndSize(__pyx_v__key + 0, __pyx_v_key_len - 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 687, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_key, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 0; - /* "ssh2/session.pyx":673 + /* "ssh2/session.pyx":688 * "Error retrieving server host key for session") * key = _key[:key_len] * return key, key_type # <<<<<<<<<<<<<< @@ -9122,9 +9132,9 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_70hostkey(struct __pyx_obj_4ss * def knownhost_init(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_key_type); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 673, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_key_type); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 688, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 673, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 688, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); @@ -9136,7 +9146,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_70hostkey(struct __pyx_obj_4ss __pyx_t_3 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":653 + /* "ssh2/session.pyx":668 * return b_hash * * def hostkey(self): # <<<<<<<<<<<<<< @@ -9158,7 +9168,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_70hostkey(struct __pyx_obj_4ss return __pyx_r; } -/* "ssh2/session.pyx":675 +/* "ssh2/session.pyx":690 * return key, key_type * * def knownhost_init(self): # <<<<<<<<<<<<<< @@ -9191,7 +9201,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_72knownhost_init(struct __pyx_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("knownhost_init", 0); - /* "ssh2/session.pyx":680 + /* "ssh2/session.pyx":695 * :rtype: :py:class:`ssh2.knownhost.KnownHost`""" * cdef c_ssh2.LIBSSH2_KNOWNHOSTS *known_hosts * with nogil: # <<<<<<<<<<<<<< @@ -9206,7 +9216,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_72knownhost_init(struct __pyx_ #endif /*try:*/ { - /* "ssh2/session.pyx":681 + /* "ssh2/session.pyx":696 * cdef c_ssh2.LIBSSH2_KNOWNHOSTS *known_hosts * with nogil: * known_hosts = c_ssh2.libssh2_knownhost_init( # <<<<<<<<<<<<<< @@ -9216,7 +9226,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_72knownhost_init(struct __pyx_ __pyx_v_known_hosts = libssh2_knownhost_init(__pyx_v_self->_session); } - /* "ssh2/session.pyx":680 + /* "ssh2/session.pyx":695 * :rtype: :py:class:`ssh2.knownhost.KnownHost`""" * cdef c_ssh2.LIBSSH2_KNOWNHOSTS *known_hosts * with nogil: # <<<<<<<<<<<<<< @@ -9235,7 +9245,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_72knownhost_init(struct __pyx_ } } - /* "ssh2/session.pyx":683 + /* "ssh2/session.pyx":698 * known_hosts = c_ssh2.libssh2_knownhost_init( * self._session) * if known_hosts is NULL: # <<<<<<<<<<<<<< @@ -9245,20 +9255,20 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_72knownhost_init(struct __pyx_ __pyx_t_1 = ((__pyx_v_known_hosts == NULL) != 0); if (unlikely(__pyx_t_1)) { - /* "ssh2/session.pyx":684 + /* "ssh2/session.pyx":699 * self._session) * if known_hosts is NULL: * raise KnownHostError # <<<<<<<<<<<<<< * return PyKnownHost(self, known_hosts) * */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_KnownHostError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 684, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_KnownHostError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 699, __pyx_L1_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, 684, __pyx_L1_error) + __PYX_ERR(0, 699, __pyx_L1_error) - /* "ssh2/session.pyx":683 + /* "ssh2/session.pyx":698 * known_hosts = c_ssh2.libssh2_knownhost_init( * self._session) * if known_hosts is NULL: # <<<<<<<<<<<<<< @@ -9267,7 +9277,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_72knownhost_init(struct __pyx_ */ } - /* "ssh2/session.pyx":685 + /* "ssh2/session.pyx":700 * if known_hosts is NULL: * raise KnownHostError * return PyKnownHost(self, known_hosts) # <<<<<<<<<<<<<< @@ -9275,13 +9285,13 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_72knownhost_init(struct __pyx_ * def keepalive_config(self, bint want_reply, unsigned interval): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = ((PyObject *)__pyx_f_4ssh2_9knownhost_PyKnownHost(__pyx_v_self, __pyx_v_known_hosts)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 685, __pyx_L1_error) + __pyx_t_2 = ((PyObject *)__pyx_f_4ssh2_9knownhost_PyKnownHost(__pyx_v_self, __pyx_v_known_hosts)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 700, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":675 + /* "ssh2/session.pyx":690 * return key, key_type * * def knownhost_init(self): # <<<<<<<<<<<<<< @@ -9300,7 +9310,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_72knownhost_init(struct __pyx_ return __pyx_r; } -/* "ssh2/session.pyx":687 +/* "ssh2/session.pyx":702 * return PyKnownHost(self, known_hosts) * * def keepalive_config(self, bint want_reply, unsigned interval): # <<<<<<<<<<<<<< @@ -9343,11 +9353,11 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_75keepalive_config(PyObject *_ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_interval)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("keepalive_config", 1, 2, 2, 1); __PYX_ERR(0, 687, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("keepalive_config", 1, 2, 2, 1); __PYX_ERR(0, 702, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "keepalive_config") < 0)) __PYX_ERR(0, 687, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "keepalive_config") < 0)) __PYX_ERR(0, 702, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -9355,12 +9365,12 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_75keepalive_config(PyObject *_ values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } - __pyx_v_want_reply = __Pyx_PyObject_IsTrue(values[0]); if (unlikely((__pyx_v_want_reply == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 687, __pyx_L3_error) - __pyx_v_interval = __Pyx_PyInt_As_unsigned_int(values[1]); if (unlikely((__pyx_v_interval == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 687, __pyx_L3_error) + __pyx_v_want_reply = __Pyx_PyObject_IsTrue(values[0]); if (unlikely((__pyx_v_want_reply == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 702, __pyx_L3_error) + __pyx_v_interval = __Pyx_PyInt_As_unsigned_int(values[1]); if (unlikely((__pyx_v_interval == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 702, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("keepalive_config", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 687, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("keepalive_config", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 702, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.session.Session.keepalive_config", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -9378,7 +9388,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_74keepalive_config(struct __py __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("keepalive_config", 0); - /* "ssh2/session.pyx":697 + /* "ssh2/session.pyx":712 * keepalives. * :type interval: int""" * with nogil: # <<<<<<<<<<<<<< @@ -9393,7 +9403,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_74keepalive_config(struct __py #endif /*try:*/ { - /* "ssh2/session.pyx":698 + /* "ssh2/session.pyx":713 * :type interval: int""" * with nogil: * c_ssh2.libssh2_keepalive_config(self._session, want_reply, interval) # <<<<<<<<<<<<<< @@ -9403,7 +9413,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_74keepalive_config(struct __py libssh2_keepalive_config(__pyx_v_self->_session, __pyx_v_want_reply, __pyx_v_interval); } - /* "ssh2/session.pyx":697 + /* "ssh2/session.pyx":712 * keepalives. * :type interval: int""" * with nogil: # <<<<<<<<<<<<<< @@ -9422,7 +9432,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_74keepalive_config(struct __py } } - /* "ssh2/session.pyx":687 + /* "ssh2/session.pyx":702 * return PyKnownHost(self, known_hosts) * * def keepalive_config(self, bint want_reply, unsigned interval): # <<<<<<<<<<<<<< @@ -9437,7 +9447,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_74keepalive_config(struct __py return __pyx_r; } -/* "ssh2/session.pyx":700 +/* "ssh2/session.pyx":715 * c_ssh2.libssh2_keepalive_config(self._session, want_reply, interval) * * def keepalive_send(self): # <<<<<<<<<<<<<< @@ -9472,7 +9482,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_76keepalive_send(struct __pyx_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("keepalive_send", 0); - /* "ssh2/session.pyx":706 + /* "ssh2/session.pyx":721 * * :rtype: int""" * cdef int seconds = 0 # <<<<<<<<<<<<<< @@ -9481,7 +9491,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_76keepalive_send(struct __pyx_ */ __pyx_v_seconds = 0; - /* "ssh2/session.pyx":707 + /* "ssh2/session.pyx":722 * :rtype: int""" * cdef int seconds = 0 * cdef int c_seconds = 0 # <<<<<<<<<<<<<< @@ -9490,7 +9500,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_76keepalive_send(struct __pyx_ */ __pyx_v_c_seconds = 0; - /* "ssh2/session.pyx":709 + /* "ssh2/session.pyx":724 * cdef int c_seconds = 0 * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -9505,7 +9515,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_76keepalive_send(struct __pyx_ #endif /*try:*/ { - /* "ssh2/session.pyx":710 + /* "ssh2/session.pyx":725 * cdef int rc * with nogil: * rc = c_ssh2.libssh2_keepalive_send(self._session, &c_seconds) # <<<<<<<<<<<<<< @@ -9515,7 +9525,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_76keepalive_send(struct __pyx_ __pyx_v_rc = libssh2_keepalive_send(__pyx_v_self->_session, (&__pyx_v_c_seconds)); } - /* "ssh2/session.pyx":709 + /* "ssh2/session.pyx":724 * cdef int c_seconds = 0 * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -9534,27 +9544,27 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_76keepalive_send(struct __pyx_ } } - /* "ssh2/session.pyx":711 + /* "ssh2/session.pyx":726 * with nogil: * rc = c_ssh2.libssh2_keepalive_send(self._session, &c_seconds) * handle_error_codes(rc) # <<<<<<<<<<<<<< * return c_seconds */ - __pyx_t_1 = __pyx_f_4ssh2_5utils_handle_error_codes(__pyx_v_rc, 0); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 711, __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, 726, __pyx_L1_error) - /* "ssh2/session.pyx":712 + /* "ssh2/session.pyx":727 * rc = c_ssh2.libssh2_keepalive_send(self._session, &c_seconds) * handle_error_codes(rc) * return c_seconds # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_c_seconds); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 712, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_c_seconds); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 727, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":700 + /* "ssh2/session.pyx":715 * c_ssh2.libssh2_keepalive_config(self._session, want_reply, interval) * * def keepalive_send(self): # <<<<<<<<<<<<<< @@ -10116,7 +10126,12 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_KnownHostError, __pyx_k_KnownHostError, sizeof(__pyx_k_KnownHostError), 0, 0, 1, 1}, {&__pyx_n_s_LIBSSH2_HOSTKEY_HASH_MD5, __pyx_k_LIBSSH2_HOSTKEY_HASH_MD5, sizeof(__pyx_k_LIBSSH2_HOSTKEY_HASH_MD5), 0, 0, 1, 1}, {&__pyx_n_s_LIBSSH2_HOSTKEY_HASH_SHA1, __pyx_k_LIBSSH2_HOSTKEY_HASH_SHA1, sizeof(__pyx_k_LIBSSH2_HOSTKEY_HASH_SHA1), 0, 0, 1, 1}, + {&__pyx_n_s_LIBSSH2_HOSTKEY_HASH_SHA256, __pyx_k_LIBSSH2_HOSTKEY_HASH_SHA256, sizeof(__pyx_k_LIBSSH2_HOSTKEY_HASH_SHA256), 0, 0, 1, 1}, {&__pyx_n_s_LIBSSH2_HOSTKEY_TYPE_DSS, __pyx_k_LIBSSH2_HOSTKEY_TYPE_DSS, sizeof(__pyx_k_LIBSSH2_HOSTKEY_TYPE_DSS), 0, 0, 1, 1}, + {&__pyx_n_s_LIBSSH2_HOSTKEY_TYPE_ECDSA_256, __pyx_k_LIBSSH2_HOSTKEY_TYPE_ECDSA_256, sizeof(__pyx_k_LIBSSH2_HOSTKEY_TYPE_ECDSA_256), 0, 0, 1, 1}, + {&__pyx_n_s_LIBSSH2_HOSTKEY_TYPE_ECDSA_384, __pyx_k_LIBSSH2_HOSTKEY_TYPE_ECDSA_384, sizeof(__pyx_k_LIBSSH2_HOSTKEY_TYPE_ECDSA_384), 0, 0, 1, 1}, + {&__pyx_n_s_LIBSSH2_HOSTKEY_TYPE_ECDSA_521, __pyx_k_LIBSSH2_HOSTKEY_TYPE_ECDSA_521, sizeof(__pyx_k_LIBSSH2_HOSTKEY_TYPE_ECDSA_521), 0, 0, 1, 1}, + {&__pyx_n_s_LIBSSH2_HOSTKEY_TYPE_ED25519, __pyx_k_LIBSSH2_HOSTKEY_TYPE_ED25519, sizeof(__pyx_k_LIBSSH2_HOSTKEY_TYPE_ED25519), 0, 0, 1, 1}, {&__pyx_n_s_LIBSSH2_HOSTKEY_TYPE_RSA, __pyx_k_LIBSSH2_HOSTKEY_TYPE_RSA, sizeof(__pyx_k_LIBSSH2_HOSTKEY_TYPE_RSA), 0, 0, 1, 1}, {&__pyx_n_s_LIBSSH2_HOSTKEY_TYPE_UNKNOWN, __pyx_k_LIBSSH2_HOSTKEY_TYPE_UNKNOWN, sizeof(__pyx_k_LIBSSH2_HOSTKEY_TYPE_UNKNOWN), 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}, @@ -10174,8 +10189,8 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {0, 0, 0, 0, 0, 0, 0} }; static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 65, __pyx_L1_error) - __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(0, 79, __pyx_L1_error) + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 80, __pyx_L1_error) + __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(0, 94, __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:; @@ -10186,14 +10201,14 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - /* "ssh2/session.pyx":303 + /* "ssh2/session.pyx":318 * cdef const char *_username = b_username * * def passwd(): # <<<<<<<<<<<<<< * return password * */ - __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ssh2_session_pyx, __pyx_n_s_passwd, 303, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__3)) __PYX_ERR(0, 303, __pyx_L1_error) + __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ssh2_session_pyx, __pyx_n_s_passwd, 318, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__3)) __PYX_ERR(0, 318, __pyx_L1_error) /* "(tree fragment)":2 * def __reduce_cython__(self): @@ -10268,17 +10283,17 @@ static int __Pyx_modinit_type_init_code(void) { int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ - if (PyType_Ready(&__pyx_type_4ssh2_7session_Session) < 0) __PYX_ERR(0, 71, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_4ssh2_7session_Session) < 0) __PYX_ERR(0, 86, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_4ssh2_7session_Session.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4ssh2_7session_Session.tp_dictoffset && __pyx_type_4ssh2_7session_Session.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_4ssh2_7session_Session.tp_getattro = __Pyx_PyObject_GenericGetAttr; } - if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Session, (PyObject *)&__pyx_type_4ssh2_7session_Session) < 0) __PYX_ERR(0, 71, __pyx_L1_error) - if (__Pyx_setup_reduce((PyObject*)&__pyx_type_4ssh2_7session_Session) < 0) __PYX_ERR(0, 71, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Session, (PyObject *)&__pyx_type_4ssh2_7session_Session) < 0) __PYX_ERR(0, 86, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_4ssh2_7session_Session) < 0) __PYX_ERR(0, 86, __pyx_L1_error) __pyx_ptype_4ssh2_7session_Session = &__pyx_type_4ssh2_7session_Session; - if (PyType_Ready(&__pyx_type_4ssh2_7session___pyx_scope_struct__userauth_keyboardinteractive) < 0) __PYX_ERR(0, 290, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_4ssh2_7session___pyx_scope_struct__userauth_keyboardinteractive) < 0) __PYX_ERR(0, 305, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_4ssh2_7session___pyx_scope_struct__userauth_keyboardinteractive.tp_print = 0; #endif @@ -10674,7 +10689,7 @@ if (!__Pyx_RefNanny) { * * LIBSSH2_SESSION_BLOCK_INBOUND = c_ssh2.LIBSSH2_SESSION_BLOCK_INBOUND # <<<<<<<<<<<<<< * LIBSSH2_SESSION_BLOCK_OUTBOUND = c_ssh2.LIBSSH2_SESSION_BLOCK_OUTBOUND - * LIBSSH2_HOSTKEY_HASH_MD5 = c_ssh2.LIBSSH2_HOSTKEY_HASH_MD5 + * */ __pyx_t_2 = __Pyx_PyInt_From_int(LIBSSH2_SESSION_BLOCK_INBOUND); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); @@ -10685,72 +10700,132 @@ if (!__Pyx_RefNanny) { * * LIBSSH2_SESSION_BLOCK_INBOUND = c_ssh2.LIBSSH2_SESSION_BLOCK_INBOUND * LIBSSH2_SESSION_BLOCK_OUTBOUND = c_ssh2.LIBSSH2_SESSION_BLOCK_OUTBOUND # <<<<<<<<<<<<<< + * * LIBSSH2_HOSTKEY_HASH_MD5 = c_ssh2.LIBSSH2_HOSTKEY_HASH_MD5 - * LIBSSH2_HOSTKEY_HASH_SHA1 = c_ssh2.LIBSSH2_HOSTKEY_HASH_SHA1 */ __pyx_t_2 = __Pyx_PyInt_From_int(LIBSSH2_SESSION_BLOCK_OUTBOUND); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_SESSION_BLOCK_OUTBOUND, __pyx_t_2) < 0) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "ssh2/session.pyx":43 - * LIBSSH2_SESSION_BLOCK_INBOUND = c_ssh2.LIBSSH2_SESSION_BLOCK_INBOUND + /* "ssh2/session.pyx":44 * LIBSSH2_SESSION_BLOCK_OUTBOUND = c_ssh2.LIBSSH2_SESSION_BLOCK_OUTBOUND + * * LIBSSH2_HOSTKEY_HASH_MD5 = c_ssh2.LIBSSH2_HOSTKEY_HASH_MD5 # <<<<<<<<<<<<<< * LIBSSH2_HOSTKEY_HASH_SHA1 = c_ssh2.LIBSSH2_HOSTKEY_HASH_SHA1 - * LIBSSH2_HOSTKEY_TYPE_UNKNOWN = c_ssh2.LIBSSH2_HOSTKEY_TYPE_UNKNOWN + * IF EMBEDDED_LIB: */ - __pyx_t_2 = __Pyx_PyInt_From_int(LIBSSH2_HOSTKEY_HASH_MD5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 43, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(LIBSSH2_HOSTKEY_HASH_MD5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_HOSTKEY_HASH_MD5, __pyx_t_2) < 0) __PYX_ERR(0, 43, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_HOSTKEY_HASH_MD5, __pyx_t_2) < 0) __PYX_ERR(0, 44, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "ssh2/session.pyx":44 - * LIBSSH2_SESSION_BLOCK_OUTBOUND = c_ssh2.LIBSSH2_SESSION_BLOCK_OUTBOUND + /* "ssh2/session.pyx":45 + * * LIBSSH2_HOSTKEY_HASH_MD5 = c_ssh2.LIBSSH2_HOSTKEY_HASH_MD5 * LIBSSH2_HOSTKEY_HASH_SHA1 = c_ssh2.LIBSSH2_HOSTKEY_HASH_SHA1 # <<<<<<<<<<<<<< - * LIBSSH2_HOSTKEY_TYPE_UNKNOWN = c_ssh2.LIBSSH2_HOSTKEY_TYPE_UNKNOWN - * LIBSSH2_HOSTKEY_TYPE_RSA = c_ssh2.LIBSSH2_HOSTKEY_TYPE_RSA + * IF EMBEDDED_LIB: + * LIBSSH2_HOSTKEY_HASH_SHA256 = c_ssh2.LIBSSH2_HOSTKEY_HASH_SHA256 */ - __pyx_t_2 = __Pyx_PyInt_From_int(LIBSSH2_HOSTKEY_HASH_SHA1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 44, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(LIBSSH2_HOSTKEY_HASH_SHA1); 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_LIBSSH2_HOSTKEY_HASH_SHA1, __pyx_t_2) < 0) __PYX_ERR(0, 44, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_HOSTKEY_HASH_SHA1, __pyx_t_2) < 0) __PYX_ERR(0, 45, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "ssh2/session.pyx":45 - * LIBSSH2_HOSTKEY_HASH_MD5 = c_ssh2.LIBSSH2_HOSTKEY_HASH_MD5 + /* "ssh2/session.pyx":47 * LIBSSH2_HOSTKEY_HASH_SHA1 = c_ssh2.LIBSSH2_HOSTKEY_HASH_SHA1 + * IF EMBEDDED_LIB: + * LIBSSH2_HOSTKEY_HASH_SHA256 = c_ssh2.LIBSSH2_HOSTKEY_HASH_SHA256 # <<<<<<<<<<<<<< + * LIBSSH2_HOSTKEY_TYPE_ECDSA_256 = c_ssh2.LIBSSH2_HOSTKEY_TYPE_ECDSA_256 + * LIBSSH2_HOSTKEY_TYPE_ECDSA_384 = c_ssh2.LIBSSH2_HOSTKEY_TYPE_ECDSA_384 + */ + __pyx_t_2 = __Pyx_PyInt_From_int(LIBSSH2_HOSTKEY_HASH_SHA256); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_HOSTKEY_HASH_SHA256, __pyx_t_2) < 0) __PYX_ERR(0, 47, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "ssh2/session.pyx":48 + * IF EMBEDDED_LIB: + * LIBSSH2_HOSTKEY_HASH_SHA256 = c_ssh2.LIBSSH2_HOSTKEY_HASH_SHA256 + * LIBSSH2_HOSTKEY_TYPE_ECDSA_256 = c_ssh2.LIBSSH2_HOSTKEY_TYPE_ECDSA_256 # <<<<<<<<<<<<<< + * LIBSSH2_HOSTKEY_TYPE_ECDSA_384 = c_ssh2.LIBSSH2_HOSTKEY_TYPE_ECDSA_384 + * LIBSSH2_HOSTKEY_TYPE_ECDSA_521 = c_ssh2.LIBSSH2_HOSTKEY_TYPE_ECDSA_521 + */ + __pyx_t_2 = __Pyx_PyInt_From_int(LIBSSH2_HOSTKEY_TYPE_ECDSA_256); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 48, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_HOSTKEY_TYPE_ECDSA_256, __pyx_t_2) < 0) __PYX_ERR(0, 48, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "ssh2/session.pyx":49 + * LIBSSH2_HOSTKEY_HASH_SHA256 = c_ssh2.LIBSSH2_HOSTKEY_HASH_SHA256 + * LIBSSH2_HOSTKEY_TYPE_ECDSA_256 = c_ssh2.LIBSSH2_HOSTKEY_TYPE_ECDSA_256 + * LIBSSH2_HOSTKEY_TYPE_ECDSA_384 = c_ssh2.LIBSSH2_HOSTKEY_TYPE_ECDSA_384 # <<<<<<<<<<<<<< + * LIBSSH2_HOSTKEY_TYPE_ECDSA_521 = c_ssh2.LIBSSH2_HOSTKEY_TYPE_ECDSA_521 + * LIBSSH2_HOSTKEY_TYPE_ED25519 = c_ssh2.LIBSSH2_HOSTKEY_TYPE_ED25519 + */ + __pyx_t_2 = __Pyx_PyInt_From_int(LIBSSH2_HOSTKEY_TYPE_ECDSA_384); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 49, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_HOSTKEY_TYPE_ECDSA_384, __pyx_t_2) < 0) __PYX_ERR(0, 49, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "ssh2/session.pyx":50 + * LIBSSH2_HOSTKEY_TYPE_ECDSA_256 = c_ssh2.LIBSSH2_HOSTKEY_TYPE_ECDSA_256 + * LIBSSH2_HOSTKEY_TYPE_ECDSA_384 = c_ssh2.LIBSSH2_HOSTKEY_TYPE_ECDSA_384 + * LIBSSH2_HOSTKEY_TYPE_ECDSA_521 = c_ssh2.LIBSSH2_HOSTKEY_TYPE_ECDSA_521 # <<<<<<<<<<<<<< + * LIBSSH2_HOSTKEY_TYPE_ED25519 = c_ssh2.LIBSSH2_HOSTKEY_TYPE_ED25519 + * ELSE: + */ + __pyx_t_2 = __Pyx_PyInt_From_int(LIBSSH2_HOSTKEY_TYPE_ECDSA_521); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 50, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_HOSTKEY_TYPE_ECDSA_521, __pyx_t_2) < 0) __PYX_ERR(0, 50, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "ssh2/session.pyx":51 + * LIBSSH2_HOSTKEY_TYPE_ECDSA_384 = c_ssh2.LIBSSH2_HOSTKEY_TYPE_ECDSA_384 + * LIBSSH2_HOSTKEY_TYPE_ECDSA_521 = c_ssh2.LIBSSH2_HOSTKEY_TYPE_ECDSA_521 + * LIBSSH2_HOSTKEY_TYPE_ED25519 = c_ssh2.LIBSSH2_HOSTKEY_TYPE_ED25519 # <<<<<<<<<<<<<< + * ELSE: + * LIBSSH2_HOSTKEY_HASH_SHA256 = None + */ + __pyx_t_2 = __Pyx_PyInt_From_int(LIBSSH2_HOSTKEY_TYPE_ED25519); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 51, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_HOSTKEY_TYPE_ED25519, __pyx_t_2) < 0) __PYX_ERR(0, 51, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "ssh2/session.pyx":60 + * LIBSSH2_HOSTKEY_TYPE_ED25519 = None + * * LIBSSH2_HOSTKEY_TYPE_UNKNOWN = c_ssh2.LIBSSH2_HOSTKEY_TYPE_UNKNOWN # <<<<<<<<<<<<<< * LIBSSH2_HOSTKEY_TYPE_RSA = c_ssh2.LIBSSH2_HOSTKEY_TYPE_RSA * LIBSSH2_HOSTKEY_TYPE_DSS = c_ssh2.LIBSSH2_HOSTKEY_TYPE_DSS */ - __pyx_t_2 = __Pyx_PyInt_From_int(LIBSSH2_HOSTKEY_TYPE_UNKNOWN); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 45, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(LIBSSH2_HOSTKEY_TYPE_UNKNOWN); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_HOSTKEY_TYPE_UNKNOWN, __pyx_t_2) < 0) __PYX_ERR(0, 45, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_HOSTKEY_TYPE_UNKNOWN, __pyx_t_2) < 0) __PYX_ERR(0, 60, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "ssh2/session.pyx":46 - * LIBSSH2_HOSTKEY_HASH_SHA1 = c_ssh2.LIBSSH2_HOSTKEY_HASH_SHA1 + /* "ssh2/session.pyx":61 + * * LIBSSH2_HOSTKEY_TYPE_UNKNOWN = c_ssh2.LIBSSH2_HOSTKEY_TYPE_UNKNOWN * LIBSSH2_HOSTKEY_TYPE_RSA = c_ssh2.LIBSSH2_HOSTKEY_TYPE_RSA # <<<<<<<<<<<<<< * LIBSSH2_HOSTKEY_TYPE_DSS = c_ssh2.LIBSSH2_HOSTKEY_TYPE_DSS * */ - __pyx_t_2 = __Pyx_PyInt_From_int(LIBSSH2_HOSTKEY_TYPE_RSA); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 46, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(LIBSSH2_HOSTKEY_TYPE_RSA); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_HOSTKEY_TYPE_RSA, __pyx_t_2) < 0) __PYX_ERR(0, 46, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_HOSTKEY_TYPE_RSA, __pyx_t_2) < 0) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "ssh2/session.pyx":47 + /* "ssh2/session.pyx":62 * LIBSSH2_HOSTKEY_TYPE_UNKNOWN = c_ssh2.LIBSSH2_HOSTKEY_TYPE_UNKNOWN * LIBSSH2_HOSTKEY_TYPE_RSA = c_ssh2.LIBSSH2_HOSTKEY_TYPE_RSA * LIBSSH2_HOSTKEY_TYPE_DSS = c_ssh2.LIBSSH2_HOSTKEY_TYPE_DSS # <<<<<<<<<<<<<< * * */ - __pyx_t_2 = __Pyx_PyInt_From_int(LIBSSH2_HOSTKEY_TYPE_DSS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 47, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(LIBSSH2_HOSTKEY_TYPE_DSS); 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_LIBSSH2_HOSTKEY_TYPE_DSS, __pyx_t_2) < 0) __PYX_ERR(0, 47, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_HOSTKEY_TYPE_DSS, __pyx_t_2) < 0) __PYX_ERR(0, 62, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "ssh2/session.pyx":1 diff --git a/ssh2/session.pyx b/ssh2/session.pyx index 31f3ce4a..66c40caf 100644 --- a/ssh2/session.pyx +++ b/ssh2/session.pyx @@ -40,8 +40,23 @@ cimport c_pkey LIBSSH2_SESSION_BLOCK_INBOUND = c_ssh2.LIBSSH2_SESSION_BLOCK_INBOUND LIBSSH2_SESSION_BLOCK_OUTBOUND = c_ssh2.LIBSSH2_SESSION_BLOCK_OUTBOUND + LIBSSH2_HOSTKEY_HASH_MD5 = c_ssh2.LIBSSH2_HOSTKEY_HASH_MD5 LIBSSH2_HOSTKEY_HASH_SHA1 = c_ssh2.LIBSSH2_HOSTKEY_HASH_SHA1 +IF EMBEDDED_LIB: + LIBSSH2_HOSTKEY_HASH_SHA256 = c_ssh2.LIBSSH2_HOSTKEY_HASH_SHA256 + LIBSSH2_HOSTKEY_TYPE_ECDSA_256 = c_ssh2.LIBSSH2_HOSTKEY_TYPE_ECDSA_256 + LIBSSH2_HOSTKEY_TYPE_ECDSA_384 = c_ssh2.LIBSSH2_HOSTKEY_TYPE_ECDSA_384 + LIBSSH2_HOSTKEY_TYPE_ECDSA_521 = c_ssh2.LIBSSH2_HOSTKEY_TYPE_ECDSA_521 + LIBSSH2_HOSTKEY_TYPE_ED25519 = c_ssh2.LIBSSH2_HOSTKEY_TYPE_ED25519 +ELSE: + LIBSSH2_HOSTKEY_HASH_SHA256 = None + LIBSSH2_HOSTKEY_HASH_SHA256 = None + LIBSSH2_HOSTKEY_TYPE_ECDSA_256 = None + LIBSSH2_HOSTKEY_TYPE_ECDSA_384 = None + LIBSSH2_HOSTKEY_TYPE_ECDSA_521 = None + LIBSSH2_HOSTKEY_TYPE_ED25519 = None + LIBSSH2_HOSTKEY_TYPE_UNKNOWN = c_ssh2.LIBSSH2_HOSTKEY_TYPE_UNKNOWN LIBSSH2_HOSTKEY_TYPE_RSA = c_ssh2.LIBSSH2_HOSTKEY_TYPE_RSA LIBSSH2_HOSTKEY_TYPE_DSS = c_ssh2.LIBSSH2_HOSTKEY_TYPE_DSS