diff --git a/.appveyor.yml b/.appveyor.yml index 535e191d..2edb16ff 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -1,3 +1,18 @@ +# This file is part of ssh2-python. +# Copyright (C) 2017-2021 Panos Kittenis and contributors. +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation, version 2.1. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA max_jobs: 5 build: parallel: true @@ -8,7 +23,6 @@ image: Visual Studio 2019 environment: global: PYTHONUNBUFFERED: 1 - EMBEDDED_LIB: 1 SYSTEM_LIBSSH2: 1 PYPI_USER: secure: WKF8ok0UPIgkA+isDUuHww== @@ -18,7 +32,7 @@ environment: PYTHON_DEF: "C:\\Python38-x64" PYTHON_VERSION: "3.8" # Python versions to build wheels for - PYTHONVERS: C:\Python36-x64 C:\Python37-x64 C:\Python38-x64 C:\Python39-x64 + PYTHONVERS: C:\Python36-x64 C:\Python37-x64 C:\Python38-x64 C:\Python39-x64 C:\Python310-x64 PYTHON_ARCH: "64" MSVC: "Visual Studio 16 2019" @@ -56,9 +70,7 @@ build_script: - for %%I in (%PYTHONVERS%) do ls %%I/libs/ - ci\\appveyor\\build_ssh2.bat - for %%I in (%PYTHONVERS%) do cp src/src/libssh2.lib %%I/libs/ || cp src/src/Release/libssh2.lib %%I/libs/ - - mv -f ssh2/find_eol.c . - rm -f ssh2/*.c - - mv -f find_eol.c ssh2/ - ps: ls ssh2 - for %%I in (%PYTHONVERS%) do %%I\python.exe -V - for %%I in (%PYTHONVERS%) do %%I\python.exe setup.py build_ext diff --git a/.circleci/config.yml b/.circleci/config.yml index d621cf3f..58508e64 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,3 +1,18 @@ +# This file is part of ssh2-python. +# Copyright (C) 2017-2021 Panos Kittenis and contributors. +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation, version 2.1. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA version: 2.1 orbs: @@ -31,6 +46,7 @@ jobs: name: Build - run: command: | + set -x ls -lhtr ssh2/ pwd pytest tests @@ -71,10 +87,10 @@ jobs: command: | twine upload --skip-existing -u $PYPI_USER -p $PYPI_PASSWORD wheels/* - manylinux: + manylinux-x86_64: machine: image: ubuntu-1604:201903-01 - steps: + steps: &manylinux-steps - checkout - python/load-cache: key: manylinuxdepsv6-{{ .Branch }}.{{ arch }} @@ -89,7 +105,8 @@ jobs: - run: name: Deps command: | - sudo apt-get install python-pip + sudo apt-get install python3-pip + pyenv global 3.7.0 || pyenv global 3.9.1 pip install -U pip pip install twine which twine @@ -102,7 +119,7 @@ jobs: if [[ -z "${CIRCLE_PULL_REQUEST}" ]]; then echo "$DOCKER_PASSWORD" | docker login -u="$DOCKER_USERNAME" --password-stdin; fi - ./ci/travis/build-manylinux.sh + ./ci/build-manylinux.sh - run: name: sdist command: python setup.py sdist @@ -115,39 +132,7 @@ jobs: machine: image: ubuntu-2004:202101-01 resource_class: arm.medium - steps: - - checkout - - python/load-cache: - key: manylinuxdepsv6-{{ .Branch }}.{{ arch }} - dependency-file: requirements_dev.txt - - run: - name: Git LFS - command: | - curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash - sudo apt-get install git-lfs - git lfs install - git lfs pull - - run: - name: Deps - command: | - sudo apt-get install python3-pip - pip3 install -U pip - pip3 install twine - which twine - - python/save-cache: - key: manylinuxdepsv6-{{ .Branch }}.{{ arch }} - dependency-file: requirements_dev.txt - - run: - name: Build Wheels - command: | - if [[ -z "${CIRCLE_PULL_REQUEST}" ]]; then - docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" ; - fi - ./ci/travis/build-manylinux.sh - - run: - name: Upload Wheels - command: | - twine upload --skip-existing -u $PYPI_USER -p $PYPI_PASSWORD dist/* wheelhouse/* + steps: *manylinux-steps workflows: version: 2.1 @@ -160,27 +145,26 @@ workflows: - "3.6" - "3.7" - "3.8" + - "3.9" + - "3.10" filters: tags: ignore: /.*/ - - manylinux: - context: Docker - filters: - tags: - only: /.*/ - branches: - ignore: /.*/ - - manylinux2014-aarch64: + - manylinux-x86_64: &manylinux-wf context: Docker filters: tags: only: /.*/ branches: ignore: /.*/ + - manylinux2014-aarch64: *manylinux-wf - osx: matrix: parameters: xcode_ver: + - "13.1.0" + - "13.0.0" + - "12.5.1" - "11.6.0" - "11.1.0" filters: diff --git a/.gitignore b/.gitignore index 8fc881aa..4512d2ff 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ wheelhouse .idea/ ssh2/libssh2.so* doc/_build +venv diff --git a/Changelog.rst b/Changelog.rst index abae63ae..87892e00 100644 --- a/Changelog.rst +++ b/Changelog.rst @@ -1,6 +1,28 @@ Change Log ============= +0.27.0 +++++++ + +Changes +------- + +* Python 3.10 support. + +Fixes +----- + +* Objects depending on ``ssh2.Session`` would sometimes cause segfault on interpreter shutdown. + +Packaging +--------- + +* Added manylinux-2014 ARM (aarch64) wheel builds - #156 - Thanks @enaydanov +* Added manylinux-2014 x86_64 wheels for all currently available Python 3 versions. +* Added Windows 3.10 wheels. +* Added OSX 11.6, 11.5 and 11.4 wheels. + + 0.26.0 ++++++ diff --git a/MANIFEST.in b/MANIFEST.in index 718e109c..5a368a16 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -7,5 +7,5 @@ exclude .travis.yml include LICENSE include ssh2/*.pyx include ssh2/*.pxd -include ssh2/find_eol* +include ssh2/ext/find_eol* include ssh2/*.c diff --git a/_setup_libssh2.py b/_setup_libssh2.py index d451d9d6..8b9d6c43 100644 --- a/_setup_libssh2.py +++ b/_setup_libssh2.py @@ -1,3 +1,18 @@ +# This file is part of ssh2-python. +# Copyright (C) 2017-2021 Panos Kittenis and contributors. +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation, version 2.1. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA import os from sys import stderr diff --git a/ci/binstar-push.py b/ci/binstar-push.py deleted file mode 100644 index 373af334..00000000 --- a/ci/binstar-push.py +++ /dev/null @@ -1,12 +0,0 @@ -import os -import glob -import subprocess -import traceback - -token = os.environ['BINSTAR_TOKEN'] -cmd = ['binstar', '-t', token, 'upload', '--force'] -cmd.extend(glob.glob('*.tar.bz2')) -try: - subprocess.check_call(cmd) -except subprocess.CalledProcessError: - traceback.print_exc() diff --git a/ci/build-manylinux.sh b/ci/build-manylinux.sh new file mode 100755 index 00000000..9e34790a --- /dev/null +++ b/ci/build-manylinux.sh @@ -0,0 +1,38 @@ +#!/bin/bash -xe +# This file is part of ssh2-python. +# Copyright (C) 2017-2021 Panos Kittenis and contributors. +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation, version 2.1. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +docker_tag="parallelssh/ssh2-manylinux" +docker_files=("ci/docker/manylinux/Dockerfile" "ci/docker/manylinux/Dockerfile.2014_x86_64") + +rm -rf build ssh2/libssh2.* ssh2/*.so +python ci/appveyor/fix_version.py . + +if [[ `uname -m` == "aarch64" ]]; then + docker_tag="${docker_tag}:aarch64" + docker_files=("ci/docker/manylinux/Dockerfile.aarch64") +fi + +for docker_file in ${docker_files[@]}; do + if [[ ${docker_file} == "ci/docker/manylinux/Dockerfile_2014_x86_64" ]]; then + docker_tag = "${docker_tag}:2014_x86_64" + fi + docker pull $docker_tag || echo + docker build --pull --cache-from $docker_tag ci/docker/manylinux -t $docker_tag -f ${docker_file} + if [[ -z "${CIRCLE_PULL_REQUEST}" ]]; then docker push $docker_tag; fi + docker run --rm -v `pwd`:/io $docker_tag /io/ci/build-wheels.sh + ls wheelhouse/ +done diff --git a/ci/build-wheels.sh b/ci/build-wheels.sh new file mode 100755 index 00000000..6c86dd69 --- /dev/null +++ b/ci/build-wheels.sh @@ -0,0 +1,38 @@ +#!/bin/bash -xe +# This file is part of ssh2-python. +# Copyright (C) 2017-2021 Panos Kittenis and contributors. +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation, version 2.1. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +echo "Travis tag: $TRAVIS_TAG" + +# Compile wheels +# For testing +# for PYBIN in `ls -1d /opt/python/cp36-cp36m/bin | grep -v cpython`; do +for PYBIN in `ls -1d /opt/python/*/bin | grep -v cpython`; do + "${PYBIN}/pip" wheel /io/ -w wheelhouse/ +done + +# Bundle external shared libraries into the wheels +for whl in wheelhouse/*.whl; do + auditwheel repair "$whl" -w /io/wheelhouse/ +done + +# Install packages and test +if [[ ! -z "$TRAVIS_TAG" ]]; then + for PYBIN in `ls -1d /opt/python/*/bin | grep -v cpython`; do + "${PYBIN}/pip" install ssh2-python --no-index -f /io/wheelhouse + (cd "$HOME"; "${PYBIN}/python" -c 'from ssh2.session import Session; Session()') + done +fi diff --git a/ci/copy_abi_dist.py b/ci/copy_abi_dist.py deleted file mode 100644 index 4b7b538f..00000000 --- a/ci/copy_abi_dist.py +++ /dev/null @@ -1,25 +0,0 @@ -from __future__ import print_function - -import os -from glob import glob -import re -import sys -import shutil - - -re_c = re.compile(r'.+-.+-.+-(.+)-.+\.') - - -def rename_dist_files(files): - for _file in glob(files): - match = re_c.match(_file) - abi = match.group(1) - new_file = _file.replace(abi, 'none') - print("Copying %s to new file %s" % (_file, new_file)) - shutil.copy2(_file, new_file) - -if __name__ == "__main__": - if len(sys.argv) < 2: - sys.stderr.write("Need files argument" + os.linesep) - sys.exit(1) - rename_dist_files(os.path.abspath(sys.argv[1])) diff --git a/ci/docker/build-packages.sh b/ci/docker/build-packages.sh deleted file mode 100755 index cab47e39..00000000 --- a/ci/docker/build-packages.sh +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/bash -xe - -for x in `ls -1d ci/docker/{fedora,centos}*`; do - name=`echo "$x" | awk -F/ '{print $3}'` - dist_num=`echo "$name" | sed -r 's/[a-z]+([0-9]+)/\1/'` - docker_tag="parallelssh/ssh2-python:$name" - if [[ $dist_num -gt 20 ]]; then - dist="fc${dist_num}" - else - dist="el${dist_num}" - fi - docker pull $docker_tag || echo - docker build --pull --cache-from $docker_tag $x -t $name - docker tag $name $docker_tag - # docker push $docker_tag - sudo rm -rf build dist - # Fix version used by versioneer to current git tag so the generated .c files - # do not cause a version change. - python ci/appveyor/fix_version.py . - # C files need re-generating - sudo rm -f ssh2/*.c - docker run -v "$(pwd):/src/" "$name" fpm --rpm-dist $dist -s python -t rpm -d libssh2 -d python setup.py -done - -for x in `ls -1d ci/docker/{debian,ubuntu}*`; do - name=`echo "$x" | awk -F/ '{print $3}' | awk -F. '{print $1}'` - docker_tag="parallelssh/ssh2-python:$name" - docker pull $docker_tag || echo - docker build --pull --cache-from $docker_tag $x -t $name - docker tag $name $docker_tag - # docker push $docker_tag - sudo rm -rf build dist - # Fix version used by versioneer to current git tag so the generated .c files - # do not cause a version change. - python ci/appveyor/fix_version.py . - # C files need re-generating - sudo rm -f ssh2/*.c - docker run -v "$(pwd):/src/" "$name" fpm --iteration $name -s python -t deb -d libssh2-1 -d python setup.py -done - -sudo chown -R ${USER} * - -ls -ltrh *.{rpm,deb} - -for x in *.rpm; do - echo "Package: $x" - rpm -qlp $x -done - -for x in *.deb; do - echo "Package: $x" - dpkg-deb -c $x -done - -echo "Modified files should be reset now -- run 'git checkout -- .' to do so for all files in the repository." diff --git a/ci/docker/centos7/Dockerfile b/ci/docker/centos7/Dockerfile deleted file mode 100644 index f38e6c05..00000000 --- a/ci/docker/centos7/Dockerfile +++ /dev/null @@ -1,8 +0,0 @@ -FROM cdrx/fpm-centos:7 - -RUN yum -y install libssh2-devel python-devel python-setuptools git -RUN curl -sLO https://bootstrap.pypa.io/get-pip.py && python get-pip.py && rm -f get-pip.py && pip install -U setuptools wheel && pip install cython - -ENV EMBEDDED_LIB 0 -ENV HAVE_AGENT_FWD 0 -ENV SYSTEM_LIBSSH2 1 diff --git a/ci/docker/debian8/Dockerfile b/ci/docker/debian8/Dockerfile deleted file mode 100644 index b76fc0db..00000000 --- a/ci/docker/debian8/Dockerfile +++ /dev/null @@ -1,10 +0,0 @@ -FROM cdrx/fpm-debian:8 - -RUN apt-get -y update && apt-get -y install python-setuptools python-dev libssh2-1-dev python-pip git -RUN pip install -U setuptools -RUN pip install -U pip wheel -RUN pip install cython - -ENV EMBEDDED_LIB 0 -ENV HAVE_AGENT_FWD 0 -ENV SYSTEM_LIBSSH2 1 diff --git a/ci/docker/fedora22/Dockerfile b/ci/docker/fedora22/Dockerfile deleted file mode 100644 index e8ebe2a4..00000000 --- a/ci/docker/fedora22/Dockerfile +++ /dev/null @@ -1,8 +0,0 @@ -FROM cdrx/fpm-fedora:22 - -RUN dnf -y install libssh2-devel python-devel python-setuptools git -RUN curl -sLO https://bootstrap.pypa.io/get-pip.py && python get-pip.py && rm -f get-pip.py && pip install -U setuptools wheel && pip install cython - -ENV EMBEDDED_LIB 0 -ENV HAVE_AGENT_FWD 0 -ENV SYSTEM_LIBSSH2 1 diff --git a/ci/docker/fedora23/Dockerfile b/ci/docker/fedora23/Dockerfile deleted file mode 100644 index 1e167b3e..00000000 --- a/ci/docker/fedora23/Dockerfile +++ /dev/null @@ -1,8 +0,0 @@ -FROM cdrx/fpm-fedora:23 - -RUN dnf -y install libssh2-devel python-devel python-setuptools git -RUN curl -sLO https://bootstrap.pypa.io/get-pip.py && python get-pip.py && rm -f get-pip.py && pip install -U setuptools wheel && pip install cython - -ENV EMBEDDED_LIB 0 -ENV HAVE_AGENT_FWD 0 -ENV SYSTEM_LIBSSH2 1 diff --git a/ci/docker/fedora24/Dockerfile b/ci/docker/fedora24/Dockerfile deleted file mode 100644 index b2dd9f8d..00000000 --- a/ci/docker/fedora24/Dockerfile +++ /dev/null @@ -1,8 +0,0 @@ -FROM cdrx/fpm-fedora:24 - -RUN dnf -y install libssh2-devel python-devel python-setuptools git -RUN curl -sLO https://bootstrap.pypa.io/get-pip.py && python get-pip.py && rm -f get-pip.py && pip install -U setuptools wheel && pip install cython - -ENV EMBEDDED_LIB 1 -ENV HAVE_AGENT_FWD 0 -ENV SYSTEM_LIBSSH2 1 diff --git a/ci/docker/manylinux/Dockerfile b/ci/docker/manylinux/Dockerfile index d9155799..d7dc6537 100644 --- a/ci/docker/manylinux/Dockerfile +++ b/ci/docker/manylinux/Dockerfile @@ -1,3 +1,18 @@ +# This file is part of ssh2-python. +# Copyright (C) 2017-2021 Panos Kittenis and contributors. +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation, version 2.1. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA FROM quay.io/pypa/manylinux2010_x86_64 ENV OPENSSL openssl-1.1.1g diff --git a/ci/docker/manylinux/Dockerfile.2014_x86_64 b/ci/docker/manylinux/Dockerfile.2014_x86_64 new file mode 100644 index 00000000..e6e1d3d9 --- /dev/null +++ b/ci/docker/manylinux/Dockerfile.2014_x86_64 @@ -0,0 +1,42 @@ +# This file is part of ssh2-python. +# Copyright (C) 2017-2021 Panos Kittenis and contributors. +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation, version 2.1. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +FROM quay.io/pypa/manylinux2014_x86_64 + +ENV OPENSSL openssl-1.1.1g +ENV SYSTEM_LIBSSH2 1 +ENV LIBSSH2_VERSION 1.9.0 + +RUN yum install zlib-devel -y + +ADD libssh2-${LIBSSH2_VERSION}.tar.gz libssh2-${LIBSSH2_VERSION}.tar.gz +ADD https://www.openssl.org/source/${OPENSSL}.tar.gz ${OPENSSL}.tar.gz + +RUN tar -xzf ${OPENSSL}.tar.gz +# Openssl +RUN cd ${OPENSSL} && \ + ./config --prefix=/usr --openssldir=/usr/openssl threads shared && \ + make -j4 && make install + +# Libssh2 +RUN mkdir -p build_libssh2 && cd build_libssh2 && \ + cmake ../libssh2-${LIBSSH2_VERSION}.tar.gz/libssh2-libssh2-${LIBSSH2_VERSION} \ + -DBUILD_SHARED_LIBS=ON -DENABLE_ZLIB_COMPRESSION=ON \ + -DENABLE_CRYPT_NONE=ON -DENABLE_MAC_NONE=ON -DCMAKE_INSTALL_PREFIX=/usr && \ + cmake --build . --config Release --target install + +RUN rm -rf ${OPENSSL}* build_libssh2 libssh2.tar.gz + +VOLUME /var/cache diff --git a/ci/docker/manylinux/Dockerfile.aarch64 b/ci/docker/manylinux/Dockerfile.aarch64 index 9111ae8a..cf7b51c6 100644 --- a/ci/docker/manylinux/Dockerfile.aarch64 +++ b/ci/docker/manylinux/Dockerfile.aarch64 @@ -1,3 +1,18 @@ +# This file is part of ssh2-python. +# Copyright (C) 2017-2021 Panos Kittenis and contributors. +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation, version 2.1. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA FROM quay.io/pypa/manylinux2014_aarch64 ENV OPENSSL openssl-1.1.1g diff --git a/ci/docker/ubuntu14.04/Dockerfile b/ci/docker/ubuntu14.04/Dockerfile deleted file mode 100644 index 2da3bcae..00000000 --- a/ci/docker/ubuntu14.04/Dockerfile +++ /dev/null @@ -1,10 +0,0 @@ -FROM cdrx/fpm-ubuntu:14.04 - -RUN apt-get -y update && apt-get -y install python-setuptools python-dev libssh2-1-dev python-pip git -RUN pip install -U setuptools -RUN pip install -U pip wheel -RUN pip install cython - -ENV EMBEDDED_LIB 0 -ENV HAVE_AGENT_FWD 0 -ENV SYSTEM_LIBSSH2 1 diff --git a/ci/docker/ubuntu16.04/Dockerfile b/ci/docker/ubuntu16.04/Dockerfile deleted file mode 100644 index 08712ca3..00000000 --- a/ci/docker/ubuntu16.04/Dockerfile +++ /dev/null @@ -1,10 +0,0 @@ -FROM cdrx/fpm-ubuntu:16.04 - -RUN apt-get -y update && apt-get -y install python-setuptools python-dev libssh2-1-dev python-pip git -RUN pip install -U setuptools -RUN pip install -U pip wheel -RUN pip install cython - -ENV EMBEDDED_LIB 0 -ENV HAVE_AGENT_FWD 0 -ENV SYSTEM_LIBSSH2 1 diff --git a/ci/docker/ubuntu18.04/Dockerfile b/ci/docker/ubuntu18.04/Dockerfile deleted file mode 100644 index afb166f3..00000000 --- a/ci/docker/ubuntu18.04/Dockerfile +++ /dev/null @@ -1,10 +0,0 @@ -FROM cdrx/fpm-ubuntu:18.04 - -RUN apt-get -y update && apt-get -y install python-setuptools python-dev libssh2-1-dev python-pip git -RUN pip install -U setuptools -RUN pip install -U pip wheel -RUN pip install cython - -ENV EMBEDDED_LIB 1 -ENV HAVE_AGENT_FWD 0 -ENV SYSTEM_LIBSSH2 1 diff --git a/ci/move-conda-package.py b/ci/move-conda-package.py deleted file mode 100644 index e55e4392..00000000 --- a/ci/move-conda-package.py +++ /dev/null @@ -1,13 +0,0 @@ -import os -import glob -import shutil -from conda_build.config import Config - -binary_package_glob = os.path.join(Config().bldpkgs_dir, '*.tar.bz2') - -try: - binary_package = glob.glob(binary_package_glob)[0] -except IndexError: - pass -else: - shutil.move(binary_package, '.') diff --git a/ci/osx-wheel.sh b/ci/osx-wheel.sh index 6014eee8..69eeac18 100755 --- a/ci/osx-wheel.sh +++ b/ci/osx-wheel.sh @@ -1,4 +1,19 @@ #!/bin/bash -xe +# This file is part of ssh2-python. +# Copyright (C) 2017-2021 Panos Kittenis and contributors. +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation, version 2.1. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA pip3 install -U virtualenv python3 -m virtualenv -p "$(which python3)" venv @@ -20,7 +35,7 @@ ls -l wheels/*.whl rm -f /usr/local/lib/libssh2* pip3 install -v wheels/*.whl pwd; mkdir -p temp; cd temp; pwd -python3 -c "from ssh2.session import Session; Session()" && echo "Import successfull" +python3 -c "from ssh2.session import Session; Session()" && echo "Import successful" cd ..; pwd set +x deactivate diff --git a/ci/travis/build-manylinux.sh b/ci/travis/build-manylinux.sh deleted file mode 100755 index 2ecea948..00000000 --- a/ci/travis/build-manylinux.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -xe - -docker_tag="parallelssh/ssh2-manylinux" -docker_file="ci/docker/manylinux/Dockerfile" - -rm -rf build ssh2/libssh2.* -python ci/appveyor/fix_version.py . - -if [[ `uname -m` == "aarch64" ]]; then - docker_tag=${docker_tag}-aarch64 - docker_file=${docker_file}.aarch64 -fi - -docker pull $docker_tag || echo -docker build --cache-from $docker_tag ci/docker/manylinux -t $docker_tag -f ${docker_file} -if [[ "$TRAVIS_PULL_REQUEST" == "false" ]]; then docker push $docker_tag; fi -docker run -e TRAVIS_TAG="$TRAVIS_TAG" --rm -v `pwd`:/io $docker_tag /io/ci/travis/build-wheels.sh -ls wheelhouse/ diff --git a/ci/travis/build-wheels.sh b/ci/travis/build-wheels.sh deleted file mode 100755 index 3e0d9e8d..00000000 --- a/ci/travis/build-wheels.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash -xe - -echo "Travis tag: $TRAVIS_TAG" - -# Compile wheels -# For testing -# for PYBIN in `ls -1d /opt/python/cp27-cp27m/bin | grep -v cpython`; do -for PYBIN in `ls -1d /opt/python/*/bin | grep -v cpython`; do - "${PYBIN}/pip" wheel /io/ -w wheelhouse/ -done - -# Bundle external shared libraries into the wheels -for whl in wheelhouse/*.whl; do - auditwheel repair "$whl" -w /io/wheelhouse/ -done - -# Install packages and test -if [[ ! -z "$TRAVIS_TAG" ]]; then - for PYBIN in `ls -1d /opt/python/*/bin | grep -v cpython`; do - "${PYBIN}/pip" install ssh2-python --no-index -f /io/wheelhouse - (cd "$HOME"; "${PYBIN}/python" -c 'from ssh2.session import Session; Session()') - done -fi diff --git a/ci/travis/pyenv-wheel.sh b/ci/travis/pyenv-wheel.sh deleted file mode 100755 index e23cbfef..00000000 --- a/ci/travis/pyenv-wheel.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/bash -xe - -brew install pyenv || brew outdated pyenv || brew upgrade pyenv - -export PYENV_VERSION=${PYENV:-3.6.4} -if [[ ! -d "$HOME/.pyenv/versions/$PYENV_VERSION" ]]; then - pyenv install $PYENV_VERSION -fi -pyenv global $PYENV_VERSION -pyenv versions - -set +x -eval "$(pyenv init -)" -set -x - -which python -python -m pip install -U virtualenv -python -m virtualenv -p "$(which python)" venv - -set +x -source venv/bin/activate -set -x - -python -V -python -m pip install -U setuptools pip -pip install -U delocate wheel -pip wheel . -cp /usr/local/lib/libssh2* . -delocate-listdeps --all *.whl -delocate-wheel -v *.whl -delocate-listdeps --all *.whl - -ls -l *.whl -rm -f *.dylib -pip install -v *.whl -pwd; mkdir -p temp; cd temp; pwd -python -c "from ssh2.session import Session; Session()" && echo "Import successfull" -cd ..; pwd -set +x -deactivate -set -x - -mv -f *.whl wheels/ -ls -lh wheels diff --git a/ci/travis/setup-pyenv.sh b/ci/travis/setup-pyenv.sh deleted file mode 100755 index 67e5b511..00000000 --- a/ci/travis/setup-pyenv.sh +++ /dev/null @@ -1,180 +0,0 @@ -#!/usr/bin/env bash -# NOTE: This script needs to be sourced so it can modify the environment. -# -# Environment variables that can be set: -# - PYENV_VERSION -# Python to install [required] -# - PYENV_VERSION_STRING -# String to `grep -F` against the output of `python --version` to validate -# that the correct Python was installed (recommended) [default: none] -# - PYENV_ROOT -# Directory in which to install pyenv [default: ~/.travis-pyenv] -# - PYENV_RELEASE -# Release tag of pyenv to download [default: clone from master] -# - PYENV_CACHE_PATH -# Directory where full Python builds are cached (i.e., for Travis) -# - VIRTUALENV_EXTRA_ARGS -# Extra arguments to be used when creating the virtualenv - -# PYENV_ROOT is exported because pyenv uses it -export PYENV_ROOT="${PYENV_ROOT:-$HOME/.travis-pyenv}" -PYENV_CACHE_PATH="${PYENV_CACHE_PATH:-$HOME/.pyenv_cache}" -version_cache_path="$PYENV_CACHE_PATH/$PYENV_VERSION" -version_pyenv_path="$PYENV_ROOT/versions/$PYENV_VERSION" - -# Functions -# -# verify_python -- attempts to call the Python command or binary -# supplied in the first argument with the --version flag. If -# PYENV_VERSION_STRING is set, then it validates the returned version string -# as well (using grep -F). Returns whatever status code the command returns. -verify_python() { - local python_bin="$1"; shift - - if [[ -n "$PYENV_VERSION_STRING" ]]; then - "$python_bin" --version 2>&1 | grep -F "$PYENV_VERSION_STRING" &>/dev/null - else - "$python_bin" --version &>/dev/null - fi -} - -# use_existing_python -- checks if there's already an installed -# PYENV_VERSION Python (i.e. if it's in the Travis base image) and verifying -# that works. Returns 0 if it finds one and it verifies, otherwise returns 1. -use_existing_python() { - if [[ -d "$version_pyenv_path" ]]; then - printf "Python %s already installed. Verifying..." "$PYENV_VERSION" - if verify_python "$version_pyenv_path/bin/python"; then - printf "success!\n" - return 0 - else - printf "FAILED.\nClearing installed version..." - rm -f "$version_pyenv_path" - printf "done.\n" - return 1 - fi - else - echo "No existing python found" - return 1 - fi -} - -# use_cached_python -- Tries symlinking to the cached PYENV_VERSION and -# verifying that it's a working build. Returns 0 if it's found and it -# verifies, otherwise returns 1. -use_cached_python() { - if [[ -d "$version_cache_path" ]]; then - printf "Cached python found, %s. Verifying..." "$PYENV_VERSION" - ln -s "$version_cache_path" "$version_pyenv_path" - if verify_python "$version_pyenv_path/bin/python"; then - printf "success!\n" - return 0 - else - printf "FAILED.\nClearing cached version..." - rm -f "$version_pyenv_path" - rm -rf "$version_cache_path" - printf "done.\n" - return 1 - fi - else - echo "No cached python found." - return 1 - fi -} - -# output_debugging_info -- Outputs useful debugging information -output_debugging_info() { - echo "**** Debugging information" - printf "PYENV_VERSION\n%s\n" "$PYENV_VERSION" - printf "PYENV_VERSION_STRING\n%s\n" "$PYENV_VERSION_STRING" - printf "PYENV_CACHE_PATH\n%s\n" "$PYENV_CACHE_PATH" - set -x - python --version - "$version_cache_path/bin/python" --version - which python - pyenv which python - set +x -} - -# Main script begins. - -if [[ -z "$PYENV_VERSION" ]]; then - echo "PYENV_VERSION is not set. Not installing a pyenv." - return 0 -fi - -# Get out of the virtualenv we're in (if we're in one). -[[ -z "$VIRTUAL_ENV" ]] || deactivate - -# Install pyenv -echo "**** Installing pyenv." -if [[ -n "$PYENV_RELEASE" ]]; then - # Fetch the release archive from Github (slightly faster than cloning) - mkdir "$PYENV_ROOT" - curl -fsSL "https://github.com/pyenv/pyenv/archive/$PYENV_RELEASE.tar.gz" \ - | tar -xz -C "$PYENV_ROOT" --strip-components 1 -else - # Don't have a release to fetch, so just clone directly - git clone --depth 1 https://github.com/pyenv/pyenv.git "$PYENV_ROOT" -fi - -export PATH="$PYENV_ROOT/bin:$PATH" -eval "$(pyenv init -)" - -# Make sure the cache directory exists -mkdir -p "$PYENV_CACHE_PATH" - -pyenv install --list - -# Try using an already cached/installed PYENV_VERSION. If it fails or is not found, -# then install from scratch. -echo "**** Trying to find and use cached python $PYENV_VERSION." -if ! use_existing_python && ! use_cached_python; then - echo "**** Installing python $PYENV_VERSION with pyenv now." - if pyenv install "$PYENV_VERSION"; then - if mv "$version_pyenv_path" "$PYENV_CACHE_PATH"; then - echo "Python was successfully built and moved to cache." - echo "**** Trying to find and use cached python $PYENV_VERSION." - if ! use_cached_python; then - echo "Python version $PYENV_VERSION was apparently successfully built" - echo "with pyenv, but, once cached, it could not be verified." - output_debugging_info - return 1 - fi - else - echo "**** Warning: Python was succesfully built, but moving to cache" - echo "failed. Proceeding anyway without caching." - fi - else - echo "Python version $PYENV_VERSION build FAILED." - return 1 - fi -fi - -# Now we have to reinitialize pyenv, as we need the shims etc to be created so -# the pyenv activates correctly. -echo "**** Activating python $PYENV_VERSION and generating new virtualenv." -eval "$(pyenv init -)" -pyenv global "$PYENV_VERSION" - -# Make sure virtualenv is installed and up-to-date... -pip install -U virtualenv - -# Then make and source a new virtualenv -VIRTUAL_ENV="$HOME/ve-pyenv-$PYENV_VERSION" - -# shellcheck disable=SC2086 -# We deliberately want to not quote "VIRTUALENV_EXTRA_ARGS" because it's extra arguments which should be split -virtualenv -p "$(which python)" ${VIRTUALENV_EXTRA_ARGS:-} "$VIRTUAL_ENV" - -# shellcheck source=/dev/null -source "$VIRTUAL_ENV/bin/activate" - -printf "One final verification that the virtualenv is working..." -if verify_python "python"; then - printf "success!\n" -else - printf "FAILED!\n" - output_debugging_info - return 1 -fi diff --git a/conda-recipe/meta.yaml b/conda-recipe/meta.yaml deleted file mode 100644 index e427257a..00000000 --- a/conda-recipe/meta.yaml +++ /dev/null @@ -1,58 +0,0 @@ -{% set name = "ssh2-python" %} -{% set version = GIT_DESCRIBE_TAG %} - -package: - name: {{ name|lower }} - version: {{ version }} - -source: - git_url: https://github.com/ParallelSSH/ssh2-python.git - -build: - features: - - vc9 # [win and py27] - - vc10 # [win and py34] - - vc14 # [win and py35] - number: 0 - script: - - rm -f ssh2/*.c - - EMBEDDED_LIB=1 python setup.py install --single-version-externally-managed --record record.txt # [unix] - - python setup.py build_ext --compiler=msvc # [win] - - python setup.py install --single-version-externally-managed --record record.txt # [win] - -requirements: - build: - - python - - cython - - setuptools - - gcc # [unix] - - libssh2 - - openssl 1.0.* - run: - - python - - libssh2 - - gcc # [unix] - - openssl 1.0.* - -test: - imports: - - ssh2.session - -about: - home: http://github.com/ParallelSSH/ssh2-python - license: LGPL-2.1 - license_family: LGPL - license_file: LICENSE - summary: 'Super fact SSH library. Based on libssh2.' - - description: | - Super fast SSH2 protocol library. - - ssh2-python provides Python bindings for libssh2. - - Its only dependency is the libssh2 library. - dev_url: https://github.com/ParallelSSH/ssh2-python - -extra: - recipe-maintainers: - - pkittenis diff --git a/conda-recipe/run_test.py b/conda-recipe/run_test.py deleted file mode 100644 index e6482051..00000000 --- a/conda-recipe/run_test.py +++ /dev/null @@ -1,4 +0,0 @@ -from ssh2.session import Session -from ssh2.channel import Channel -s = Session() -c = Channel(s) diff --git a/setup.py b/setup.py index c0509103..4200d41a 100644 --- a/setup.py +++ b/setup.py @@ -47,7 +47,6 @@ # _comp_args = ["-ggdb"] _fwd_default = 0 _comp_args = ["-O2"] if not ON_WINDOWS else None -_embedded_lib = bool(int(os.environ.get('EMBEDDED_LIB', 1))) _have_agent_fwd = bool(int(os.environ.get('HAVE_AGENT_FWD', _fwd_default))) cython_directives = {'embedsignature': True, @@ -59,7 +58,6 @@ cython_args = { 'cython_directives': cython_directives, 'cython_compile_time_env': { - 'EMBEDDED_LIB': _embedded_lib, 'HAVE_AGENT_FWD': _have_agent_fwd, }} \ if USING_CYTHON else {} @@ -82,13 +80,13 @@ library_dirs=[_lib_dir], runtime_library_dirs=runtime_library_dirs, extra_compile_args=_comp_args, - **cython_args - ) + **cython_args, + ) for i in range(len(sources))] for ext in extensions: if ext.name == 'ssh2.utils': - ext.sources.append('ssh2/find_eol.c') + ext.sources.append('ssh2/ext/find_eol.c') package_data = {'ssh2': ['*.pxd', 'libssh2.so*']} @@ -110,7 +108,7 @@ license='LGPLv2', author='Panos Kittenis', author_email='22e889d8@opayq.com', - description=('Super fast SSH library - bindings for libssh2'), + description='Bindings for libssh2 C library', long_description=open('README.rst').read(), packages=find_packages( '.', exclude=('embedded_server', 'embedded_server.*', diff --git a/ssh2/agent.c b/ssh2/agent.c index 0576dfa0..b7b402d2 100644 --- a/ssh2/agent.c +++ b/ssh2/agent.c @@ -619,7 +619,7 @@ static CYTHON_INLINE float __PYX_NAN() { #include #include #include "libssh2.h" -#include "find_eol.h" +#include "ext/find_eol.h" #ifdef _OPENMP #include #endif /* _OPENMP */ @@ -2623,7 +2623,7 @@ static int __pyx_pf_4ssh2_5agent_5Agent___cinit__(struct __pyx_obj_4ssh2_5agent_ * self._session = session * * def __dealloc__(self): # <<<<<<<<<<<<<< - * with nogil: + * if self._session is not None and self._session._session is not NULL and self._agent is not NULL: * clear_agent(self._agent) */ @@ -2640,57 +2640,68 @@ static void __pyx_pw_4ssh2_5agent_5Agent_3__dealloc__(PyObject *__pyx_v_self) { static void __pyx_pf_4ssh2_5agent_5Agent_2__dealloc__(struct __pyx_obj_4ssh2_5agent_Agent *__pyx_v_self) { __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; __Pyx_RefNannySetupContext("__dealloc__", 0); /* "ssh2/agent.pyx":107 * * def __dealloc__(self): - * with nogil: # <<<<<<<<<<<<<< + * if self._session is not None and self._session._session is not NULL and self._agent is not NULL: # <<<<<<<<<<<<<< * clear_agent(self._agent) - * + * self._agent = NULL */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - __Pyx_FastGIL_Remember(); - #endif - /*try:*/ { + __pyx_t_2 = (((PyObject *)__pyx_v_self->_session) != Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + } else { + __pyx_t_1 = __pyx_t_3; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_3 = ((__pyx_v_self->_session->_session != NULL) != 0); + if (__pyx_t_3) { + } else { + __pyx_t_1 = __pyx_t_3; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_3 = ((__pyx_v_self->_agent != NULL) != 0); + __pyx_t_1 = __pyx_t_3; + __pyx_L4_bool_binop_done:; + if (__pyx_t_1) { - /* "ssh2/agent.pyx":108 + /* "ssh2/agent.pyx":108 * def __dealloc__(self): - * with nogil: + * if self._session is not None and self._session._session is not NULL and self._agent is not NULL: * clear_agent(self._agent) # <<<<<<<<<<<<<< + * self._agent = NULL * - * def list_identities(self): */ - __pyx_f_4ssh2_5agent_clear_agent(__pyx_v_self->_agent); - } + __pyx_f_4ssh2_5agent_clear_agent(__pyx_v_self->_agent); - /* "ssh2/agent.pyx":107 + /* "ssh2/agent.pyx":107 * * def __dealloc__(self): - * with nogil: # <<<<<<<<<<<<<< + * if self._session is not None and self._session._session is not NULL and self._agent is not NULL: # <<<<<<<<<<<<<< * clear_agent(self._agent) - * + * self._agent = NULL */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - __Pyx_FastGIL_Forget(); - Py_BLOCK_THREADS - #endif - goto __pyx_L5; - } - __pyx_L5:; - } } + /* "ssh2/agent.pyx":109 + * if self._session is not None and self._session._session is not NULL and self._agent is not NULL: + * clear_agent(self._agent) + * self._agent = NULL # <<<<<<<<<<<<<< + * + * def list_identities(self): + */ + __pyx_v_self->_agent = NULL; + /* "ssh2/agent.pyx":106 * self._session = session * * def __dealloc__(self): # <<<<<<<<<<<<<< - * with nogil: + * if self._session is not None and self._session._session is not NULL and self._agent is not NULL: * clear_agent(self._agent) */ @@ -2698,8 +2709,8 @@ static void __pyx_pf_4ssh2_5agent_5Agent_2__dealloc__(struct __pyx_obj_4ssh2_5ag __Pyx_RefNannyFinishContext(); } -/* "ssh2/agent.pyx":110 - * clear_agent(self._agent) +/* "ssh2/agent.pyx":111 + * self._agent = NULL * * def list_identities(self): # <<<<<<<<<<<<<< * """This method is a no-op - use @@ -2732,7 +2743,7 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_4list_identities(CYTHON_UNUSED str return __pyx_r; } -/* "ssh2/agent.pyx":116 +/* "ssh2/agent.pyx":117 * pass * * def get_identities(self): # <<<<<<<<<<<<<< @@ -2770,19 +2781,19 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_6get_identities(struct __pyx_obj_4 int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_identities", 0); - /* "ssh2/agent.pyx":121 + /* "ssh2/agent.pyx":122 * :rtype: list(:py:class:`ssh2.pkey.PublicKey`)""" * cdef int rc * cdef list identities = [] # <<<<<<<<<<<<<< * cdef c_ssh2.libssh2_agent_publickey *identity = NULL * cdef c_ssh2.libssh2_agent_publickey *prev = NULL */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 121, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_identities = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/agent.pyx":122 + /* "ssh2/agent.pyx":123 * cdef int rc * cdef list identities = [] * cdef c_ssh2.libssh2_agent_publickey *identity = NULL # <<<<<<<<<<<<<< @@ -2791,7 +2802,7 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_6get_identities(struct __pyx_obj_4 */ __pyx_v_identity = NULL; - /* "ssh2/agent.pyx":123 + /* "ssh2/agent.pyx":124 * cdef list identities = [] * cdef c_ssh2.libssh2_agent_publickey *identity = NULL * cdef c_ssh2.libssh2_agent_publickey *prev = NULL # <<<<<<<<<<<<<< @@ -2800,7 +2811,7 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_6get_identities(struct __pyx_obj_4 */ __pyx_v_prev = NULL; - /* "ssh2/agent.pyx":124 + /* "ssh2/agent.pyx":125 * cdef c_ssh2.libssh2_agent_publickey *identity = NULL * cdef c_ssh2.libssh2_agent_publickey *prev = NULL * if c_ssh2.libssh2_agent_list_identities(self._agent) != 0: # <<<<<<<<<<<<<< @@ -2810,14 +2821,14 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_6get_identities(struct __pyx_obj_4 __pyx_t_2 = ((libssh2_agent_list_identities(__pyx_v_self->_agent) != 0) != 0); if (unlikely(__pyx_t_2)) { - /* "ssh2/agent.pyx":125 + /* "ssh2/agent.pyx":126 * cdef c_ssh2.libssh2_agent_publickey *prev = NULL * if c_ssh2.libssh2_agent_list_identities(self._agent) != 0: * raise AgentListIdentitiesError( # <<<<<<<<<<<<<< * "Failure requesting identities from agent." * "Agent must be connected first") */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_AgentListIdentitiesError); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 125, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_AgentListIdentitiesError); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { @@ -2831,14 +2842,14 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_6get_identities(struct __pyx_obj_4 } __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_kp_s_Failure_requesting_identities_fr_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_s_Failure_requesting_identities_fr_2); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 125, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(1, 125, __pyx_L1_error) + __PYX_ERR(1, 126, __pyx_L1_error) - /* "ssh2/agent.pyx":124 + /* "ssh2/agent.pyx":125 * cdef c_ssh2.libssh2_agent_publickey *identity = NULL * cdef c_ssh2.libssh2_agent_publickey *prev = NULL * if c_ssh2.libssh2_agent_list_identities(self._agent) != 0: # <<<<<<<<<<<<<< @@ -2847,7 +2858,7 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_6get_identities(struct __pyx_obj_4 */ } - /* "ssh2/agent.pyx":128 + /* "ssh2/agent.pyx":129 * "Failure requesting identities from agent." * "Agent must be connected first") * while c_ssh2.libssh2_agent_get_identity( # <<<<<<<<<<<<<< @@ -2856,7 +2867,7 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_6get_identities(struct __pyx_obj_4 */ while (1) { - /* "ssh2/agent.pyx":129 + /* "ssh2/agent.pyx":130 * "Agent must be connected first") * while c_ssh2.libssh2_agent_get_identity( * self._agent, &identity, prev) == 0: # <<<<<<<<<<<<<< @@ -2866,19 +2877,19 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_6get_identities(struct __pyx_obj_4 __pyx_t_2 = ((libssh2_agent_get_identity(__pyx_v_self->_agent, (&__pyx_v_identity), __pyx_v_prev) == 0) != 0); if (!__pyx_t_2) break; - /* "ssh2/agent.pyx":130 + /* "ssh2/agent.pyx":131 * while c_ssh2.libssh2_agent_get_identity( * self._agent, &identity, prev) == 0: * identities.append(PyPublicKey(identity)) # <<<<<<<<<<<<<< * prev = identity * return identities */ - __pyx_t_1 = __pyx_f_4ssh2_4pkey_PyPublicKey(__pyx_v_identity); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 130, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_4pkey_PyPublicKey(__pyx_v_identity); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_identities, __pyx_t_1); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 130, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_identities, __pyx_t_1); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 131, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/agent.pyx":131 + /* "ssh2/agent.pyx":132 * self._agent, &identity, prev) == 0: * identities.append(PyPublicKey(identity)) * prev = identity # <<<<<<<<<<<<<< @@ -2888,7 +2899,7 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_6get_identities(struct __pyx_obj_4 __pyx_v_prev = __pyx_v_identity; } - /* "ssh2/agent.pyx":132 + /* "ssh2/agent.pyx":133 * identities.append(PyPublicKey(identity)) * prev = identity * return identities # <<<<<<<<<<<<<< @@ -2900,7 +2911,7 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_6get_identities(struct __pyx_obj_4 __pyx_r = __pyx_v_identities; goto __pyx_L0; - /* "ssh2/agent.pyx":116 + /* "ssh2/agent.pyx":117 * pass * * def get_identities(self): # <<<<<<<<<<<<<< @@ -2922,7 +2933,7 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_6get_identities(struct __pyx_obj_4 return __pyx_r; } -/* "ssh2/agent.pyx":134 +/* "ssh2/agent.pyx":135 * return identities * * def userauth(self, username not None, # <<<<<<<<<<<<<< @@ -2965,11 +2976,11 @@ static PyObject *__pyx_pw_4ssh2_5agent_5Agent_9userauth(PyObject *__pyx_v_self, case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pkey)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("userauth", 1, 2, 2, 1); __PYX_ERR(1, 134, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("userauth", 1, 2, 2, 1); __PYX_ERR(1, 135, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "userauth") < 0)) __PYX_ERR(1, 134, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "userauth") < 0)) __PYX_ERR(1, 135, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -2982,16 +2993,16 @@ static PyObject *__pyx_pw_4ssh2_5agent_5Agent_9userauth(PyObject *__pyx_v_self, } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("userauth", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 134, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("userauth", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 135, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.agent.Agent.userauth", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(((PyObject *)__pyx_v_username) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "username"); __PYX_ERR(1, 134, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "username"); __PYX_ERR(1, 135, __pyx_L1_error) } - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pkey), __pyx_ptype_4ssh2_4pkey_PublicKey, 1, "pkey", 0))) __PYX_ERR(1, 135, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pkey), __pyx_ptype_4ssh2_4pkey_PublicKey, 1, "pkey", 0))) __PYX_ERR(1, 136, __pyx_L1_error) __pyx_r = __pyx_pf_4ssh2_5agent_5Agent_8userauth(((struct __pyx_obj_4ssh2_5agent_Agent *)__pyx_v_self), __pyx_v_username, __pyx_v_pkey); /* function exit code */ @@ -3021,19 +3032,19 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_8userauth(struct __pyx_obj_4ssh2_5 int __pyx_clineno = 0; __Pyx_RefNannySetupContext("userauth", 0); - /* "ssh2/agent.pyx":148 + /* "ssh2/agent.pyx":149 * :rtype: int""" * cdef int rc * cdef bytes b_username = to_bytes(username) # <<<<<<<<<<<<<< * cdef char *_username = b_username * with nogil: */ - __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_username); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 148, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_username); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_b_username = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/agent.pyx":149 + /* "ssh2/agent.pyx":150 * cdef int rc * cdef bytes b_username = to_bytes(username) * cdef char *_username = b_username # <<<<<<<<<<<<<< @@ -3042,12 +3053,12 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_8userauth(struct __pyx_obj_4ssh2_5 */ if (unlikely(__pyx_v_b_username == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(1, 149, __pyx_L1_error) + __PYX_ERR(1, 150, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_username); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(1, 149, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_username); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(1, 150, __pyx_L1_error) __pyx_v__username = __pyx_t_2; - /* "ssh2/agent.pyx":150 + /* "ssh2/agent.pyx":151 * cdef bytes b_username = to_bytes(username) * cdef char *_username = b_username * with nogil: # <<<<<<<<<<<<<< @@ -3062,7 +3073,7 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_8userauth(struct __pyx_obj_4ssh2_5 #endif /*try:*/ { - /* "ssh2/agent.pyx":151 + /* "ssh2/agent.pyx":152 * cdef char *_username = b_username * with nogil: * rc = c_ssh2.libssh2_agent_userauth( # <<<<<<<<<<<<<< @@ -3071,7 +3082,7 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_8userauth(struct __pyx_obj_4ssh2_5 */ __pyx_v_rc = libssh2_agent_userauth(__pyx_v_self->_agent, __pyx_v__username, __pyx_v_pkey->_pkey); - /* "ssh2/agent.pyx":153 + /* "ssh2/agent.pyx":154 * rc = c_ssh2.libssh2_agent_userauth( * self._agent, _username, pkey._pkey) * if rc != 0 and rc != c_ssh2.LIBSSH2_ERROR_EAGAIN: # <<<<<<<<<<<<<< @@ -3089,7 +3100,7 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_8userauth(struct __pyx_obj_4ssh2_5 } if (__pyx_t_3) { - /* "ssh2/agent.pyx":154 + /* "ssh2/agent.pyx":155 * self._agent, _username, pkey._pkey) * if rc != 0 and rc != c_ssh2.LIBSSH2_ERROR_EAGAIN: * with gil: # <<<<<<<<<<<<<< @@ -3102,17 +3113,17 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_8userauth(struct __pyx_obj_4ssh2_5 #endif /*try:*/ { - /* "ssh2/agent.pyx":155 + /* "ssh2/agent.pyx":156 * if rc != 0 and rc != c_ssh2.LIBSSH2_ERROR_EAGAIN: * with gil: * raise AgentAuthenticationError( # <<<<<<<<<<<<<< * "Error authenticating user %s with provided public key", * username) */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_AgentAuthenticationError); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 155, __pyx_L8_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_AgentAuthenticationError); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 156, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_4); - /* "ssh2/agent.pyx":157 + /* "ssh2/agent.pyx":158 * raise AgentAuthenticationError( * "Error authenticating user %s with provided public key", * username) # <<<<<<<<<<<<<< @@ -3134,7 +3145,7 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_8userauth(struct __pyx_obj_4ssh2_5 #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_kp_s_Error_authenticating_user_s_with, __pyx_v_username}; - __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(1, 155, __pyx_L8_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(1, 156, __pyx_L8_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_1); } else @@ -3142,13 +3153,13 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_8userauth(struct __pyx_obj_4ssh2_5 #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_kp_s_Error_authenticating_user_s_with, __pyx_v_username}; - __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(1, 155, __pyx_L8_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(1, 156, __pyx_L8_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(1, 155, __pyx_L8_error) + __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 156, __pyx_L8_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; @@ -3159,17 +3170,17 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_8userauth(struct __pyx_obj_4ssh2_5 __Pyx_INCREF(__pyx_v_username); __Pyx_GIVEREF(__pyx_v_username); PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_username); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 155, __pyx_L8_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 156, __pyx_L8_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(1, 155, __pyx_L8_error) + __PYX_ERR(1, 156, __pyx_L8_error) } - /* "ssh2/agent.pyx":154 + /* "ssh2/agent.pyx":155 * self._agent, _username, pkey._pkey) * if rc != 0 and rc != c_ssh2.LIBSSH2_ERROR_EAGAIN: * with gil: # <<<<<<<<<<<<<< @@ -3186,7 +3197,7 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_8userauth(struct __pyx_obj_4ssh2_5 } } - /* "ssh2/agent.pyx":153 + /* "ssh2/agent.pyx":154 * rc = c_ssh2.libssh2_agent_userauth( * self._agent, _username, pkey._pkey) * if rc != 0 and rc != c_ssh2.LIBSSH2_ERROR_EAGAIN: # <<<<<<<<<<<<<< @@ -3196,7 +3207,7 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_8userauth(struct __pyx_obj_4ssh2_5 } } - /* "ssh2/agent.pyx":150 + /* "ssh2/agent.pyx":151 * cdef bytes b_username = to_bytes(username) * cdef char *_username = b_username * with nogil: # <<<<<<<<<<<<<< @@ -3222,7 +3233,7 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_8userauth(struct __pyx_obj_4ssh2_5 } } - /* "ssh2/agent.pyx":158 + /* "ssh2/agent.pyx":159 * "Error authenticating user %s with provided public key", * username) * return rc # <<<<<<<<<<<<<< @@ -3230,13 +3241,13 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_8userauth(struct __pyx_obj_4ssh2_5 * def disconnect(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 158, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/agent.pyx":134 + /* "ssh2/agent.pyx":135 * return identities * * def userauth(self, username not None, # <<<<<<<<<<<<<< @@ -3259,7 +3270,7 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_8userauth(struct __pyx_obj_4ssh2_5 return __pyx_r; } -/* "ssh2/agent.pyx":160 +/* "ssh2/agent.pyx":161 * return rc * * def disconnect(self): # <<<<<<<<<<<<<< @@ -3291,7 +3302,7 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_10disconnect(struct __pyx_obj_4ssh int __pyx_clineno = 0; __Pyx_RefNannySetupContext("disconnect", 0); - /* "ssh2/agent.pyx":165 + /* "ssh2/agent.pyx":166 * :rtype: int""" * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -3306,7 +3317,7 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_10disconnect(struct __pyx_obj_4ssh #endif /*try:*/ { - /* "ssh2/agent.pyx":166 + /* "ssh2/agent.pyx":167 * cdef int rc * with nogil: * rc = c_ssh2.libssh2_agent_disconnect(self._agent) # <<<<<<<<<<<<<< @@ -3316,7 +3327,7 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_10disconnect(struct __pyx_obj_4ssh __pyx_v_rc = libssh2_agent_disconnect(__pyx_v_self->_agent); } - /* "ssh2/agent.pyx":165 + /* "ssh2/agent.pyx":166 * :rtype: int""" * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -3335,7 +3346,7 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_10disconnect(struct __pyx_obj_4ssh } } - /* "ssh2/agent.pyx":167 + /* "ssh2/agent.pyx":168 * with nogil: * rc = c_ssh2.libssh2_agent_disconnect(self._agent) * return rc # <<<<<<<<<<<<<< @@ -3343,13 +3354,13 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_10disconnect(struct __pyx_obj_4ssh * def connect(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 167, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 168, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/agent.pyx":160 + /* "ssh2/agent.pyx":161 * return rc * * def disconnect(self): # <<<<<<<<<<<<<< @@ -3368,7 +3379,7 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_10disconnect(struct __pyx_obj_4ssh return __pyx_r; } -/* "ssh2/agent.pyx":169 +/* "ssh2/agent.pyx":170 * return rc * * def connect(self): # <<<<<<<<<<<<<< @@ -3403,7 +3414,7 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_12connect(struct __pyx_obj_4ssh2_5 int __pyx_clineno = 0; __Pyx_RefNannySetupContext("connect", 0); - /* "ssh2/agent.pyx":177 + /* "ssh2/agent.pyx":178 * :rtype: int""" * cdef int rc * rc = c_ssh2.libssh2_agent_connect(self._agent) # <<<<<<<<<<<<<< @@ -3412,7 +3423,7 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_12connect(struct __pyx_obj_4ssh2_5 */ __pyx_v_rc = libssh2_agent_connect(__pyx_v_self->_agent); - /* "ssh2/agent.pyx":178 + /* "ssh2/agent.pyx":179 * cdef int rc * rc = c_ssh2.libssh2_agent_connect(self._agent) * if rc != 0: # <<<<<<<<<<<<<< @@ -3422,14 +3433,14 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_12connect(struct __pyx_obj_4ssh2_5 __pyx_t_1 = ((__pyx_v_rc != 0) != 0); if (unlikely(__pyx_t_1)) { - /* "ssh2/agent.pyx":179 + /* "ssh2/agent.pyx":180 * rc = c_ssh2.libssh2_agent_connect(self._agent) * if rc != 0: * raise AgentConnectionError("Unable to connect to agent") # <<<<<<<<<<<<<< * return rc * */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_AgentConnectionError); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 179, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_AgentConnectionError); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { @@ -3443,14 +3454,14 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_12connect(struct __pyx_obj_4ssh2_5 } __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_kp_s_Unable_to_connect_to_agent) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_s_Unable_to_connect_to_agent); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 179, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 180, __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(1, 179, __pyx_L1_error) + __PYX_ERR(1, 180, __pyx_L1_error) - /* "ssh2/agent.pyx":178 + /* "ssh2/agent.pyx":179 * cdef int rc * rc = c_ssh2.libssh2_agent_connect(self._agent) * if rc != 0: # <<<<<<<<<<<<<< @@ -3459,7 +3470,7 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_12connect(struct __pyx_obj_4ssh2_5 */ } - /* "ssh2/agent.pyx":180 + /* "ssh2/agent.pyx":181 * if rc != 0: * raise AgentConnectionError("Unable to connect to agent") * return rc # <<<<<<<<<<<<<< @@ -3467,13 +3478,13 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_12connect(struct __pyx_obj_4ssh2_5 * def get_identity_path(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 180, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "ssh2/agent.pyx":169 + /* "ssh2/agent.pyx":170 * return rc * * def connect(self): # <<<<<<<<<<<<<< @@ -3494,7 +3505,7 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_12connect(struct __pyx_obj_4ssh2_5 return __pyx_r; } -/* "ssh2/agent.pyx":182 +/* "ssh2/agent.pyx":183 * return rc * * def get_identity_path(self): # <<<<<<<<<<<<<< @@ -3528,7 +3539,7 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_14get_identity_path(struct __pyx_o int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_identity_path", 0); - /* "ssh2/agent.pyx":184 + /* "ssh2/agent.pyx":185 * def get_identity_path(self): * cdef bytes _path * cdef const char* c_path = NULL # <<<<<<<<<<<<<< @@ -3537,7 +3548,7 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_14get_identity_path(struct __pyx_o */ __pyx_v_c_path = NULL; - /* "ssh2/agent.pyx":185 + /* "ssh2/agent.pyx":186 * cdef bytes _path * cdef const char* c_path = NULL * with nogil: # <<<<<<<<<<<<<< @@ -3552,7 +3563,7 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_14get_identity_path(struct __pyx_o #endif /*try:*/ { - /* "ssh2/agent.pyx":186 + /* "ssh2/agent.pyx":187 * cdef const char* c_path = NULL * with nogil: * c_path = c_ssh2.libssh2_agent_get_identity_path(self._agent) # <<<<<<<<<<<<<< @@ -3562,7 +3573,7 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_14get_identity_path(struct __pyx_o __pyx_v_c_path = libssh2_agent_get_identity_path(__pyx_v_self->_agent); } - /* "ssh2/agent.pyx":185 + /* "ssh2/agent.pyx":186 * cdef bytes _path * cdef const char* c_path = NULL * with nogil: # <<<<<<<<<<<<<< @@ -3581,7 +3592,7 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_14get_identity_path(struct __pyx_o } } - /* "ssh2/agent.pyx":187 + /* "ssh2/agent.pyx":188 * with nogil: * c_path = c_ssh2.libssh2_agent_get_identity_path(self._agent) * if c_path is NULL: # <<<<<<<<<<<<<< @@ -3591,7 +3602,7 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_14get_identity_path(struct __pyx_o __pyx_t_1 = ((__pyx_v_c_path == NULL) != 0); if (__pyx_t_1) { - /* "ssh2/agent.pyx":188 + /* "ssh2/agent.pyx":189 * c_path = c_ssh2.libssh2_agent_get_identity_path(self._agent) * if c_path is NULL: * return # <<<<<<<<<<<<<< @@ -3602,7 +3613,7 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_14get_identity_path(struct __pyx_o __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "ssh2/agent.pyx":187 + /* "ssh2/agent.pyx":188 * with nogil: * c_path = c_ssh2.libssh2_agent_get_identity_path(self._agent) * if c_path is NULL: # <<<<<<<<<<<<<< @@ -3611,19 +3622,19 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_14get_identity_path(struct __pyx_o */ } - /* "ssh2/agent.pyx":189 + /* "ssh2/agent.pyx":190 * if c_path is NULL: * return * _path = c_path # <<<<<<<<<<<<<< * return _path * */ - __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_c_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 189, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_c_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v__path = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "ssh2/agent.pyx":190 + /* "ssh2/agent.pyx":191 * return * _path = c_path * return _path # <<<<<<<<<<<<<< @@ -3635,7 +3646,7 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_14get_identity_path(struct __pyx_o __pyx_r = __pyx_v__path; goto __pyx_L0; - /* "ssh2/agent.pyx":182 + /* "ssh2/agent.pyx":183 * return rc * * def get_identity_path(self): # <<<<<<<<<<<<<< @@ -3655,7 +3666,7 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_14get_identity_path(struct __pyx_o return __pyx_r; } -/* "ssh2/agent.pyx":192 +/* "ssh2/agent.pyx":193 * return _path * * def set_identity_path(self, path not None): # <<<<<<<<<<<<<< @@ -3674,7 +3685,7 @@ static PyObject *__pyx_pw_4ssh2_5agent_5Agent_17set_identity_path(PyObject *__py __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_identity_path (wrapper)", 0); if (unlikely(((PyObject *)__pyx_v_path) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "path"); __PYX_ERR(1, 192, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "path"); __PYX_ERR(1, 193, __pyx_L1_error) } __pyx_r = __pyx_pf_4ssh2_5agent_5Agent_16set_identity_path(((struct __pyx_obj_4ssh2_5agent_Agent *)__pyx_v_self), ((PyObject *)__pyx_v_path)); @@ -3699,19 +3710,19 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_16set_identity_path(struct __pyx_o int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_identity_path", 0); - /* "ssh2/agent.pyx":193 + /* "ssh2/agent.pyx":194 * * def set_identity_path(self, path not None): * cdef bytes b_path = to_bytes(path) # <<<<<<<<<<<<<< * cdef const char *c_path = b_path * with nogil: */ - __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 193, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_b_path = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/agent.pyx":194 + /* "ssh2/agent.pyx":195 * def set_identity_path(self, path not None): * cdef bytes b_path = to_bytes(path) * cdef const char *c_path = b_path # <<<<<<<<<<<<<< @@ -3720,12 +3731,12 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_16set_identity_path(struct __pyx_o */ if (unlikely(__pyx_v_b_path == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(1, 194, __pyx_L1_error) + __PYX_ERR(1, 195, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyBytes_AsString(__pyx_v_b_path); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(1, 194, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_AsString(__pyx_v_b_path); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(1, 195, __pyx_L1_error) __pyx_v_c_path = __pyx_t_2; - /* "ssh2/agent.pyx":195 + /* "ssh2/agent.pyx":196 * cdef bytes b_path = to_bytes(path) * cdef const char *c_path = b_path * with nogil: # <<<<<<<<<<<<<< @@ -3740,7 +3751,7 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_16set_identity_path(struct __pyx_o #endif /*try:*/ { - /* "ssh2/agent.pyx":196 + /* "ssh2/agent.pyx":197 * cdef const char *c_path = b_path * with nogil: * c_ssh2.libssh2_agent_set_identity_path( # <<<<<<<<<<<<<< @@ -3749,7 +3760,7 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_16set_identity_path(struct __pyx_o libssh2_agent_set_identity_path(__pyx_v_self->_agent, __pyx_v_c_path); } - /* "ssh2/agent.pyx":195 + /* "ssh2/agent.pyx":196 * cdef bytes b_path = to_bytes(path) * cdef const char *c_path = b_path * with nogil: # <<<<<<<<<<<<<< @@ -3768,7 +3779,7 @@ static PyObject *__pyx_pf_4ssh2_5agent_5Agent_16set_identity_path(struct __pyx_o } } - /* "ssh2/agent.pyx":192 + /* "ssh2/agent.pyx":193 * return _path * * def set_identity_path(self, path not None): # <<<<<<<<<<<<<< diff --git a/ssh2/agent.pyx b/ssh2/agent.pyx index b2f71a27..abf8ecf1 100644 --- a/ssh2/agent.pyx +++ b/ssh2/agent.pyx @@ -104,8 +104,9 @@ cdef class Agent: self._session = session def __dealloc__(self): - with nogil: + if self._session is not None and self._session._session is not NULL and self._agent is not NULL: clear_agent(self._agent) + self._agent = NULL def list_identities(self): """This method is a no-op - use diff --git a/ssh2/c_ssh2.pxd b/ssh2/c_ssh2.pxd index c4eac2c7..0785c467 100644 --- a/ssh2/c_ssh2.pxd +++ b/ssh2/c_ssh2.pxd @@ -36,23 +36,21 @@ cdef extern from "libssh2.h" nogil: LIBSSH2_HOSTKEY_TYPE_UNKNOWN LIBSSH2_HOSTKEY_TYPE_RSA LIBSSH2_HOSTKEY_TYPE_DSS - 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 - LIBSSH2_METHOD_KEX - LIBSSH2_METHOD_HOSTKEY - LIBSSH2_METHOD_CRYPT_CS - LIBSSH2_METHOD_CRYPT_SC - LIBSSH2_METHOD_MAC_CS - LIBSSH2_METHOD_MAC_SC - LIBSSH2_METHOD_COMP_CS - LIBSSH2_METHOD_COMP_SC - LIBSSH2_METHOD_LANG_CS - LIBSSH2_METHOD_LANG_SC + LIBSSH2_HOSTKEY_HASH_SHA256 + LIBSSH2_HOSTKEY_TYPE_ECDSA_256 + LIBSSH2_HOSTKEY_TYPE_ECDSA_384 + LIBSSH2_HOSTKEY_TYPE_ECDSA_521 + LIBSSH2_HOSTKEY_TYPE_ED25519 + LIBSSH2_METHOD_KEX + LIBSSH2_METHOD_HOSTKEY + LIBSSH2_METHOD_CRYPT_CS + LIBSSH2_METHOD_CRYPT_SC + LIBSSH2_METHOD_MAC_CS + LIBSSH2_METHOD_MAC_SC + LIBSSH2_METHOD_COMP_CS + LIBSSH2_METHOD_COMP_SC + LIBSSH2_METHOD_LANG_CS + LIBSSH2_METHOD_LANG_SC ctypedef struct_stat libssh2_struct_stat ctypedef struct LIBSSH2_USERAUTH_KBDINT_PROMPT: @@ -419,13 +417,11 @@ cdef extern from "libssh2.h" nogil: LIBSSH2_KNOWNHOST_KEY_RSA1 LIBSSH2_KNOWNHOST_KEY_SSHRSA 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 + 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 struct libssh2_agent_publickey: diff --git a/ssh2/channel.c b/ssh2/channel.c index cbb34ecd..64f2b56d 100644 --- a/ssh2/channel.c +++ b/ssh2/channel.c @@ -621,7 +621,7 @@ static CYTHON_INLINE float __PYX_NAN() { #include "libssh2.h" #include #include -#include "find_eol.h" +#include "ext/find_eol.h" #include "libssh2_sftp.h" #ifdef _OPENMP #include @@ -1563,7 +1563,7 @@ static int __pyx_pf_4ssh2_7channel_7Channel___cinit__(struct __pyx_obj_4ssh2_7ch * self._session = session * * def __dealloc__(self): # <<<<<<<<<<<<<< - * if self._channel is not NULL: + * if self._session is not None and self._session._session is not NULL and self._channel is not NULL: * c_ssh2.libssh2_channel_free(self._channel) */ @@ -1581,21 +1581,38 @@ static void __pyx_pw_4ssh2_7channel_7Channel_3__dealloc__(PyObject *__pyx_v_self static void __pyx_pf_4ssh2_7channel_7Channel_2__dealloc__(struct __pyx_obj_4ssh2_7channel_Channel *__pyx_v_self) { __Pyx_RefNannyDeclarations int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; __Pyx_RefNannySetupContext("__dealloc__", 0); /* "ssh2/channel.pyx":39 * * def __dealloc__(self): - * if self._channel is not NULL: # <<<<<<<<<<<<<< + * if self._session is not None and self._session._session is not NULL and self._channel is not NULL: # <<<<<<<<<<<<<< * c_ssh2.libssh2_channel_free(self._channel) * self._channel = NULL */ - __pyx_t_1 = ((__pyx_v_self->_channel != NULL) != 0); + __pyx_t_2 = (((PyObject *)__pyx_v_self->_session) != Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + } else { + __pyx_t_1 = __pyx_t_3; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_3 = ((__pyx_v_self->_session->_session != NULL) != 0); + if (__pyx_t_3) { + } else { + __pyx_t_1 = __pyx_t_3; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_3 = ((__pyx_v_self->_channel != NULL) != 0); + __pyx_t_1 = __pyx_t_3; + __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "ssh2/channel.pyx":40 * def __dealloc__(self): - * if self._channel is not NULL: + * if self._session is not None and self._session._session is not NULL and self._channel is not NULL: * c_ssh2.libssh2_channel_free(self._channel) # <<<<<<<<<<<<<< * self._channel = NULL * @@ -1605,14 +1622,14 @@ static void __pyx_pf_4ssh2_7channel_7Channel_2__dealloc__(struct __pyx_obj_4ssh2 /* "ssh2/channel.pyx":39 * * def __dealloc__(self): - * if self._channel is not NULL: # <<<<<<<<<<<<<< + * if self._session is not None and self._session._session is not NULL and self._channel is not NULL: # <<<<<<<<<<<<<< * c_ssh2.libssh2_channel_free(self._channel) * self._channel = NULL */ } /* "ssh2/channel.pyx":41 - * if self._channel is not NULL: + * if self._session is not None and self._session._session is not NULL and self._channel is not NULL: * c_ssh2.libssh2_channel_free(self._channel) * self._channel = NULL # <<<<<<<<<<<<<< * @@ -1624,7 +1641,7 @@ static void __pyx_pf_4ssh2_7channel_7Channel_2__dealloc__(struct __pyx_obj_4ssh2 * self._session = session * * def __dealloc__(self): # <<<<<<<<<<<<<< - * if self._channel is not NULL: + * if self._session is not None and self._session._session is not NULL and self._channel is not NULL: * c_ssh2.libssh2_channel_free(self._channel) */ diff --git a/ssh2/channel.pyx b/ssh2/channel.pyx index 2c25976a..4a530765 100644 --- a/ssh2/channel.pyx +++ b/ssh2/channel.pyx @@ -36,7 +36,7 @@ cdef class Channel: self._session = session def __dealloc__(self): - if self._channel is not NULL: + if self._session is not None and self._session._session is not NULL and self._channel is not NULL: c_ssh2.libssh2_channel_free(self._channel) self._channel = NULL diff --git a/ssh2/error_codes.c b/ssh2/error_codes.c index eafe14a1..82be6ede 100644 --- a/ssh2/error_codes.c +++ b/ssh2/error_codes.c @@ -2060,7 +2060,7 @@ if (!__Pyx_RefNanny) { * LIBSSH2_ERROR_SOCKET_RECV = error_codes._LIBSSH2_ERROR_SOCKET_RECV * LIBSSH2_ERROR_ENCRYPT = error_codes._LIBSSH2_ERROR_ENCRYPT # <<<<<<<<<<<<<< * LIBSSH2_ERROR_BAD_SOCKET = error_codes._LIBSSH2_ERROR_BAD_SOCKET - * IF EMBEDDED_LIB: + * LIBSSH2_ERROR_INVALID_MAC = error_codes._LIBSSH2_ERROR_INVALID_MAC */ __pyx_t_1 = __Pyx_PyInt_From_int(LIBSSH2_ERROR_ENCRYPT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -2071,82 +2071,82 @@ if (!__Pyx_RefNanny) { * LIBSSH2_ERROR_SOCKET_RECV = error_codes._LIBSSH2_ERROR_SOCKET_RECV * LIBSSH2_ERROR_ENCRYPT = error_codes._LIBSSH2_ERROR_ENCRYPT * LIBSSH2_ERROR_BAD_SOCKET = error_codes._LIBSSH2_ERROR_BAD_SOCKET # <<<<<<<<<<<<<< - * IF EMBEDDED_LIB: - * LIBSSH2_ERROR_INVALID_MAC = error_codes._LIBSSH2_ERROR_INVALID_MAC + * LIBSSH2_ERROR_INVALID_MAC = error_codes._LIBSSH2_ERROR_INVALID_MAC + * LIBSSH2_ERROR_KEX_FAILURE = error_codes._LIBSSH2_ERROR_KEX_FAILURE */ __pyx_t_1 = __Pyx_PyInt_From_int(LIBSSH2_ERROR_BAD_SOCKET); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_ERROR_BAD_SOCKET, __pyx_t_1) < 0) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/error_codes.pyx":76 + /* "ssh2/error_codes.pyx":75 + * LIBSSH2_ERROR_ENCRYPT = error_codes._LIBSSH2_ERROR_ENCRYPT * LIBSSH2_ERROR_BAD_SOCKET = error_codes._LIBSSH2_ERROR_BAD_SOCKET - * IF EMBEDDED_LIB: - * LIBSSH2_ERROR_INVALID_MAC = error_codes._LIBSSH2_ERROR_INVALID_MAC # <<<<<<<<<<<<<< - * LIBSSH2_ERROR_KEX_FAILURE = error_codes._LIBSSH2_ERROR_KEX_FAILURE - * LIBSSH2_ERROR_ALLOC = error_codes._LIBSSH2_ERROR_ALLOC + * LIBSSH2_ERROR_INVALID_MAC = error_codes._LIBSSH2_ERROR_INVALID_MAC # <<<<<<<<<<<<<< + * LIBSSH2_ERROR_KEX_FAILURE = error_codes._LIBSSH2_ERROR_KEX_FAILURE + * LIBSSH2_ERROR_ALLOC = error_codes._LIBSSH2_ERROR_ALLOC */ - __pyx_t_1 = __Pyx_PyInt_From_int(LIBSSH2_ERROR_INVALID_MAC); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 76, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(LIBSSH2_ERROR_INVALID_MAC); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_ERROR_INVALID_MAC, __pyx_t_1) < 0) __PYX_ERR(0, 76, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_ERROR_INVALID_MAC, __pyx_t_1) < 0) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/error_codes.pyx":77 - * IF EMBEDDED_LIB: - * LIBSSH2_ERROR_INVALID_MAC = error_codes._LIBSSH2_ERROR_INVALID_MAC - * LIBSSH2_ERROR_KEX_FAILURE = error_codes._LIBSSH2_ERROR_KEX_FAILURE # <<<<<<<<<<<<<< - * LIBSSH2_ERROR_ALLOC = error_codes._LIBSSH2_ERROR_ALLOC + /* "ssh2/error_codes.pyx":76 + * LIBSSH2_ERROR_BAD_SOCKET = error_codes._LIBSSH2_ERROR_BAD_SOCKET + * LIBSSH2_ERROR_INVALID_MAC = error_codes._LIBSSH2_ERROR_INVALID_MAC + * LIBSSH2_ERROR_KEX_FAILURE = error_codes._LIBSSH2_ERROR_KEX_FAILURE # <<<<<<<<<<<<<< + * LIBSSH2_ERROR_ALLOC = error_codes._LIBSSH2_ERROR_ALLOC * */ - __pyx_t_1 = __Pyx_PyInt_From_int(LIBSSH2_ERROR_KEX_FAILURE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 77, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(LIBSSH2_ERROR_KEX_FAILURE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_ERROR_KEX_FAILURE, __pyx_t_1) < 0) __PYX_ERR(0, 77, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_ERROR_KEX_FAILURE, __pyx_t_1) < 0) __PYX_ERR(0, 76, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/error_codes.pyx":78 - * LIBSSH2_ERROR_INVALID_MAC = error_codes._LIBSSH2_ERROR_INVALID_MAC - * LIBSSH2_ERROR_KEX_FAILURE = error_codes._LIBSSH2_ERROR_KEX_FAILURE - * LIBSSH2_ERROR_ALLOC = error_codes._LIBSSH2_ERROR_ALLOC # <<<<<<<<<<<<<< + /* "ssh2/error_codes.pyx":77 + * LIBSSH2_ERROR_INVALID_MAC = error_codes._LIBSSH2_ERROR_INVALID_MAC + * LIBSSH2_ERROR_KEX_FAILURE = error_codes._LIBSSH2_ERROR_KEX_FAILURE + * LIBSSH2_ERROR_ALLOC = error_codes._LIBSSH2_ERROR_ALLOC # <<<<<<<<<<<<<< * - * LIBSSH2_ERROR_KNOWN_HOSTS = error_codes._LIBSSH2_ERROR_KNOWN_HOSTS + * LIBSSH2_ERROR_KNOWN_HOSTS = error_codes._LIBSSH2_ERROR_KNOWN_HOSTS */ - __pyx_t_1 = __Pyx_PyInt_From_int(LIBSSH2_ERROR_ALLOC); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 78, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(LIBSSH2_ERROR_ALLOC); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_ERROR_ALLOC, __pyx_t_1) < 0) __PYX_ERR(0, 78, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_ERROR_ALLOC, __pyx_t_1) < 0) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/error_codes.pyx":80 - * LIBSSH2_ERROR_ALLOC = error_codes._LIBSSH2_ERROR_ALLOC + /* "ssh2/error_codes.pyx":79 + * LIBSSH2_ERROR_ALLOC = error_codes._LIBSSH2_ERROR_ALLOC * - * LIBSSH2_ERROR_KNOWN_HOSTS = error_codes._LIBSSH2_ERROR_KNOWN_HOSTS # <<<<<<<<<<<<<< - * LIBSSH2_ERROR_CHANNEL_WINDOW_FULL = \ - * error_codes._LIBSSH2_ERROR_CHANNEL_WINDOW_FULL + * LIBSSH2_ERROR_KNOWN_HOSTS = error_codes._LIBSSH2_ERROR_KNOWN_HOSTS # <<<<<<<<<<<<<< + * LIBSSH2_ERROR_CHANNEL_WINDOW_FULL = \ + * error_codes._LIBSSH2_ERROR_CHANNEL_WINDOW_FULL */ - __pyx_t_1 = __Pyx_PyInt_From_int(LIBSSH2_ERROR_KNOWN_HOSTS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 80, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(LIBSSH2_ERROR_KNOWN_HOSTS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_ERROR_KNOWN_HOSTS, __pyx_t_1) < 0) __PYX_ERR(0, 80, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_ERROR_KNOWN_HOSTS, __pyx_t_1) < 0) __PYX_ERR(0, 79, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/error_codes.pyx":82 - * LIBSSH2_ERROR_KNOWN_HOSTS = error_codes._LIBSSH2_ERROR_KNOWN_HOSTS - * LIBSSH2_ERROR_CHANNEL_WINDOW_FULL = \ - * error_codes._LIBSSH2_ERROR_CHANNEL_WINDOW_FULL # <<<<<<<<<<<<<< - * LIBSSH2_ERROR_KEYFILE_AUTH_FAILED = \ - * error_codes._LIBSSH2_ERROR_KEYFILE_AUTH_FAILED + /* "ssh2/error_codes.pyx":81 + * LIBSSH2_ERROR_KNOWN_HOSTS = error_codes._LIBSSH2_ERROR_KNOWN_HOSTS + * LIBSSH2_ERROR_CHANNEL_WINDOW_FULL = \ + * error_codes._LIBSSH2_ERROR_CHANNEL_WINDOW_FULL # <<<<<<<<<<<<<< + * LIBSSH2_ERROR_KEYFILE_AUTH_FAILED = \ + * error_codes._LIBSSH2_ERROR_KEYFILE_AUTH_FAILED */ - __pyx_t_1 = __Pyx_PyInt_From_int(LIBSSH2_ERROR_CHANNEL_WINDOW_FULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 82, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(LIBSSH2_ERROR_CHANNEL_WINDOW_FULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_ERROR_CHANNEL_WINDOW_FUL, __pyx_t_1) < 0) __PYX_ERR(0, 81, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_ERROR_CHANNEL_WINDOW_FUL, __pyx_t_1) < 0) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/error_codes.pyx":84 - * error_codes._LIBSSH2_ERROR_CHANNEL_WINDOW_FULL - * LIBSSH2_ERROR_KEYFILE_AUTH_FAILED = \ - * error_codes._LIBSSH2_ERROR_KEYFILE_AUTH_FAILED # <<<<<<<<<<<<<< + /* "ssh2/error_codes.pyx":83 + * error_codes._LIBSSH2_ERROR_CHANNEL_WINDOW_FULL + * LIBSSH2_ERROR_KEYFILE_AUTH_FAILED = \ + * error_codes._LIBSSH2_ERROR_KEYFILE_AUTH_FAILED # <<<<<<<<<<<<<< */ - __pyx_t_1 = __Pyx_PyInt_From_int(LIBSSH2_ERROR_KEYFILE_AUTH_FAILED); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 84, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(LIBSSH2_ERROR_KEYFILE_AUTH_FAILED); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_ERROR_KEYFILE_AUTH_FAILE, __pyx_t_1) < 0) __PYX_ERR(0, 83, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_ERROR_KEYFILE_AUTH_FAILE, __pyx_t_1) < 0) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "ssh2/error_codes.pyx":1 diff --git a/ssh2/error_codes.pyx b/ssh2/error_codes.pyx index 367f7d3e..e450a4a4 100644 --- a/ssh2/error_codes.pyx +++ b/ssh2/error_codes.pyx @@ -72,13 +72,12 @@ LIBSSH2_ERROR_AGENT_PROTOCOL = error_codes._LIBSSH2_ERROR_AGENT_PROTOCOL LIBSSH2_ERROR_SOCKET_RECV = error_codes._LIBSSH2_ERROR_SOCKET_RECV LIBSSH2_ERROR_ENCRYPT = error_codes._LIBSSH2_ERROR_ENCRYPT LIBSSH2_ERROR_BAD_SOCKET = error_codes._LIBSSH2_ERROR_BAD_SOCKET -IF EMBEDDED_LIB: - LIBSSH2_ERROR_INVALID_MAC = error_codes._LIBSSH2_ERROR_INVALID_MAC - LIBSSH2_ERROR_KEX_FAILURE = error_codes._LIBSSH2_ERROR_KEX_FAILURE - LIBSSH2_ERROR_ALLOC = error_codes._LIBSSH2_ERROR_ALLOC +LIBSSH2_ERROR_INVALID_MAC = error_codes._LIBSSH2_ERROR_INVALID_MAC +LIBSSH2_ERROR_KEX_FAILURE = error_codes._LIBSSH2_ERROR_KEX_FAILURE +LIBSSH2_ERROR_ALLOC = error_codes._LIBSSH2_ERROR_ALLOC - LIBSSH2_ERROR_KNOWN_HOSTS = error_codes._LIBSSH2_ERROR_KNOWN_HOSTS - LIBSSH2_ERROR_CHANNEL_WINDOW_FULL = \ - error_codes._LIBSSH2_ERROR_CHANNEL_WINDOW_FULL - LIBSSH2_ERROR_KEYFILE_AUTH_FAILED = \ - error_codes._LIBSSH2_ERROR_KEYFILE_AUTH_FAILED +LIBSSH2_ERROR_KNOWN_HOSTS = error_codes._LIBSSH2_ERROR_KNOWN_HOSTS +LIBSSH2_ERROR_CHANNEL_WINDOW_FULL = \ + error_codes._LIBSSH2_ERROR_CHANNEL_WINDOW_FULL +LIBSSH2_ERROR_KEYFILE_AUTH_FAILED = \ + error_codes._LIBSSH2_ERROR_KEYFILE_AUTH_FAILED diff --git a/ssh2/find_eol.c b/ssh2/ext/find_eol.c similarity index 100% rename from ssh2/find_eol.c rename to ssh2/ext/find_eol.c diff --git a/ssh2/find_eol.h b/ssh2/ext/find_eol.h similarity index 100% rename from ssh2/find_eol.h rename to ssh2/ext/find_eol.h diff --git a/ssh2/fileinfo.c b/ssh2/fileinfo.c index db82d155..07fd2578 100644 --- a/ssh2/fileinfo.c +++ b/ssh2/fileinfo.c @@ -836,12 +836,12 @@ static const char *__pyx_f[] = { /*--- Type declarations ---*/ struct __pyx_obj_4ssh2_8fileinfo_FileInfo; -/* "ssh2/fileinfo.pxd":20 +/* "ssh2/fileinfo.pxd":19 + * cimport c_ssh2 * - * IF EMBEDDED_LIB: - * cdef class FileInfo: # <<<<<<<<<<<<<< - * """Representation of stat structure""" - * cdef c_ssh2.libssh2_struct_stat* _stat + * cdef class FileInfo: # <<<<<<<<<<<<<< + * """Representation of stat structure""" + * cdef c_ssh2.libssh2_struct_stat* _stat */ struct __pyx_obj_4ssh2_8fileinfo_FileInfo { PyObject_HEAD @@ -1170,12 +1170,12 @@ static PyObject *__pyx_tuple_; static PyObject *__pyx_tuple__2; /* Late includes */ -/* "ssh2/fileinfo.pyx":28 - * """Representation of stat structure - libssh2 >= 1.7""" +/* "ssh2/fileinfo.pyx":27 + * """Representation of stat structure - libssh2 >= 1.7""" * - * def __cinit__(self): # <<<<<<<<<<<<<< - * self._stat = malloc( - * sizeof(c_ssh2.libssh2_struct_stat)) + * def __cinit__(self): # <<<<<<<<<<<<<< + * self._stat = malloc( + * sizeof(c_ssh2.libssh2_struct_stat)) */ /* Python wrapper */ @@ -1203,49 +1203,49 @@ static int __pyx_pf_4ssh2_8fileinfo_8FileInfo___cinit__(struct __pyx_obj_4ssh2_8 int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "ssh2/fileinfo.pyx":29 + /* "ssh2/fileinfo.pyx":28 * - * def __cinit__(self): - * self._stat = malloc( # <<<<<<<<<<<<<< - * sizeof(c_ssh2.libssh2_struct_stat)) - * if self._stat is NULL: + * def __cinit__(self): + * self._stat = malloc( # <<<<<<<<<<<<<< + * sizeof(c_ssh2.libssh2_struct_stat)) + * if self._stat is NULL: */ __pyx_v_self->_stat = ((libssh2_struct_stat *)malloc((sizeof(libssh2_struct_stat)))); - /* "ssh2/fileinfo.pyx":31 - * self._stat = malloc( - * sizeof(c_ssh2.libssh2_struct_stat)) - * if self._stat is NULL: # <<<<<<<<<<<<<< - * raise MemoryError + /* "ssh2/fileinfo.pyx":30 + * self._stat = malloc( + * sizeof(c_ssh2.libssh2_struct_stat)) + * if self._stat is NULL: # <<<<<<<<<<<<<< + * raise MemoryError * */ __pyx_t_1 = ((__pyx_v_self->_stat == NULL) != 0); if (unlikely(__pyx_t_1)) { - /* "ssh2/fileinfo.pyx":32 - * sizeof(c_ssh2.libssh2_struct_stat)) - * if self._stat is NULL: - * raise MemoryError # <<<<<<<<<<<<<< + /* "ssh2/fileinfo.pyx":31 + * sizeof(c_ssh2.libssh2_struct_stat)) + * if self._stat is NULL: + * raise MemoryError # <<<<<<<<<<<<<< * - * def __dealloc__(self): + * def __dealloc__(self): */ - PyErr_NoMemory(); __PYX_ERR(0, 32, __pyx_L1_error) + PyErr_NoMemory(); __PYX_ERR(0, 31, __pyx_L1_error) - /* "ssh2/fileinfo.pyx":31 - * self._stat = malloc( - * sizeof(c_ssh2.libssh2_struct_stat)) - * if self._stat is NULL: # <<<<<<<<<<<<<< - * raise MemoryError + /* "ssh2/fileinfo.pyx":30 + * self._stat = malloc( + * sizeof(c_ssh2.libssh2_struct_stat)) + * if self._stat is NULL: # <<<<<<<<<<<<<< + * raise MemoryError * */ } - /* "ssh2/fileinfo.pyx":28 - * """Representation of stat structure - libssh2 >= 1.7""" + /* "ssh2/fileinfo.pyx":27 + * """Representation of stat structure - libssh2 >= 1.7""" * - * def __cinit__(self): # <<<<<<<<<<<<<< - * self._stat = malloc( - * sizeof(c_ssh2.libssh2_struct_stat)) + * def __cinit__(self): # <<<<<<<<<<<<<< + * self._stat = malloc( + * sizeof(c_ssh2.libssh2_struct_stat)) */ /* function exit code */ @@ -1259,11 +1259,11 @@ static int __pyx_pf_4ssh2_8fileinfo_8FileInfo___cinit__(struct __pyx_obj_4ssh2_8 return __pyx_r; } -/* "ssh2/fileinfo.pyx":34 - * raise MemoryError +/* "ssh2/fileinfo.pyx":33 + * raise MemoryError * - * def __dealloc__(self): # <<<<<<<<<<<<<< - * free(self._stat) + * def __dealloc__(self): # <<<<<<<<<<<<<< + * free(self._stat) * */ @@ -1282,20 +1282,20 @@ static void __pyx_pf_4ssh2_8fileinfo_8FileInfo_2__dealloc__(struct __pyx_obj_4ss __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "ssh2/fileinfo.pyx":35 + /* "ssh2/fileinfo.pyx":34 * - * def __dealloc__(self): - * free(self._stat) # <<<<<<<<<<<<<< + * def __dealloc__(self): + * free(self._stat) # <<<<<<<<<<<<<< * - * @property + * @property */ free(__pyx_v_self->_stat); - /* "ssh2/fileinfo.pyx":34 - * raise MemoryError + /* "ssh2/fileinfo.pyx":33 + * raise MemoryError * - * def __dealloc__(self): # <<<<<<<<<<<<<< - * free(self._stat) + * def __dealloc__(self): # <<<<<<<<<<<<<< + * free(self._stat) * */ @@ -1303,11 +1303,11 @@ static void __pyx_pf_4ssh2_8fileinfo_8FileInfo_2__dealloc__(struct __pyx_obj_4ss __Pyx_RefNannyFinishContext(); } -/* "ssh2/fileinfo.pyx":38 +/* "ssh2/fileinfo.pyx":37 * - * @property - * def st_size(self): # <<<<<<<<<<<<<< - * return self._stat.st_size + * @property + * def st_size(self): # <<<<<<<<<<<<<< + * return self._stat.st_size * */ @@ -1333,25 +1333,25 @@ static PyObject *__pyx_pf_4ssh2_8fileinfo_8FileInfo_7st_size___get__(struct __py int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "ssh2/fileinfo.pyx":39 - * @property - * def st_size(self): - * return self._stat.st_size # <<<<<<<<<<<<<< + /* "ssh2/fileinfo.pyx":38 + * @property + * def st_size(self): + * return self._stat.st_size # <<<<<<<<<<<<<< * - * @property + * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_unsigned_PY_LONG_LONG(__pyx_v_self->_stat->st_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 39, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_unsigned_PY_LONG_LONG(__pyx_v_self->_stat->st_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/fileinfo.pyx":38 + /* "ssh2/fileinfo.pyx":37 * - * @property - * def st_size(self): # <<<<<<<<<<<<<< - * return self._stat.st_size + * @property + * def st_size(self): # <<<<<<<<<<<<<< + * return self._stat.st_size * */ @@ -1366,11 +1366,11 @@ static PyObject *__pyx_pf_4ssh2_8fileinfo_8FileInfo_7st_size___get__(struct __py return __pyx_r; } -/* "ssh2/fileinfo.pyx":42 +/* "ssh2/fileinfo.pyx":41 * - * @property - * def st_mode(self): # <<<<<<<<<<<<<< - * return self._stat.st_mode + * @property + * def st_mode(self): # <<<<<<<<<<<<<< + * return self._stat.st_mode * */ @@ -1396,25 +1396,25 @@ static PyObject *__pyx_pf_4ssh2_8fileinfo_8FileInfo_7st_mode___get__(struct __py int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "ssh2/fileinfo.pyx":43 - * @property - * def st_mode(self): - * return self._stat.st_mode # <<<<<<<<<<<<<< + /* "ssh2/fileinfo.pyx":42 + * @property + * def st_mode(self): + * return self._stat.st_mode # <<<<<<<<<<<<<< * - * @property + * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_unsigned_long(__pyx_v_self->_stat->st_mode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_unsigned_long(__pyx_v_self->_stat->st_mode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/fileinfo.pyx":42 + /* "ssh2/fileinfo.pyx":41 * - * @property - * def st_mode(self): # <<<<<<<<<<<<<< - * return self._stat.st_mode + * @property + * def st_mode(self): # <<<<<<<<<<<<<< + * return self._stat.st_mode * */ @@ -1429,11 +1429,11 @@ static PyObject *__pyx_pf_4ssh2_8fileinfo_8FileInfo_7st_mode___get__(struct __py return __pyx_r; } -/* "ssh2/fileinfo.pyx":46 +/* "ssh2/fileinfo.pyx":45 * - * @property - * def st_ino(self): # <<<<<<<<<<<<<< - * return self._stat.st_ino + * @property + * def st_ino(self): # <<<<<<<<<<<<<< + * return self._stat.st_ino * */ @@ -1459,25 +1459,25 @@ static PyObject *__pyx_pf_4ssh2_8fileinfo_8FileInfo_6st_ino___get__(struct __pyx int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "ssh2/fileinfo.pyx":47 - * @property - * def st_ino(self): - * return self._stat.st_ino # <<<<<<<<<<<<<< + /* "ssh2/fileinfo.pyx":46 + * @property + * def st_ino(self): + * return self._stat.st_ino # <<<<<<<<<<<<<< * - * @property + * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_unsigned_long(__pyx_v_self->_stat->st_ino); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 47, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_unsigned_long(__pyx_v_self->_stat->st_ino); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/fileinfo.pyx":46 + /* "ssh2/fileinfo.pyx":45 * - * @property - * def st_ino(self): # <<<<<<<<<<<<<< - * return self._stat.st_ino + * @property + * def st_ino(self): # <<<<<<<<<<<<<< + * return self._stat.st_ino * */ @@ -1492,11 +1492,11 @@ static PyObject *__pyx_pf_4ssh2_8fileinfo_8FileInfo_6st_ino___get__(struct __pyx return __pyx_r; } -/* "ssh2/fileinfo.pyx":50 +/* "ssh2/fileinfo.pyx":49 * - * @property - * def st_nlink(self): # <<<<<<<<<<<<<< - * return self._stat.st_nlink + * @property + * def st_nlink(self): # <<<<<<<<<<<<<< + * return self._stat.st_nlink * */ @@ -1522,25 +1522,25 @@ static PyObject *__pyx_pf_4ssh2_8fileinfo_8FileInfo_8st_nlink___get__(struct __p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "ssh2/fileinfo.pyx":51 - * @property - * def st_nlink(self): - * return self._stat.st_nlink # <<<<<<<<<<<<<< + /* "ssh2/fileinfo.pyx":50 + * @property + * def st_nlink(self): + * return self._stat.st_nlink # <<<<<<<<<<<<<< * - * @property + * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_self->_stat->st_nlink); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 51, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_self->_stat->st_nlink); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/fileinfo.pyx":50 + /* "ssh2/fileinfo.pyx":49 * - * @property - * def st_nlink(self): # <<<<<<<<<<<<<< - * return self._stat.st_nlink + * @property + * def st_nlink(self): # <<<<<<<<<<<<<< + * return self._stat.st_nlink * */ @@ -1555,11 +1555,11 @@ static PyObject *__pyx_pf_4ssh2_8fileinfo_8FileInfo_8st_nlink___get__(struct __p return __pyx_r; } -/* "ssh2/fileinfo.pyx":54 +/* "ssh2/fileinfo.pyx":53 * - * @property - * def st_uid(self): # <<<<<<<<<<<<<< - * return self._stat.st_uid + * @property + * def st_uid(self): # <<<<<<<<<<<<<< + * return self._stat.st_uid * */ @@ -1585,25 +1585,25 @@ static PyObject *__pyx_pf_4ssh2_8fileinfo_8FileInfo_6st_uid___get__(struct __pyx int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "ssh2/fileinfo.pyx":55 - * @property - * def st_uid(self): - * return self._stat.st_uid # <<<<<<<<<<<<<< + /* "ssh2/fileinfo.pyx":54 + * @property + * def st_uid(self): + * return self._stat.st_uid # <<<<<<<<<<<<<< * - * @property + * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_self->_stat->st_uid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 55, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_self->_stat->st_uid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/fileinfo.pyx":54 + /* "ssh2/fileinfo.pyx":53 * - * @property - * def st_uid(self): # <<<<<<<<<<<<<< - * return self._stat.st_uid + * @property + * def st_uid(self): # <<<<<<<<<<<<<< + * return self._stat.st_uid * */ @@ -1618,11 +1618,11 @@ static PyObject *__pyx_pf_4ssh2_8fileinfo_8FileInfo_6st_uid___get__(struct __pyx return __pyx_r; } -/* "ssh2/fileinfo.pyx":58 +/* "ssh2/fileinfo.pyx":57 * - * @property - * def st_gid(self): # <<<<<<<<<<<<<< - * return self._stat.st_gid + * @property + * def st_gid(self): # <<<<<<<<<<<<<< + * return self._stat.st_gid * */ @@ -1648,25 +1648,25 @@ static PyObject *__pyx_pf_4ssh2_8fileinfo_8FileInfo_6st_gid___get__(struct __pyx int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "ssh2/fileinfo.pyx":59 - * @property - * def st_gid(self): - * return self._stat.st_gid # <<<<<<<<<<<<<< + /* "ssh2/fileinfo.pyx":58 + * @property + * def st_gid(self): + * return self._stat.st_gid # <<<<<<<<<<<<<< * - * @property + * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_self->_stat->st_gid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 59, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_self->_stat->st_gid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/fileinfo.pyx":58 + /* "ssh2/fileinfo.pyx":57 * - * @property - * def st_gid(self): # <<<<<<<<<<<<<< - * return self._stat.st_gid + * @property + * def st_gid(self): # <<<<<<<<<<<<<< + * return self._stat.st_gid * */ @@ -1681,11 +1681,11 @@ static PyObject *__pyx_pf_4ssh2_8fileinfo_8FileInfo_6st_gid___get__(struct __pyx return __pyx_r; } -/* "ssh2/fileinfo.pyx":62 +/* "ssh2/fileinfo.pyx":61 * - * @property - * def st_rdev(self): # <<<<<<<<<<<<<< - * return self._stat.st_rdev + * @property + * def st_rdev(self): # <<<<<<<<<<<<<< + * return self._stat.st_rdev * */ @@ -1711,25 +1711,25 @@ static PyObject *__pyx_pf_4ssh2_8fileinfo_8FileInfo_7st_rdev___get__(struct __py int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "ssh2/fileinfo.pyx":63 - * @property - * def st_rdev(self): - * return self._stat.st_rdev # <<<<<<<<<<<<<< + /* "ssh2/fileinfo.pyx":62 + * @property + * def st_rdev(self): + * return self._stat.st_rdev # <<<<<<<<<<<<<< * - * @property + * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_self->_stat->st_rdev); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 63, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_self->_stat->st_rdev); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 62, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/fileinfo.pyx":62 + /* "ssh2/fileinfo.pyx":61 * - * @property - * def st_rdev(self): # <<<<<<<<<<<<<< - * return self._stat.st_rdev + * @property + * def st_rdev(self): # <<<<<<<<<<<<<< + * return self._stat.st_rdev * */ @@ -1744,12 +1744,12 @@ static PyObject *__pyx_pf_4ssh2_8fileinfo_8FileInfo_7st_rdev___get__(struct __py return __pyx_r; } -/* "ssh2/fileinfo.pyx":66 +/* "ssh2/fileinfo.pyx":65 * - * @property - * def st_blksize(self): # <<<<<<<<<<<<<< - * IF UNAME_SYSNAME != 'Windows': - * return self._stat.st_blksize + * @property + * def st_blksize(self): # <<<<<<<<<<<<<< + * IF UNAME_SYSNAME != 'Windows': + * return self._stat.st_blksize */ /* Python wrapper */ @@ -1774,26 +1774,26 @@ static PyObject *__pyx_pf_4ssh2_8fileinfo_8FileInfo_10st_blksize___get__(struct int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "ssh2/fileinfo.pyx":68 - * def st_blksize(self): - * IF UNAME_SYSNAME != 'Windows': - * return self._stat.st_blksize # <<<<<<<<<<<<<< - * ELSE: - * return None + /* "ssh2/fileinfo.pyx":67 + * def st_blksize(self): + * IF UNAME_SYSNAME != 'Windows': + * return self._stat.st_blksize # <<<<<<<<<<<<<< + * ELSE: + * return None */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_self->_stat->st_blksize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 68, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_self->_stat->st_blksize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/fileinfo.pyx":66 + /* "ssh2/fileinfo.pyx":65 * - * @property - * def st_blksize(self): # <<<<<<<<<<<<<< - * IF UNAME_SYSNAME != 'Windows': - * return self._stat.st_blksize + * @property + * def st_blksize(self): # <<<<<<<<<<<<<< + * IF UNAME_SYSNAME != 'Windows': + * return self._stat.st_blksize */ /* function exit code */ @@ -1807,12 +1807,12 @@ static PyObject *__pyx_pf_4ssh2_8fileinfo_8FileInfo_10st_blksize___get__(struct return __pyx_r; } -/* "ssh2/fileinfo.pyx":73 +/* "ssh2/fileinfo.pyx":72 * - * @property - * def st_blocks(self): # <<<<<<<<<<<<<< - * IF UNAME_SYSNAME != 'Windows': - * return self._stat.st_blocks + * @property + * def st_blocks(self): # <<<<<<<<<<<<<< + * IF UNAME_SYSNAME != 'Windows': + * return self._stat.st_blocks */ /* Python wrapper */ @@ -1837,26 +1837,26 @@ static PyObject *__pyx_pf_4ssh2_8fileinfo_8FileInfo_9st_blocks___get__(struct __ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "ssh2/fileinfo.pyx":75 - * def st_blocks(self): - * IF UNAME_SYSNAME != 'Windows': - * return self._stat.st_blocks # <<<<<<<<<<<<<< - * ELSE: - * return None + /* "ssh2/fileinfo.pyx":74 + * def st_blocks(self): + * IF UNAME_SYSNAME != 'Windows': + * return self._stat.st_blocks # <<<<<<<<<<<<<< + * ELSE: + * return None */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_self->_stat->st_blocks); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 75, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_self->_stat->st_blocks); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/fileinfo.pyx":73 + /* "ssh2/fileinfo.pyx":72 * - * @property - * def st_blocks(self): # <<<<<<<<<<<<<< - * IF UNAME_SYSNAME != 'Windows': - * return self._stat.st_blocks + * @property + * def st_blocks(self): # <<<<<<<<<<<<<< + * IF UNAME_SYSNAME != 'Windows': + * return self._stat.st_blocks */ /* function exit code */ @@ -1870,11 +1870,11 @@ static PyObject *__pyx_pf_4ssh2_8fileinfo_8FileInfo_9st_blocks___get__(struct __ return __pyx_r; } -/* "ssh2/fileinfo.pyx":80 +/* "ssh2/fileinfo.pyx":79 * - * @property - * def st_atime(self): # <<<<<<<<<<<<<< - * return self._stat.st_atime + * @property + * def st_atime(self): # <<<<<<<<<<<<<< + * return self._stat.st_atime * */ @@ -1900,25 +1900,25 @@ static PyObject *__pyx_pf_4ssh2_8fileinfo_8FileInfo_8st_atime___get__(struct __p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "ssh2/fileinfo.pyx":81 - * @property - * def st_atime(self): - * return self._stat.st_atime # <<<<<<<<<<<<<< + /* "ssh2/fileinfo.pyx":80 + * @property + * def st_atime(self): + * return self._stat.st_atime # <<<<<<<<<<<<<< * - * @property + * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_time_t(__pyx_v_self->_stat->st_atime); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 81, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_time_t(__pyx_v_self->_stat->st_atime); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/fileinfo.pyx":80 + /* "ssh2/fileinfo.pyx":79 * - * @property - * def st_atime(self): # <<<<<<<<<<<<<< - * return self._stat.st_atime + * @property + * def st_atime(self): # <<<<<<<<<<<<<< + * return self._stat.st_atime * */ @@ -1933,11 +1933,11 @@ static PyObject *__pyx_pf_4ssh2_8fileinfo_8FileInfo_8st_atime___get__(struct __p return __pyx_r; } -/* "ssh2/fileinfo.pyx":84 +/* "ssh2/fileinfo.pyx":83 * - * @property - * def st_mtime(self): # <<<<<<<<<<<<<< - * return self._stat.st_mtime + * @property + * def st_mtime(self): # <<<<<<<<<<<<<< + * return self._stat.st_mtime * */ @@ -1963,25 +1963,25 @@ static PyObject *__pyx_pf_4ssh2_8fileinfo_8FileInfo_8st_mtime___get__(struct __p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "ssh2/fileinfo.pyx":85 - * @property - * def st_mtime(self): - * return self._stat.st_mtime # <<<<<<<<<<<<<< + /* "ssh2/fileinfo.pyx":84 + * @property + * def st_mtime(self): + * return self._stat.st_mtime # <<<<<<<<<<<<<< * - * @property + * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_time_t(__pyx_v_self->_stat->st_mtime); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 85, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_time_t(__pyx_v_self->_stat->st_mtime); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/fileinfo.pyx":84 + /* "ssh2/fileinfo.pyx":83 * - * @property - * def st_mtime(self): # <<<<<<<<<<<<<< - * return self._stat.st_mtime + * @property + * def st_mtime(self): # <<<<<<<<<<<<<< + * return self._stat.st_mtime * */ @@ -1996,11 +1996,11 @@ static PyObject *__pyx_pf_4ssh2_8fileinfo_8FileInfo_8st_mtime___get__(struct __p return __pyx_r; } -/* "ssh2/fileinfo.pyx":88 +/* "ssh2/fileinfo.pyx":87 * - * @property - * def st_ctime(self): # <<<<<<<<<<<<<< - * return self._stat.st_ctime + * @property + * def st_ctime(self): # <<<<<<<<<<<<<< + * return self._stat.st_ctime */ /* Python wrapper */ @@ -2025,23 +2025,23 @@ static PyObject *__pyx_pf_4ssh2_8fileinfo_8FileInfo_8st_ctime___get__(struct __p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "ssh2/fileinfo.pyx":89 - * @property - * def st_ctime(self): - * return self._stat.st_ctime # <<<<<<<<<<<<<< + /* "ssh2/fileinfo.pyx":88 + * @property + * def st_ctime(self): + * return self._stat.st_ctime # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_time_t(__pyx_v_self->_stat->st_ctime); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 89, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_time_t(__pyx_v_self->_stat->st_ctime); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/fileinfo.pyx":88 + /* "ssh2/fileinfo.pyx":87 * - * @property - * def st_ctime(self): # <<<<<<<<<<<<<< - * return self._stat.st_ctime + * @property + * def st_ctime(self): # <<<<<<<<<<<<<< + * return self._stat.st_ctime */ /* function exit code */ @@ -2404,7 +2404,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {0, 0, 0, 0, 0, 0, 0} }; static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(0, 32, __pyx_L1_error) + __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(0, 31, __pyx_L1_error) __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error) return 0; __pyx_L1_error:; @@ -2486,15 +2486,15 @@ 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_8fileinfo_FileInfo) < 0) __PYX_ERR(0, 25, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_4ssh2_8fileinfo_FileInfo) < 0) __PYX_ERR(0, 24, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_4ssh2_8fileinfo_FileInfo.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4ssh2_8fileinfo_FileInfo.tp_dictoffset && __pyx_type_4ssh2_8fileinfo_FileInfo.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_4ssh2_8fileinfo_FileInfo.tp_getattro = __Pyx_PyObject_GenericGetAttr; } - if (PyObject_SetAttr(__pyx_m, __pyx_n_s_FileInfo, (PyObject *)&__pyx_type_4ssh2_8fileinfo_FileInfo) < 0) __PYX_ERR(0, 25, __pyx_L1_error) - if (__Pyx_setup_reduce((PyObject*)&__pyx_type_4ssh2_8fileinfo_FileInfo) < 0) __PYX_ERR(0, 25, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_FileInfo, (PyObject *)&__pyx_type_4ssh2_8fileinfo_FileInfo) < 0) __PYX_ERR(0, 24, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_4ssh2_8fileinfo_FileInfo) < 0) __PYX_ERR(0, 24, __pyx_L1_error) __pyx_ptype_4ssh2_8fileinfo_FileInfo = &__pyx_type_4ssh2_8fileinfo_FileInfo; __Pyx_RefNannyFinishContext(); return 0; diff --git a/ssh2/fileinfo.pxd b/ssh2/fileinfo.pxd index e06bd52d..594d3ec0 100644 --- a/ssh2/fileinfo.pxd +++ b/ssh2/fileinfo.pxd @@ -16,7 +16,6 @@ cimport c_ssh2 -IF EMBEDDED_LIB: - cdef class FileInfo: - """Representation of stat structure""" - cdef c_ssh2.libssh2_struct_stat* _stat +cdef class FileInfo: + """Representation of stat structure""" + cdef c_ssh2.libssh2_struct_stat* _stat diff --git a/ssh2/fileinfo.pyx b/ssh2/fileinfo.pyx index 61053794..9a6630ac 100644 --- a/ssh2/fileinfo.pyx +++ b/ssh2/fileinfo.pyx @@ -21,69 +21,68 @@ from libc.stdlib cimport malloc, free cimport c_ssh2 -IF EMBEDDED_LIB: - cdef class FileInfo: - """Representation of stat structure - libssh2 >= 1.7""" - - def __cinit__(self): - self._stat = malloc( - sizeof(c_ssh2.libssh2_struct_stat)) - if self._stat is NULL: - raise MemoryError - - def __dealloc__(self): - free(self._stat) - - @property - def st_size(self): - return self._stat.st_size - - @property - def st_mode(self): - return self._stat.st_mode - - @property - def st_ino(self): - return self._stat.st_ino - - @property - def st_nlink(self): - return self._stat.st_nlink - - @property - def st_uid(self): - return self._stat.st_uid - - @property - def st_gid(self): - return self._stat.st_gid - - @property - def st_rdev(self): - return self._stat.st_rdev - - @property - def st_blksize(self): - IF UNAME_SYSNAME != 'Windows': - return self._stat.st_blksize - ELSE: - return None - - @property - def st_blocks(self): - IF UNAME_SYSNAME != 'Windows': - return self._stat.st_blocks - ELSE: - return None - - @property - def st_atime(self): - return self._stat.st_atime - - @property - def st_mtime(self): - return self._stat.st_mtime - - @property - def st_ctime(self): - return self._stat.st_ctime +cdef class FileInfo: + """Representation of stat structure - libssh2 >= 1.7""" + + def __cinit__(self): + self._stat = malloc( + sizeof(c_ssh2.libssh2_struct_stat)) + if self._stat is NULL: + raise MemoryError + + def __dealloc__(self): + free(self._stat) + + @property + def st_size(self): + return self._stat.st_size + + @property + def st_mode(self): + return self._stat.st_mode + + @property + def st_ino(self): + return self._stat.st_ino + + @property + def st_nlink(self): + return self._stat.st_nlink + + @property + def st_uid(self): + return self._stat.st_uid + + @property + def st_gid(self): + return self._stat.st_gid + + @property + def st_rdev(self): + return self._stat.st_rdev + + @property + def st_blksize(self): + IF UNAME_SYSNAME != 'Windows': + return self._stat.st_blksize + ELSE: + return None + + @property + def st_blocks(self): + IF UNAME_SYSNAME != 'Windows': + return self._stat.st_blocks + ELSE: + return None + + @property + def st_atime(self): + return self._stat.st_atime + + @property + def st_mtime(self): + return self._stat.st_mtime + + @property + def st_ctime(self): + return self._stat.st_ctime diff --git a/ssh2/knownhost.c b/ssh2/knownhost.c index 34ad76fe..2fca2ed9 100644 --- a/ssh2/knownhost.c +++ b/ssh2/knownhost.c @@ -621,7 +621,7 @@ static CYTHON_INLINE float __PYX_NAN() { #include "libssh2.h" #include #include -#include "find_eol.h" +#include "ext/find_eol.h" #ifdef _OPENMP #include #endif /* _OPENMP */ @@ -1537,7 +1537,7 @@ static PyObject *__pyx_tuple__8; static PyObject *__pyx_tuple__9; /* Late includes */ -/* "ssh2/knownhost.pyx":56 +/* "ssh2/knownhost.pyx":55 * * * cdef KnownHost PyKnownHost(Session session, c_ssh2.LIBSSH2_KNOWNHOSTS *_ptr): # <<<<<<<<<<<<<< @@ -1556,25 +1556,25 @@ static struct __pyx_obj_4ssh2_9knownhost_KnownHost *__pyx_f_4ssh2_9knownhost_PyK int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyKnownHost", 0); - /* "ssh2/knownhost.pyx":57 + /* "ssh2/knownhost.pyx":56 * * 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, 57, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __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, 57, __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, 56, __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":58 + /* "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 # <<<<<<<<<<<<<< @@ -1583,7 +1583,7 @@ static struct __pyx_obj_4ssh2_9knownhost_KnownHost *__pyx_f_4ssh2_9knownhost_PyK */ __pyx_v_known_host->_ptr = __pyx_v__ptr; - /* "ssh2/knownhost.pyx":59 + /* "ssh2/knownhost.pyx":58 * cdef KnownHost known_host = KnownHost.__new__(KnownHost, session) * known_host._ptr = _ptr * return known_host # <<<<<<<<<<<<<< @@ -1595,7 +1595,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":56 + /* "ssh2/knownhost.pyx":55 * * * cdef KnownHost PyKnownHost(Session session, c_ssh2.LIBSSH2_KNOWNHOSTS *_ptr): # <<<<<<<<<<<<<< @@ -1616,7 +1616,7 @@ static struct __pyx_obj_4ssh2_9knownhost_KnownHost *__pyx_f_4ssh2_9knownhost_PyK return __pyx_r; } -/* "ssh2/knownhost.pyx":62 +/* "ssh2/knownhost.pyx":61 * * * cdef KnownHostEntry PyKnownHostEntry(c_ssh2.libssh2_knownhost *_entry): # <<<<<<<<<<<<<< @@ -1634,19 +1634,19 @@ static struct __pyx_obj_4ssh2_9knownhost_KnownHostEntry *__pyx_f_4ssh2_9knownhos int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyKnownHostEntry", 0); - /* "ssh2/knownhost.pyx":63 + /* "ssh2/knownhost.pyx":62 * * 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, 63, __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, 62, __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":64 + /* "ssh2/knownhost.pyx":63 * cdef KnownHostEntry PyKnownHostEntry(c_ssh2.libssh2_knownhost *_entry): * cdef KnownHostEntry entry = KnownHostEntry.__new__(KnownHostEntry) * entry._store = _entry # <<<<<<<<<<<<<< @@ -1655,7 +1655,7 @@ static struct __pyx_obj_4ssh2_9knownhost_KnownHostEntry *__pyx_f_4ssh2_9knownhos */ __pyx_v_entry->_store = __pyx_v__entry; - /* "ssh2/knownhost.pyx":65 + /* "ssh2/knownhost.pyx":64 * cdef KnownHostEntry entry = KnownHostEntry.__new__(KnownHostEntry) * entry._store = _entry * return entry # <<<<<<<<<<<<<< @@ -1667,7 +1667,7 @@ static struct __pyx_obj_4ssh2_9knownhost_KnownHostEntry *__pyx_f_4ssh2_9knownhos __pyx_r = __pyx_v_entry; goto __pyx_L0; - /* "ssh2/knownhost.pyx":62 + /* "ssh2/knownhost.pyx":61 * * * cdef KnownHostEntry PyKnownHostEntry(c_ssh2.libssh2_knownhost *_entry): # <<<<<<<<<<<<<< @@ -1687,7 +1687,7 @@ static struct __pyx_obj_4ssh2_9knownhost_KnownHostEntry *__pyx_f_4ssh2_9knownhos return __pyx_r; } -/* "ssh2/knownhost.pyx":68 +/* "ssh2/knownhost.pyx":67 * * * cdef KnownHostEntry PyNewKnownHostEntry(): # <<<<<<<<<<<<<< @@ -1707,19 +1707,19 @@ static struct __pyx_obj_4ssh2_9knownhost_KnownHostEntry *__pyx_f_4ssh2_9knownhos int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyNewKnownHostEntry", 0); - /* "ssh2/knownhost.pyx":69 + /* "ssh2/knownhost.pyx":68 * * 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, 69, __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, 68, __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":71 + /* "ssh2/knownhost.pyx":70 * cdef KnownHostEntry entry = KnownHostEntry.__new__(KnownHostEntry) * cdef c_ssh2.libssh2_knownhost *_entry * with nogil: # <<<<<<<<<<<<<< @@ -1734,7 +1734,7 @@ static struct __pyx_obj_4ssh2_9knownhost_KnownHostEntry *__pyx_f_4ssh2_9knownhos #endif /*try:*/ { - /* "ssh2/knownhost.pyx":72 + /* "ssh2/knownhost.pyx":71 * cdef c_ssh2.libssh2_knownhost *_entry * with nogil: * _entry = malloc( # <<<<<<<<<<<<<< @@ -1743,7 +1743,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":74 + /* "ssh2/knownhost.pyx":73 * _entry = malloc( * sizeof(c_ssh2.libssh2_knownhost)) * if _entry is NULL: # <<<<<<<<<<<<<< @@ -1753,7 +1753,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":75 + /* "ssh2/knownhost.pyx":74 * sizeof(c_ssh2.libssh2_knownhost)) * if _entry is NULL: * with gil: # <<<<<<<<<<<<<< @@ -1766,17 +1766,17 @@ static struct __pyx_obj_4ssh2_9knownhost_KnownHostEntry *__pyx_f_4ssh2_9knownhos #endif /*try:*/ { - /* "ssh2/knownhost.pyx":76 + /* "ssh2/knownhost.pyx":75 * if _entry is NULL: * with gil: * raise MemoryError # <<<<<<<<<<<<<< * _entry.magic = 0 * _entry.node = NULL */ - PyErr_NoMemory(); __PYX_ERR(0, 76, __pyx_L8_error) + PyErr_NoMemory(); __PYX_ERR(0, 75, __pyx_L8_error) } - /* "ssh2/knownhost.pyx":75 + /* "ssh2/knownhost.pyx":74 * sizeof(c_ssh2.libssh2_knownhost)) * if _entry is NULL: * with gil: # <<<<<<<<<<<<<< @@ -1793,7 +1793,7 @@ static struct __pyx_obj_4ssh2_9knownhost_KnownHostEntry *__pyx_f_4ssh2_9knownhos } } - /* "ssh2/knownhost.pyx":74 + /* "ssh2/knownhost.pyx":73 * _entry = malloc( * sizeof(c_ssh2.libssh2_knownhost)) * if _entry is NULL: # <<<<<<<<<<<<<< @@ -1802,7 +1802,7 @@ static struct __pyx_obj_4ssh2_9knownhost_KnownHostEntry *__pyx_f_4ssh2_9knownhos */ } - /* "ssh2/knownhost.pyx":77 + /* "ssh2/knownhost.pyx":76 * with gil: * raise MemoryError * _entry.magic = 0 # <<<<<<<<<<<<<< @@ -1811,7 +1811,7 @@ static struct __pyx_obj_4ssh2_9knownhost_KnownHostEntry *__pyx_f_4ssh2_9knownhos */ __pyx_v__entry->magic = 0; - /* "ssh2/knownhost.pyx":78 + /* "ssh2/knownhost.pyx":77 * raise MemoryError * _entry.magic = 0 * _entry.node = NULL # <<<<<<<<<<<<<< @@ -1820,7 +1820,7 @@ static struct __pyx_obj_4ssh2_9knownhost_KnownHostEntry *__pyx_f_4ssh2_9knownhos */ __pyx_v__entry->node = NULL; - /* "ssh2/knownhost.pyx":79 + /* "ssh2/knownhost.pyx":78 * _entry.magic = 0 * _entry.node = NULL * _entry.name = NULL # <<<<<<<<<<<<<< @@ -1829,7 +1829,7 @@ static struct __pyx_obj_4ssh2_9knownhost_KnownHostEntry *__pyx_f_4ssh2_9knownhos */ __pyx_v__entry->name = NULL; - /* "ssh2/knownhost.pyx":80 + /* "ssh2/knownhost.pyx":79 * _entry.node = NULL * _entry.name = NULL * _entry.key = NULL # <<<<<<<<<<<<<< @@ -1838,7 +1838,7 @@ static struct __pyx_obj_4ssh2_9knownhost_KnownHostEntry *__pyx_f_4ssh2_9knownhos */ __pyx_v__entry->key = NULL; - /* "ssh2/knownhost.pyx":81 + /* "ssh2/knownhost.pyx":80 * _entry.name = NULL * _entry.key = NULL * _entry.typemask = -1 # <<<<<<<<<<<<<< @@ -1847,7 +1847,7 @@ static struct __pyx_obj_4ssh2_9knownhost_KnownHostEntry *__pyx_f_4ssh2_9knownhos */ __pyx_v__entry->typemask = -1; - /* "ssh2/knownhost.pyx":82 + /* "ssh2/knownhost.pyx":81 * _entry.key = NULL * _entry.typemask = -1 * entry._store = _entry # <<<<<<<<<<<<<< @@ -1857,7 +1857,7 @@ static struct __pyx_obj_4ssh2_9knownhost_KnownHostEntry *__pyx_f_4ssh2_9knownhos __pyx_v_entry->_store = __pyx_v__entry; } - /* "ssh2/knownhost.pyx":71 + /* "ssh2/knownhost.pyx":70 * cdef KnownHostEntry entry = KnownHostEntry.__new__(KnownHostEntry) * cdef c_ssh2.libssh2_knownhost *_entry * with nogil: # <<<<<<<<<<<<<< @@ -1883,7 +1883,7 @@ static struct __pyx_obj_4ssh2_9knownhost_KnownHostEntry *__pyx_f_4ssh2_9knownhos } } - /* "ssh2/knownhost.pyx":83 + /* "ssh2/knownhost.pyx":82 * _entry.typemask = -1 * entry._store = _entry * return entry # <<<<<<<<<<<<<< @@ -1895,7 +1895,7 @@ static struct __pyx_obj_4ssh2_9knownhost_KnownHostEntry *__pyx_f_4ssh2_9knownhos __pyx_r = __pyx_v_entry; goto __pyx_L0; - /* "ssh2/knownhost.pyx":68 + /* "ssh2/knownhost.pyx":67 * * * cdef KnownHostEntry PyNewKnownHostEntry(): # <<<<<<<<<<<<<< @@ -1915,7 +1915,7 @@ static struct __pyx_obj_4ssh2_9knownhost_KnownHostEntry *__pyx_f_4ssh2_9knownhos return __pyx_r; } -/* "ssh2/knownhost.pyx":89 +/* "ssh2/knownhost.pyx":88 * """Class representing a single known host entry.""" * * def __repr__(self): # <<<<<<<<<<<<<< @@ -1946,7 +1946,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_14KnownHostEntry___repr__(struct __py int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__repr__", 0); - /* "ssh2/knownhost.pyx":90 + /* "ssh2/knownhost.pyx":89 * * def __repr__(self): * return "Known host entry for host: %s" % (self.name) # <<<<<<<<<<<<<< @@ -1954,16 +1954,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, 90, __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, 89, __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, 90, __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, 89, __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":89 + /* "ssh2/knownhost.pyx":88 * """Class representing a single known host entry.""" * * def __repr__(self): # <<<<<<<<<<<<<< @@ -1983,7 +1983,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_14KnownHostEntry___repr__(struct __py return __pyx_r; } -/* "ssh2/knownhost.pyx":92 +/* "ssh2/knownhost.pyx":91 * return "Known host entry for host: %s" % (self.name) * * def __str__(self): # <<<<<<<<<<<<<< @@ -2015,7 +2015,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_14KnownHostEntry_2__str__(struct __py int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__str__", 0); - /* "ssh2/knownhost.pyx":93 + /* "ssh2/knownhost.pyx":92 * * def __str__(self): * return self.__repr__() # <<<<<<<<<<<<<< @@ -2023,7 +2023,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, 93, __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, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { @@ -2037,14 +2037,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, 93, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 92, __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":92 + /* "ssh2/knownhost.pyx":91 * return "Known host entry for host: %s" % (self.name) * * def __str__(self): # <<<<<<<<<<<<<< @@ -2065,12 +2065,12 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_14KnownHostEntry_2__str__(struct __py return __pyx_r; } -/* "ssh2/knownhost.pyx":95 +/* "ssh2/knownhost.pyx":94 * return self.__repr__() * * def _dealloc__(self): # <<<<<<<<<<<<<< - * with nogil: - * free(self._store) + * if self._store is not NULL: + * with nogil: */ /* Python wrapper */ @@ -2090,58 +2090,87 @@ static PyObject *__pyx_pw_4ssh2_9knownhost_14KnownHostEntry_5_dealloc__(PyObject static PyObject *__pyx_pf_4ssh2_9knownhost_14KnownHostEntry_4_dealloc__(struct __pyx_obj_4ssh2_9knownhost_KnownHostEntry *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations + int __pyx_t_1; __Pyx_RefNannySetupContext("_dealloc__", 0); - /* "ssh2/knownhost.pyx":96 + /* "ssh2/knownhost.pyx":95 * * def _dealloc__(self): - * with nogil: # <<<<<<<<<<<<<< - * free(self._store) - * + * if self._store is not NULL: # <<<<<<<<<<<<<< + * with nogil: + * free(self._store) */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - __Pyx_FastGIL_Remember(); - #endif - /*try:*/ { + __pyx_t_1 = ((__pyx_v_self->_store != NULL) != 0); + if (__pyx_t_1) { - /* "ssh2/knownhost.pyx":97 + /* "ssh2/knownhost.pyx":96 * def _dealloc__(self): - * with nogil: - * free(self._store) # <<<<<<<<<<<<<< - * - * @property + * if self._store is not NULL: + * with nogil: # <<<<<<<<<<<<<< + * free(self._store) + * self._store = NULL */ - free(__pyx_v_self->_store); - } + { + #ifdef WITH_THREAD + PyThreadState *_save; + Py_UNBLOCK_THREADS + __Pyx_FastGIL_Remember(); + #endif + /*try:*/ { - /* "ssh2/knownhost.pyx":96 + /* "ssh2/knownhost.pyx":97 + * if self._store is not NULL: + * with nogil: + * free(self._store) # <<<<<<<<<<<<<< + * self._store = NULL * + */ + free(__pyx_v_self->_store); + } + + /* "ssh2/knownhost.pyx":96 * def _dealloc__(self): - * with nogil: # <<<<<<<<<<<<<< - * free(self._store) - * + * if self._store is not NULL: + * with nogil: # <<<<<<<<<<<<<< + * free(self._store) + * self._store = NULL */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - __Pyx_FastGIL_Forget(); - Py_BLOCK_THREADS - #endif - goto __pyx_L5; + /*finally:*/ { + /*normal exit:*/{ + #ifdef WITH_THREAD + __Pyx_FastGIL_Forget(); + Py_BLOCK_THREADS + #endif + goto __pyx_L6; + } + __pyx_L6:; } - __pyx_L5:; - } + } + + /* "ssh2/knownhost.pyx":95 + * + * def _dealloc__(self): + * if self._store is not NULL: # <<<<<<<<<<<<<< + * with nogil: + * free(self._store) + */ } - /* "ssh2/knownhost.pyx":95 + /* "ssh2/knownhost.pyx":98 + * with nogil: + * free(self._store) + * self._store = NULL # <<<<<<<<<<<<<< + * + * @property + */ + __pyx_v_self->_store = NULL; + + /* "ssh2/knownhost.pyx":94 * return self.__repr__() * * def _dealloc__(self): # <<<<<<<<<<<<<< - * with nogil: - * free(self._store) + * if self._store is not NULL: + * with nogil: */ /* function exit code */ @@ -2151,7 +2180,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_14KnownHostEntry_4_dealloc__(struct _ return __pyx_r; } -/* "ssh2/knownhost.pyx":100 +/* "ssh2/knownhost.pyx":101 * * @property * def magic(self): # <<<<<<<<<<<<<< @@ -2181,7 +2210,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_14KnownHostEntry_5magic___get__(struc int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "ssh2/knownhost.pyx":102 + /* "ssh2/knownhost.pyx":103 * def magic(self): * """Entry magic number.""" * return self._store.magic # <<<<<<<<<<<<<< @@ -2189,13 +2218,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, 102, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(__pyx_v_self->_store->magic); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/knownhost.pyx":100 + /* "ssh2/knownhost.pyx":101 * * @property * def magic(self): # <<<<<<<<<<<<<< @@ -2214,7 +2243,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_14KnownHostEntry_5magic___get__(struc return __pyx_r; } -/* "ssh2/knownhost.pyx":105 +/* "ssh2/knownhost.pyx":106 * * @property * def name(self): # <<<<<<<<<<<<<< @@ -2245,7 +2274,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_14KnownHostEntry_4name___get__(struct int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "ssh2/knownhost.pyx":107 + /* "ssh2/knownhost.pyx":108 * def name(self): * """Name of host.""" * return self._store.name if self._store.name is not NULL \ # <<<<<<<<<<<<<< @@ -2254,13 +2283,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, 107, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_self->_store->name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __pyx_t_2; __pyx_t_2 = 0; } else { - /* "ssh2/knownhost.pyx":108 + /* "ssh2/knownhost.pyx":109 * """Name of host.""" * return self._store.name if self._store.name is not NULL \ * else None # <<<<<<<<<<<<<< @@ -2274,7 +2303,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_14KnownHostEntry_4name___get__(struct __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/knownhost.pyx":105 + /* "ssh2/knownhost.pyx":106 * * @property * def name(self): # <<<<<<<<<<<<<< @@ -2294,7 +2323,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_14KnownHostEntry_4name___get__(struct return __pyx_r; } -/* "ssh2/knownhost.pyx":111 +/* "ssh2/knownhost.pyx":112 * * @property * def key(self): # <<<<<<<<<<<<<< @@ -2328,7 +2357,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_14KnownHostEntry_3key___get__(struct int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "ssh2/knownhost.pyx":121 + /* "ssh2/knownhost.pyx":122 * 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) \ # <<<<<<<<<<<<<< @@ -2337,7 +2366,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_14KnownHostEntry_3key___get__(struct */ __Pyx_XDECREF(__pyx_r); - /* "ssh2/knownhost.pyx":122 + /* "ssh2/knownhost.pyx":123 * 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 # <<<<<<<<<<<<<< @@ -2346,16 +2375,16 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_14KnownHostEntry_3key___get__(struct */ if (((__pyx_v_self->_store->key != NULL) != 0)) { - /* "ssh2/knownhost.pyx":121 + /* "ssh2/knownhost.pyx":122 * 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, 121, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_b64decode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 122, __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, 121, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->_store->key); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { @@ -2370,14 +2399,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, 121, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 122, __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":122 + /* "ssh2/knownhost.pyx":123 * 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 # <<<<<<<<<<<<<< @@ -2391,7 +2420,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_14KnownHostEntry_3key___get__(struct __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/knownhost.pyx":111 + /* "ssh2/knownhost.pyx":112 * * @property * def key(self): # <<<<<<<<<<<<<< @@ -2414,7 +2443,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_14KnownHostEntry_3key___get__(struct return __pyx_r; } -/* "ssh2/knownhost.pyx":125 +/* "ssh2/knownhost.pyx":126 * * @property * def typemask(self): # <<<<<<<<<<<<<< @@ -2444,7 +2473,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_14KnownHostEntry_8typemask___get__(st int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "ssh2/knownhost.pyx":127 + /* "ssh2/knownhost.pyx":128 * def typemask(self): * """Type mask of host entry.""" * return self._store.typemask # <<<<<<<<<<<<<< @@ -2452,13 +2481,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, 127, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_store->typemask); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/knownhost.pyx":125 + /* "ssh2/knownhost.pyx":126 * * @property * def typemask(self): # <<<<<<<<<<<<<< @@ -2592,7 +2621,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_14KnownHostEntry_8__setstate_cython__ return __pyx_r; } -/* "ssh2/knownhost.pyx":133 +/* "ssh2/knownhost.pyx":134 * """Manage known host entries.""" * * def __cinit__(self, Session session): # <<<<<<<<<<<<<< @@ -2629,7 +2658,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, 133, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 134, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; @@ -2640,13 +2669,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, 133, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 134, __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, 133, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_session), __pyx_ptype_4ssh2_7session_Session, 1, "session", 0))) __PYX_ERR(0, 134, __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 */ @@ -2663,7 +2692,7 @@ static int __pyx_pf_4ssh2_9knownhost_9KnownHost___cinit__(struct __pyx_obj_4ssh2 __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); - /* "ssh2/knownhost.pyx":134 + /* "ssh2/knownhost.pyx":135 * * def __cinit__(self, Session session): * self._ptr = NULL # <<<<<<<<<<<<<< @@ -2672,7 +2701,7 @@ static int __pyx_pf_4ssh2_9knownhost_9KnownHost___cinit__(struct __pyx_obj_4ssh2 */ __pyx_v_self->_ptr = NULL; - /* "ssh2/knownhost.pyx":135 + /* "ssh2/knownhost.pyx":136 * def __cinit__(self, Session session): * self._ptr = NULL * self._session = session # <<<<<<<<<<<<<< @@ -2685,7 +2714,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":133 + /* "ssh2/knownhost.pyx":134 * """Manage known host entries.""" * * def __cinit__(self, Session session): # <<<<<<<<<<<<<< @@ -2699,11 +2728,11 @@ static int __pyx_pf_4ssh2_9knownhost_9KnownHost___cinit__(struct __pyx_obj_4ssh2 return __pyx_r; } -/* "ssh2/knownhost.pyx":137 +/* "ssh2/knownhost.pyx":138 * self._session = session * * def __dealloc__(self): # <<<<<<<<<<<<<< - * if self._ptr is not NULL: + * if self._session is not None and self._session._session is not NULL and self._ptr is not NULL: * c_ssh2.libssh2_knownhost_free(self._ptr) */ @@ -2721,50 +2750,67 @@ static void __pyx_pw_4ssh2_9knownhost_9KnownHost_3__dealloc__(PyObject *__pyx_v_ static void __pyx_pf_4ssh2_9knownhost_9KnownHost_2__dealloc__(struct __pyx_obj_4ssh2_9knownhost_KnownHost *__pyx_v_self) { __Pyx_RefNannyDeclarations int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "ssh2/knownhost.pyx":138 + /* "ssh2/knownhost.pyx":139 * * def __dealloc__(self): - * if self._ptr is not NULL: # <<<<<<<<<<<<<< + * if self._session is not None and self._session._session is not NULL and self._ptr is not NULL: # <<<<<<<<<<<<<< * c_ssh2.libssh2_knownhost_free(self._ptr) - * self._ptr = NULL + * self._ptr = NULL */ - __pyx_t_1 = ((__pyx_v_self->_ptr != NULL) != 0); + __pyx_t_2 = (((PyObject *)__pyx_v_self->_session) != Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + } else { + __pyx_t_1 = __pyx_t_3; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_3 = ((__pyx_v_self->_session->_session != NULL) != 0); + if (__pyx_t_3) { + } else { + __pyx_t_1 = __pyx_t_3; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_3 = ((__pyx_v_self->_ptr != NULL) != 0); + __pyx_t_1 = __pyx_t_3; + __pyx_L4_bool_binop_done:; if (__pyx_t_1) { - /* "ssh2/knownhost.pyx":139 + /* "ssh2/knownhost.pyx":140 * def __dealloc__(self): - * if self._ptr is not NULL: + * if self._session is not None and self._session._session is not NULL and self._ptr is not NULL: * c_ssh2.libssh2_knownhost_free(self._ptr) # <<<<<<<<<<<<<< - * self._ptr = NULL + * self._ptr = NULL * */ libssh2_knownhost_free(__pyx_v_self->_ptr); - /* "ssh2/knownhost.pyx":140 - * if self._ptr is not NULL: - * c_ssh2.libssh2_knownhost_free(self._ptr) - * self._ptr = NULL # <<<<<<<<<<<<<< - * - * def add(self, bytes host, bytes salt, bytes key, int typemask): - */ - __pyx_v_self->_ptr = NULL; - - /* "ssh2/knownhost.pyx":138 + /* "ssh2/knownhost.pyx":139 * * def __dealloc__(self): - * if self._ptr is not NULL: # <<<<<<<<<<<<<< + * if self._session is not None and self._session._session is not NULL and self._ptr is not NULL: # <<<<<<<<<<<<<< * c_ssh2.libssh2_knownhost_free(self._ptr) - * self._ptr = NULL + * self._ptr = NULL */ } - /* "ssh2/knownhost.pyx":137 + /* "ssh2/knownhost.pyx":141 + * if self._session is not None and self._session._session is not NULL and self._ptr is not NULL: + * c_ssh2.libssh2_knownhost_free(self._ptr) + * self._ptr = NULL # <<<<<<<<<<<<<< + * + * def add(self, bytes host, bytes salt, bytes key, int typemask): + */ + __pyx_v_self->_ptr = NULL; + + /* "ssh2/knownhost.pyx":138 * self._session = session * * def __dealloc__(self): # <<<<<<<<<<<<<< - * if self._ptr is not NULL: + * if self._session is not None and self._session._session is not NULL and self._ptr is not NULL: * c_ssh2.libssh2_knownhost_free(self._ptr) */ @@ -2772,8 +2818,8 @@ static void __pyx_pf_4ssh2_9knownhost_9KnownHost_2__dealloc__(struct __pyx_obj_4 __Pyx_RefNannyFinishContext(); } -/* "ssh2/knownhost.pyx":142 - * self._ptr = NULL +/* "ssh2/knownhost.pyx":143 + * self._ptr = NULL * * def add(self, bytes host, bytes salt, bytes key, int typemask): # <<<<<<<<<<<<<< * """Deprecated - use ``self.addc``""" @@ -2821,23 +2867,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, 142, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("add", 1, 4, 4, 1); __PYX_ERR(0, 143, __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, 142, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("add", 1, 4, 4, 2); __PYX_ERR(0, 143, __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, 142, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("add", 1, 4, 4, 3); __PYX_ERR(0, 143, __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, 142, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add") < 0)) __PYX_ERR(0, 143, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; @@ -2850,19 +2896,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, 142, __pyx_L3_error) + __pyx_v_typemask = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_typemask == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 143, __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, 142, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("add", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 143, __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, 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) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_host), (&PyBytes_Type), 1, "host", 1))) __PYX_ERR(0, 143, __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_key), (&PyBytes_Type), 1, "key", 1))) __PYX_ERR(0, 143, __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 */ @@ -2882,7 +2928,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_4add(CYTHON_UNUSED struct int __pyx_clineno = 0; __Pyx_RefNannySetupContext("add", 0); - /* "ssh2/knownhost.pyx":144 + /* "ssh2/knownhost.pyx":145 * def add(self, bytes host, bytes salt, bytes key, int typemask): * """Deprecated - use ``self.addc``""" * raise NotImplementedError # <<<<<<<<<<<<<< @@ -2890,10 +2936,10 @@ 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, 144, __pyx_L1_error) + __PYX_ERR(0, 145, __pyx_L1_error) - /* "ssh2/knownhost.pyx":142 - * self._ptr = NULL + /* "ssh2/knownhost.pyx":143 + * self._ptr = NULL * * def add(self, bytes host, bytes salt, bytes key, int typemask): # <<<<<<<<<<<<<< * """Deprecated - use ``self.addc``""" @@ -2909,7 +2955,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_4add(CYTHON_UNUSED struct return __pyx_r; } -/* "ssh2/knownhost.pyx":146 +/* "ssh2/knownhost.pyx":147 * raise NotImplementedError * * def addc(self, bytes host not None, bytes key not None, # <<<<<<<<<<<<<< @@ -2936,7 +2982,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":147 + /* "ssh2/knownhost.pyx":148 * * def addc(self, bytes host not None, bytes key not None, * int typemask, bytes salt=None, bytes comment=None): # <<<<<<<<<<<<<< @@ -2971,13 +3017,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, 146, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("addc", 0, 3, 5, 1); __PYX_ERR(0, 147, __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, 146, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("addc", 0, 3, 5, 2); __PYX_ERR(0, 147, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: @@ -2993,7 +3039,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, 146, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "addc") < 0)) __PYX_ERR(0, 147, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -3010,25 +3056,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, 147, __pyx_L3_error) + __pyx_v_typemask = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_typemask == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 148, __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, 146, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("addc", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 147, __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, 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) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_host), (&PyBytes_Type), 0, "host", 1))) __PYX_ERR(0, 147, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_key), (&PyBytes_Type), 0, "key", 1))) __PYX_ERR(0, 147, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_salt), (&PyBytes_Type), 1, "salt", 1))) __PYX_ERR(0, 148, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_comment), (&PyBytes_Type), 1, "comment", 1))) __PYX_ERR(0, 148, __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":146 + /* "ssh2/knownhost.pyx":147 * raise NotImplementedError * * def addc(self, bytes host not None, bytes key not None, # <<<<<<<<<<<<<< @@ -3072,27 +3118,27 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_6addc(struct __pyx_obj_4ss int __pyx_clineno = 0; __Pyx_RefNannySetupContext("addc", 0); - /* "ssh2/knownhost.pyx":175 + /* "ssh2/knownhost.pyx":176 * :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, 175, __pyx_L1_error) + __pyx_t_1 = PyBytes_GET_SIZE(__pyx_v_key); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 176, __pyx_L1_error) __pyx_v_keylen = __pyx_t_1; - /* "ssh2/knownhost.pyx":177 + /* "ssh2/knownhost.pyx":178 * 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, 177, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_host); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 178, __pyx_L1_error) __pyx_v__host = __pyx_t_2; - /* "ssh2/knownhost.pyx":179 + /* "ssh2/knownhost.pyx":180 * cdef char *_host = host * cdef char *_salt * if salt is not None: # <<<<<<<<<<<<<< @@ -3103,7 +3149,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":180 + /* "ssh2/knownhost.pyx":181 * cdef char *_salt * if salt is not None: * _salt = salt # <<<<<<<<<<<<<< @@ -3112,12 +3158,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, 180, __pyx_L1_error) + __PYX_ERR(0, 181, __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_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_salt); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 181, __pyx_L1_error) __pyx_v__salt = __pyx_t_2; - /* "ssh2/knownhost.pyx":179 + /* "ssh2/knownhost.pyx":180 * cdef char *_host = host * cdef char *_salt * if salt is not None: # <<<<<<<<<<<<<< @@ -3127,7 +3173,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_6addc(struct __pyx_obj_4ss goto __pyx_L3; } - /* "ssh2/knownhost.pyx":182 + /* "ssh2/knownhost.pyx":183 * _salt = salt * else: * _salt = "" # <<<<<<<<<<<<<< @@ -3139,17 +3185,17 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_6addc(struct __pyx_obj_4ss } __pyx_L3:; - /* "ssh2/knownhost.pyx":183 + /* "ssh2/knownhost.pyx":184 * 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, 183, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_key); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 184, __pyx_L1_error) __pyx_v__key = __pyx_t_2; - /* "ssh2/knownhost.pyx":185 + /* "ssh2/knownhost.pyx":186 * cdef char *_key = key * cdef char *_comment * if comment is not None: # <<<<<<<<<<<<<< @@ -3160,7 +3206,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":186 + /* "ssh2/knownhost.pyx":187 * cdef char *_comment * if comment is not None: * _comment = comment # <<<<<<<<<<<<<< @@ -3169,12 +3215,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, 186, __pyx_L1_error) + __PYX_ERR(0, 187, __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_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_comment); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 187, __pyx_L1_error) __pyx_v__comment = __pyx_t_2; - /* "ssh2/knownhost.pyx":185 + /* "ssh2/knownhost.pyx":186 * cdef char *_key = key * cdef char *_comment * if comment is not None: # <<<<<<<<<<<<<< @@ -3184,7 +3230,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_6addc(struct __pyx_obj_4ss goto __pyx_L4; } - /* "ssh2/knownhost.pyx":188 + /* "ssh2/knownhost.pyx":189 * _comment = comment * else: * _comment = NULL # <<<<<<<<<<<<<< @@ -3196,19 +3242,19 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_6addc(struct __pyx_obj_4ss } __pyx_L4:; - /* "ssh2/knownhost.pyx":190 + /* "ssh2/knownhost.pyx":191 * _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, 190, __pyx_L1_error) + __pyx_t_5 = ((PyObject *)__pyx_f_4ssh2_9knownhost_PyNewKnownHostEntry()); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 191, __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":191 + /* "ssh2/knownhost.pyx":192 * cdef int rc * cdef KnownHostEntry entry = PyNewKnownHostEntry() * comment_len = len(comment) if comment is not None else 0 # <<<<<<<<<<<<<< @@ -3219,16 +3265,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, 191, __pyx_L1_error) + __PYX_ERR(0, 192, __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_1 = PyBytes_GET_SIZE(__pyx_v_comment); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 192, __pyx_L1_error) __pyx_t_6 = __pyx_t_1; } else { __pyx_t_6 = 0; } __pyx_v_comment_len = __pyx_t_6; - /* "ssh2/knownhost.pyx":192 + /* "ssh2/knownhost.pyx":193 * cdef KnownHostEntry entry = PyNewKnownHostEntry() * comment_len = len(comment) if comment is not None else 0 * with nogil: # <<<<<<<<<<<<<< @@ -3243,7 +3289,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_6addc(struct __pyx_obj_4ss #endif /*try:*/ { - /* "ssh2/knownhost.pyx":193 + /* "ssh2/knownhost.pyx":194 * comment_len = len(comment) if comment is not None else 0 * with nogil: * rc = c_ssh2.libssh2_knownhost_addc( # <<<<<<<<<<<<<< @@ -3253,7 +3299,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":192 + /* "ssh2/knownhost.pyx":193 * cdef KnownHostEntry entry = PyNewKnownHostEntry() * comment_len = len(comment) if comment is not None else 0 * with nogil: # <<<<<<<<<<<<<< @@ -3272,7 +3318,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_6addc(struct __pyx_obj_4ss } } - /* "ssh2/knownhost.pyx":196 + /* "ssh2/knownhost.pyx":197 * self._ptr, _host, _salt, _key, keylen, _comment, comment_len, * typemask, &entry._store) * if rc != 0: # <<<<<<<<<<<<<< @@ -3282,24 +3328,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":197 + /* "ssh2/knownhost.pyx":198 * 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, 197, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_KnownHostAddError); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - /* "ssh2/knownhost.pyx":199 + /* "ssh2/knownhost.pyx":200 * 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, 199, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = NULL; __pyx_t_10 = 0; @@ -3316,7 +3362,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, 197, __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, 198, __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; @@ -3325,14 +3371,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, 197, __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, 198, __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, 197, __pyx_L1_error) + __pyx_t_11 = PyTuple_New(3+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 198, __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; @@ -3346,16 +3392,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, 197, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_11, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 198, __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, 197, __pyx_L1_error) + __PYX_ERR(0, 198, __pyx_L1_error) - /* "ssh2/knownhost.pyx":196 + /* "ssh2/knownhost.pyx":197 * self._ptr, _host, _salt, _key, keylen, _comment, comment_len, * typemask, &entry._store) * if rc != 0: # <<<<<<<<<<<<<< @@ -3364,7 +3410,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_6addc(struct __pyx_obj_4ss */ } - /* "ssh2/knownhost.pyx":200 + /* "ssh2/knownhost.pyx":201 * "Error adding known host entry for host %s - error code %s", * host, rc) * return entry # <<<<<<<<<<<<<< @@ -3376,7 +3422,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":146 + /* "ssh2/knownhost.pyx":147 * raise NotImplementedError * * def addc(self, bytes host not None, bytes key not None, # <<<<<<<<<<<<<< @@ -3400,7 +3446,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_6addc(struct __pyx_obj_4ss return __pyx_r; } -/* "ssh2/knownhost.pyx":202 +/* "ssh2/knownhost.pyx":203 * return entry * * def check(self, bytes host, bytes key, int typemask): # <<<<<<<<<<<<<< @@ -3446,17 +3492,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, 202, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("check", 1, 3, 3, 1); __PYX_ERR(0, 203, __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, 202, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("check", 1, 3, 3, 2); __PYX_ERR(0, 203, __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, 202, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "check") < 0)) __PYX_ERR(0, 203, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -3467,18 +3513,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, 202, __pyx_L3_error) + __pyx_v_typemask = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_typemask == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 203, __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, 202, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("check", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 203, __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, 202, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_key), (&PyBytes_Type), 1, "key", 1))) __PYX_ERR(0, 202, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_host), (&PyBytes_Type), 1, "host", 1))) __PYX_ERR(0, 203, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_key), (&PyBytes_Type), 1, "key", 1))) __PYX_ERR(0, 203, __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 */ @@ -3498,7 +3544,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_8check(CYTHON_UNUSED struc int __pyx_clineno = 0; __Pyx_RefNannySetupContext("check", 0); - /* "ssh2/knownhost.pyx":204 + /* "ssh2/knownhost.pyx":205 * def check(self, bytes host, bytes key, int typemask): * """Deprecated - use ``self.checkp``""" * raise NotImplementedError # <<<<<<<<<<<<<< @@ -3506,9 +3552,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, 204, __pyx_L1_error) + __PYX_ERR(0, 205, __pyx_L1_error) - /* "ssh2/knownhost.pyx":202 + /* "ssh2/knownhost.pyx":203 * return entry * * def check(self, bytes host, bytes key, int typemask): # <<<<<<<<<<<<<< @@ -3525,7 +3571,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_8check(CYTHON_UNUSED struc return __pyx_r; } -/* "ssh2/knownhost.pyx":206 +/* "ssh2/knownhost.pyx":207 * raise NotImplementedError * * def checkp(self, bytes host not None, int port, bytes key not None, # <<<<<<<<<<<<<< @@ -3574,23 +3620,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, 206, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("checkp", 1, 4, 4, 1); __PYX_ERR(0, 207, __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, 206, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("checkp", 1, 4, 4, 2); __PYX_ERR(0, 207, __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, 206, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("checkp", 1, 4, 4, 3); __PYX_ERR(0, 207, __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, 206, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "checkp") < 0)) __PYX_ERR(0, 207, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; @@ -3601,20 +3647,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, 206, __pyx_L3_error) + __pyx_v_port = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_port == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 207, __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, 207, __pyx_L3_error) + __pyx_v_typemask = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_typemask == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 208, __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, 206, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("checkp", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 207, __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, 206, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_key), (&PyBytes_Type), 0, "key", 1))) __PYX_ERR(0, 206, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_host), (&PyBytes_Type), 0, "host", 1))) __PYX_ERR(0, 207, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_key), (&PyBytes_Type), 0, "key", 1))) __PYX_ERR(0, 207, __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 */ @@ -3648,49 +3694,49 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_10checkp(struct __pyx_obj_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("checkp", 0); - /* "ssh2/knownhost.pyx":242 + /* "ssh2/knownhost.pyx":243 * * :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, 242, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBytes_AsWritableString(__pyx_v_host); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(0, 243, __pyx_L1_error) __pyx_v__host = __pyx_t_1; - /* "ssh2/knownhost.pyx":243 + /* "ssh2/knownhost.pyx":244 * :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, 243, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBytes_AsWritableString(__pyx_v_key); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(0, 244, __pyx_L1_error) __pyx_v__key = __pyx_t_1; - /* "ssh2/knownhost.pyx":244 + /* "ssh2/knownhost.pyx":245 * 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, 244, __pyx_L1_error) + __pyx_t_2 = PyBytes_GET_SIZE(__pyx_v_key); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 245, __pyx_L1_error) __pyx_v_keylen = __pyx_t_2; - /* "ssh2/knownhost.pyx":245 + /* "ssh2/knownhost.pyx":246 * 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, 245, __pyx_L1_error) + __pyx_t_3 = ((PyObject *)__pyx_f_4ssh2_9knownhost_PyNewKnownHostEntry()); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 246, __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":247 + /* "ssh2/knownhost.pyx":248 * cdef KnownHostEntry entry = PyNewKnownHostEntry() * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -3705,7 +3751,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_10checkp(struct __pyx_obj_ #endif /*try:*/ { - /* "ssh2/knownhost.pyx":248 + /* "ssh2/knownhost.pyx":249 * cdef int rc * with nogil: * rc = c_ssh2.libssh2_knownhost_checkp( # <<<<<<<<<<<<<< @@ -3715,7 +3761,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":247 + /* "ssh2/knownhost.pyx":248 * cdef KnownHostEntry entry = PyNewKnownHostEntry() * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -3734,7 +3780,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_10checkp(struct __pyx_obj_ } } - /* "ssh2/knownhost.pyx":250 + /* "ssh2/knownhost.pyx":251 * rc = c_ssh2.libssh2_knownhost_checkp( * self._ptr, _host, port, _key, keylen, typemask, &entry._store) * if rc != c_ssh2.LIBSSH2_KNOWNHOST_CHECK_MATCH: # <<<<<<<<<<<<<< @@ -3744,7 +3790,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":251 + /* "ssh2/knownhost.pyx":252 * 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: # <<<<<<<<<<<<<< @@ -3754,24 +3800,24 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_10checkp(struct __pyx_obj_ switch (__pyx_v_rc) { case LIBSSH2_KNOWNHOST_CHECK_FAILURE: - /* "ssh2/knownhost.pyx":252 + /* "ssh2/knownhost.pyx":253 * 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, 252, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_KnownHostCheckFailure); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - /* "ssh2/knownhost.pyx":254 + /* "ssh2/knownhost.pyx":255 * 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, 254, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_8 = 0; @@ -3788,7 +3834,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, 252, __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, 253, __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; @@ -3797,14 +3843,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, 252, __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, 253, __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, 252, __pyx_L1_error) + __pyx_t_9 = PyTuple_New(3+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 253, __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; @@ -3818,16 +3864,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, 252, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 253, __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, 252, __pyx_L1_error) + __PYX_ERR(0, 253, __pyx_L1_error) - /* "ssh2/knownhost.pyx":251 + /* "ssh2/knownhost.pyx":252 * 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: # <<<<<<<<<<<<<< @@ -3837,17 +3883,17 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_10checkp(struct __pyx_obj_ break; case LIBSSH2_KNOWNHOST_CHECK_NOTFOUND: - /* "ssh2/knownhost.pyx":256 + /* "ssh2/knownhost.pyx":257 * "- 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, 256, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_KnownHostCheckNotFoundError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - /* "ssh2/knownhost.pyx":257 + /* "ssh2/knownhost.pyx":258 * elif rc == c_ssh2.LIBSSH2_KNOWNHOST_CHECK_NOTFOUND: * raise KnownHostCheckNotFoundError( * "Host %s not found in known hosts collection", host) # <<<<<<<<<<<<<< @@ -3869,7 +3915,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, 256, __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, 257, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_3); } else @@ -3877,13 +3923,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, 256, __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, 257, __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, 256, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 257, __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; @@ -3894,16 +3940,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, 256, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 257, __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, 256, __pyx_L1_error) + __PYX_ERR(0, 257, __pyx_L1_error) - /* "ssh2/knownhost.pyx":255 + /* "ssh2/knownhost.pyx":256 * "Could not check known host entry for host %s " * "- error code %s", host, rc) * elif rc == c_ssh2.LIBSSH2_KNOWNHOST_CHECK_NOTFOUND: # <<<<<<<<<<<<<< @@ -3913,24 +3959,24 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_10checkp(struct __pyx_obj_ break; case LIBSSH2_KNOWNHOST_CHECK_MISMATCH: - /* "ssh2/knownhost.pyx":259 + /* "ssh2/knownhost.pyx":260 * "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, 259, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_KnownHostCheckMisMatchError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - /* "ssh2/knownhost.pyx":261 + /* "ssh2/knownhost.pyx":262 * 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, 261, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 262, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_9 = NULL; __pyx_t_8 = 0; @@ -3947,7 +3993,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, 259, __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, 260, __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; @@ -3956,14 +4002,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, 259, __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, 260, __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, 259, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(3+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 260, __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; @@ -3977,16 +4023,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, 259, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 260, __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, 259, __pyx_L1_error) + __PYX_ERR(0, 260, __pyx_L1_error) - /* "ssh2/knownhost.pyx":258 + /* "ssh2/knownhost.pyx":259 * raise KnownHostCheckNotFoundError( * "Host %s not found in known hosts collection", host) * elif rc == c_ssh2.LIBSSH2_KNOWNHOST_CHECK_MISMATCH: # <<<<<<<<<<<<<< @@ -3997,17 +4043,17 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_10checkp(struct __pyx_obj_ default: break; } - /* "ssh2/knownhost.pyx":262 + /* "ssh2/knownhost.pyx":263 * "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, 262, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_KnownHostCheckError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - /* "ssh2/knownhost.pyx":263 + /* "ssh2/knownhost.pyx":264 * "error code %s", host, rc) * raise KnownHostCheckError( * "Unknown error occurred checking known host %s", host) # <<<<<<<<<<<<<< @@ -4029,7 +4075,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, 262, __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, 263, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_3); } else @@ -4037,13 +4083,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, 262, __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, 263, __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, 262, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 263, __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; @@ -4054,16 +4100,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, 262, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 263, __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, 262, __pyx_L1_error) + __PYX_ERR(0, 263, __pyx_L1_error) - /* "ssh2/knownhost.pyx":250 + /* "ssh2/knownhost.pyx":251 * rc = c_ssh2.libssh2_knownhost_checkp( * self._ptr, _host, port, _key, keylen, typemask, &entry._store) * if rc != c_ssh2.LIBSSH2_KNOWNHOST_CHECK_MATCH: # <<<<<<<<<<<<<< @@ -4072,7 +4118,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_10checkp(struct __pyx_obj_ */ } - /* "ssh2/knownhost.pyx":264 + /* "ssh2/knownhost.pyx":265 * raise KnownHostCheckError( * "Unknown error occurred checking known host %s", host) * return entry # <<<<<<<<<<<<<< @@ -4084,7 +4130,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_10checkp(struct __pyx_obj_ __pyx_r = ((PyObject *)__pyx_v_entry); goto __pyx_L0; - /* "ssh2/knownhost.pyx":206 + /* "ssh2/knownhost.pyx":207 * raise NotImplementedError * * def checkp(self, bytes host not None, int port, bytes key not None, # <<<<<<<<<<<<<< @@ -4108,7 +4154,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_10checkp(struct __pyx_obj_ return __pyx_r; } -/* "ssh2/knownhost.pyx":266 +/* "ssh2/knownhost.pyx":267 * return entry * * def delete(self, KnownHostEntry entry not None): # <<<<<<<<<<<<<< @@ -4126,7 +4172,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, 266, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_entry), __pyx_ptype_4ssh2_9knownhost_KnownHostEntry, 0, "entry", 0))) __PYX_ERR(0, 267, __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 */ @@ -4154,7 +4200,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_12delete(struct __pyx_obj_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("delete", 0); - /* "ssh2/knownhost.pyx":275 + /* "ssh2/knownhost.pyx":276 * deleting host entry.""" * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -4169,7 +4215,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_12delete(struct __pyx_obj_ #endif /*try:*/ { - /* "ssh2/knownhost.pyx":276 + /* "ssh2/knownhost.pyx":277 * cdef int rc * with nogil: * rc = c_ssh2.libssh2_knownhost_del(self._ptr, entry._store) # <<<<<<<<<<<<<< @@ -4179,7 +4225,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":275 + /* "ssh2/knownhost.pyx":276 * deleting host entry.""" * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -4198,7 +4244,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_12delete(struct __pyx_obj_ } } - /* "ssh2/knownhost.pyx":277 + /* "ssh2/knownhost.pyx":278 * with nogil: * rc = c_ssh2.libssh2_knownhost_del(self._ptr, entry._store) * if rc != 0: # <<<<<<<<<<<<<< @@ -4208,24 +4254,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":278 + /* "ssh2/knownhost.pyx":279 * 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, 278, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_KnownHostDeleteError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 279, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - /* "ssh2/knownhost.pyx":279 + /* "ssh2/knownhost.pyx":280 * 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, 279, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; @@ -4242,7 +4288,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, 278, __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, 279, __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; @@ -4251,14 +4297,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, 278, __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, 279, __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, 278, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 279, __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; @@ -4269,16 +4315,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, 278, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 279, __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, 278, __pyx_L1_error) + __PYX_ERR(0, 279, __pyx_L1_error) - /* "ssh2/knownhost.pyx":277 + /* "ssh2/knownhost.pyx":278 * with nogil: * rc = c_ssh2.libssh2_knownhost_del(self._ptr, entry._store) * if rc != 0: # <<<<<<<<<<<<<< @@ -4287,7 +4333,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_12delete(struct __pyx_obj_ */ } - /* "ssh2/knownhost.pyx":266 + /* "ssh2/knownhost.pyx":267 * return entry * * def delete(self, KnownHostEntry entry not None): # <<<<<<<<<<<<<< @@ -4312,7 +4358,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_12delete(struct __pyx_obj_ return __pyx_r; } -/* "ssh2/knownhost.pyx":281 +/* "ssh2/knownhost.pyx":282 * "Error deleting known host entry - error code %s", rc) * * def readline(self, bytes line not None, # <<<<<<<<<<<<<< @@ -4359,7 +4405,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, 281, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "readline") < 0)) __PYX_ERR(0, 282, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -4372,20 +4418,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, 282, __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, 283, __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, 281, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("readline", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 282, __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, 281, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_line), (&PyBytes_Type), 0, "line", 1))) __PYX_ERR(0, 282, __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 */ @@ -4417,27 +4463,27 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_14readline(struct __pyx_ob int __pyx_clineno = 0; __Pyx_RefNannySetupContext("readline", 0); - /* "ssh2/knownhost.pyx":296 + /* "ssh2/knownhost.pyx":297 * 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, 296, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBytes_AsWritableString(__pyx_v_line); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(0, 297, __pyx_L1_error) __pyx_v__line = __pyx_t_1; - /* "ssh2/knownhost.pyx":297 + /* "ssh2/knownhost.pyx":298 * 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, 297, __pyx_L1_error) + __pyx_t_2 = PyBytes_GET_SIZE(__pyx_v_line); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 298, __pyx_L1_error) __pyx_v_line_len = __pyx_t_2; - /* "ssh2/knownhost.pyx":298 + /* "ssh2/knownhost.pyx":299 * cdef char *_line = line * cdef size_t line_len = len(line) * with nogil: # <<<<<<<<<<<<<< @@ -4452,7 +4498,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_14readline(struct __pyx_ob #endif /*try:*/ { - /* "ssh2/knownhost.pyx":299 + /* "ssh2/knownhost.pyx":300 * cdef size_t line_len = len(line) * with nogil: * rc = c_ssh2.libssh2_knownhost_readline( # <<<<<<<<<<<<<< @@ -4462,7 +4508,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":298 + /* "ssh2/knownhost.pyx":299 * cdef char *_line = line * cdef size_t line_len = len(line) * with nogil: # <<<<<<<<<<<<<< @@ -4481,7 +4527,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_14readline(struct __pyx_ob } } - /* "ssh2/knownhost.pyx":301 + /* "ssh2/knownhost.pyx":302 * rc = c_ssh2.libssh2_knownhost_readline( * self._ptr, _line, line_len, f_type) * if rc != 0: # <<<<<<<<<<<<<< @@ -4491,24 +4537,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":302 + /* "ssh2/knownhost.pyx":303 * 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, 302, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_KnownHostReadLineError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - /* "ssh2/knownhost.pyx":303 + /* "ssh2/knownhost.pyx":304 * 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, 303, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_8 = 0; @@ -4525,7 +4571,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, 302, __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, 303, __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; @@ -4534,14 +4580,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, 302, __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, 303, __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, 302, __pyx_L1_error) + __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 303, __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; @@ -4552,16 +4598,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, 302, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 303, __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, 302, __pyx_L1_error) + __PYX_ERR(0, 303, __pyx_L1_error) - /* "ssh2/knownhost.pyx":301 + /* "ssh2/knownhost.pyx":302 * rc = c_ssh2.libssh2_knownhost_readline( * self._ptr, _line, line_len, f_type) * if rc != 0: # <<<<<<<<<<<<<< @@ -4570,7 +4616,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_14readline(struct __pyx_ob */ } - /* "ssh2/knownhost.pyx":281 + /* "ssh2/knownhost.pyx":282 * "Error deleting known host entry - error code %s", rc) * * def readline(self, bytes line not None, # <<<<<<<<<<<<<< @@ -4595,7 +4641,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_14readline(struct __pyx_ob return __pyx_r; } -/* "ssh2/knownhost.pyx":305 +/* "ssh2/knownhost.pyx":306 * "Error deleting line from known hosts - error code %s", rc) * * def readfile(self, filename not None, # <<<<<<<<<<<<<< @@ -4642,7 +4688,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, 305, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "readfile") < 0)) __PYX_ERR(0, 306, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -4655,21 +4701,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, 306, __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, 307, __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, 305, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("readfile", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 306, __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, 305, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "filename"); __PYX_ERR(0, 306, __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); @@ -4701,19 +4747,19 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_16readfile(struct __pyx_ob int __pyx_clineno = 0; __Pyx_RefNannySetupContext("readfile", 0); - /* "ssh2/knownhost.pyx":319 + /* "ssh2/knownhost.pyx":320 * * :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, 319, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_filename); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 320, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_b_filename = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/knownhost.pyx":320 + /* "ssh2/knownhost.pyx":321 * :rtype: int""" * cdef bytes b_filename = to_bytes(filename) * cdef char *_filename = b_filename # <<<<<<<<<<<<<< @@ -4722,12 +4768,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, 320, __pyx_L1_error) + __PYX_ERR(0, 321, __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_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_filename); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 321, __pyx_L1_error) __pyx_v__filename = __pyx_t_2; - /* "ssh2/knownhost.pyx":322 + /* "ssh2/knownhost.pyx":323 * cdef char *_filename = b_filename * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -4742,7 +4788,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_16readfile(struct __pyx_ob #endif /*try:*/ { - /* "ssh2/knownhost.pyx":323 + /* "ssh2/knownhost.pyx":324 * cdef int rc * with nogil: * rc = c_ssh2.libssh2_knownhost_readfile( # <<<<<<<<<<<<<< @@ -4752,7 +4798,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":322 + /* "ssh2/knownhost.pyx":323 * cdef char *_filename = b_filename * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -4771,7 +4817,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_16readfile(struct __pyx_ob } } - /* "ssh2/knownhost.pyx":325 + /* "ssh2/knownhost.pyx":326 * rc = c_ssh2.libssh2_knownhost_readfile( * self._ptr, _filename, f_type) * if rc < 0: # <<<<<<<<<<<<<< @@ -4781,24 +4827,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":326 + /* "ssh2/knownhost.pyx":327 * 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, 326, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_KnownHostReadFileError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 327, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - /* "ssh2/knownhost.pyx":328 + /* "ssh2/knownhost.pyx":329 * 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, 328, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 329, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; __pyx_t_7 = 0; @@ -4815,7 +4861,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, 326, __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, 327, __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; @@ -4824,14 +4870,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, 326, __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, 327, __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, 326, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 327, __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; @@ -4845,16 +4891,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, 326, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 327, __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, 326, __pyx_L1_error) + __PYX_ERR(0, 327, __pyx_L1_error) - /* "ssh2/knownhost.pyx":325 + /* "ssh2/knownhost.pyx":326 * rc = c_ssh2.libssh2_knownhost_readfile( * self._ptr, _filename, f_type) * if rc < 0: # <<<<<<<<<<<<<< @@ -4863,7 +4909,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_16readfile(struct __pyx_ob */ } - /* "ssh2/knownhost.pyx":329 + /* "ssh2/knownhost.pyx":330 * "Error reading known hosts file %s - error code %s", * filename, rc) * return rc # <<<<<<<<<<<<<< @@ -4871,13 +4917,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, 329, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/knownhost.pyx":305 + /* "ssh2/knownhost.pyx":306 * "Error deleting line from known hosts - error code %s", rc) * * def readfile(self, filename not None, # <<<<<<<<<<<<<< @@ -4901,7 +4947,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_16readfile(struct __pyx_ob return __pyx_r; } -/* "ssh2/knownhost.pyx":331 +/* "ssh2/knownhost.pyx":332 * return rc * * def writeline(self, KnownHostEntry entry, # <<<<<<<<<<<<<< @@ -4957,7 +5003,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, 331, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "writeline") < 0)) __PYX_ERR(0, 332, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -4972,25 +5018,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, 332, __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, 333, __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, 333, __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, 334, __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, 331, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("writeline", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 332, __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, 331, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_entry), __pyx_ptype_4ssh2_9knownhost_KnownHostEntry, 1, "entry", 0))) __PYX_ERR(0, 332, __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 */ @@ -5029,7 +5075,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_18writeline(struct __pyx_o int __pyx_clineno = 0; __Pyx_RefNannySetupContext("writeline", 0); - /* "ssh2/knownhost.pyx":345 + /* "ssh2/knownhost.pyx":346 * * :rtype: bytes""" * cdef bytes output = b"" # <<<<<<<<<<<<<< @@ -5039,7 +5085,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":346 + /* "ssh2/knownhost.pyx":347 * :rtype: bytes""" * cdef bytes output = b"" * cdef size_t outlen = 0 # <<<<<<<<<<<<<< @@ -5048,7 +5094,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_18writeline(struct __pyx_o */ __pyx_v_outlen = 0; - /* "ssh2/knownhost.pyx":349 + /* "ssh2/knownhost.pyx":350 * cdef char *buf * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -5063,7 +5109,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_18writeline(struct __pyx_o #endif /*try:*/ { - /* "ssh2/knownhost.pyx":350 + /* "ssh2/knownhost.pyx":351 * cdef int rc * with nogil: * buf = malloc(sizeof(char)*buf_len) # <<<<<<<<<<<<<< @@ -5072,7 +5118,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":351 + /* "ssh2/knownhost.pyx":352 * with nogil: * buf = malloc(sizeof(char)*buf_len) * if buf is NULL: # <<<<<<<<<<<<<< @@ -5082,7 +5128,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":352 + /* "ssh2/knownhost.pyx":353 * buf = malloc(sizeof(char)*buf_len) * if buf is NULL: * with gil: # <<<<<<<<<<<<<< @@ -5095,17 +5141,17 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_18writeline(struct __pyx_o #endif /*try:*/ { - /* "ssh2/knownhost.pyx":353 + /* "ssh2/knownhost.pyx":354 * 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, 353, __pyx_L8_error) + PyErr_NoMemory(); __PYX_ERR(0, 354, __pyx_L8_error) } - /* "ssh2/knownhost.pyx":352 + /* "ssh2/knownhost.pyx":353 * buf = malloc(sizeof(char)*buf_len) * if buf is NULL: * with gil: # <<<<<<<<<<<<<< @@ -5122,7 +5168,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_18writeline(struct __pyx_o } } - /* "ssh2/knownhost.pyx":351 + /* "ssh2/knownhost.pyx":352 * with nogil: * buf = malloc(sizeof(char)*buf_len) * if buf is NULL: # <<<<<<<<<<<<<< @@ -5131,7 +5177,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_18writeline(struct __pyx_o */ } - /* "ssh2/knownhost.pyx":354 + /* "ssh2/knownhost.pyx":355 * with gil: * raise MemoryError * rc = c_ssh2.libssh2_knownhost_writeline( # <<<<<<<<<<<<<< @@ -5141,7 +5187,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":349 + /* "ssh2/knownhost.pyx":350 * cdef char *buf * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -5167,7 +5213,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_18writeline(struct __pyx_o } } - /* "ssh2/knownhost.pyx":356 + /* "ssh2/knownhost.pyx":357 * rc = c_ssh2.libssh2_knownhost_writeline( * self._ptr, entry._store, buf, buf_len, &outlen, f_type) * try: # <<<<<<<<<<<<<< @@ -5176,7 +5222,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_18writeline(struct __pyx_o */ /*try:*/ { - /* "ssh2/knownhost.pyx":357 + /* "ssh2/knownhost.pyx":358 * self._ptr, entry._store, buf, buf_len, &outlen, f_type) * try: * if rc == _LIBSSH2_ERROR_BUFFER_TOO_SMALL: # <<<<<<<<<<<<<< @@ -5186,7 +5232,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":358 + /* "ssh2/knownhost.pyx":359 * try: * if rc == _LIBSSH2_ERROR_BUFFER_TOO_SMALL: * return self.writeline(entry, buf_len=buf_len*2) # <<<<<<<<<<<<<< @@ -5194,20 +5240,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, 358, __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, 359, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 358, __pyx_L11_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 359, __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, 358, __pyx_L11_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 359, __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, 358, __pyx_L11_error) + __pyx_t_5 = __Pyx_PyInt_FromSize_t((__pyx_v_buf_len * 2)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 359, __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, 358, __pyx_L11_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_buf_len, __pyx_t_5) < 0) __PYX_ERR(0, 359, __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, 358, __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, 359, __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; @@ -5216,7 +5262,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_18writeline(struct __pyx_o __pyx_t_5 = 0; goto __pyx_L10_return; - /* "ssh2/knownhost.pyx":357 + /* "ssh2/knownhost.pyx":358 * self._ptr, entry._store, buf, buf_len, &outlen, f_type) * try: * if rc == _LIBSSH2_ERROR_BUFFER_TOO_SMALL: # <<<<<<<<<<<<<< @@ -5225,7 +5271,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_18writeline(struct __pyx_o */ } - /* "ssh2/knownhost.pyx":359 + /* "ssh2/knownhost.pyx":360 * if rc == _LIBSSH2_ERROR_BUFFER_TOO_SMALL: * return self.writeline(entry, buf_len=buf_len*2) * elif rc != 0: # <<<<<<<<<<<<<< @@ -5235,24 +5281,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":360 + /* "ssh2/knownhost.pyx":361 * 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, 360, __pyx_L11_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_KnownHostWriteLineError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 361, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_4); - /* "ssh2/knownhost.pyx":362 + /* "ssh2/knownhost.pyx":363 * 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, 362, __pyx_L11_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 363, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = NULL; __pyx_t_6 = 0; @@ -5269,7 +5315,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, 360, __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, 361, __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; @@ -5278,14 +5324,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, 360, __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, 361, __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, 360, __pyx_L11_error) + __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 361, __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; @@ -5296,16 +5342,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, 360, __pyx_L11_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 361, __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, 360, __pyx_L11_error) + __PYX_ERR(0, 361, __pyx_L11_error) - /* "ssh2/knownhost.pyx":359 + /* "ssh2/knownhost.pyx":360 * if rc == _LIBSSH2_ERROR_BUFFER_TOO_SMALL: * return self.writeline(entry, buf_len=buf_len*2) * elif rc != 0: # <<<<<<<<<<<<<< @@ -5314,7 +5360,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_18writeline(struct __pyx_o */ } - /* "ssh2/knownhost.pyx":363 + /* "ssh2/knownhost.pyx":364 * "Error writing line for known host entry - error code %s", * rc) * if outlen > 0: # <<<<<<<<<<<<<< @@ -5324,19 +5370,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":364 + /* "ssh2/knownhost.pyx":365 * 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, 364, __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, 365, __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":363 + /* "ssh2/knownhost.pyx":364 * "Error writing line for known host entry - error code %s", * rc) * if outlen > 0: # <<<<<<<<<<<<<< @@ -5346,7 +5392,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_18writeline(struct __pyx_o } } - /* "ssh2/knownhost.pyx":366 + /* "ssh2/knownhost.pyx":367 * output = buf[:outlen] * finally: * free(buf) # <<<<<<<<<<<<<< @@ -5405,7 +5451,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_18writeline(struct __pyx_o __pyx_L12:; } - /* "ssh2/knownhost.pyx":367 + /* "ssh2/knownhost.pyx":368 * finally: * free(buf) * return output # <<<<<<<<<<<<<< @@ -5417,7 +5463,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_18writeline(struct __pyx_o __pyx_r = __pyx_v_output; goto __pyx_L0; - /* "ssh2/knownhost.pyx":331 + /* "ssh2/knownhost.pyx":332 * return rc * * def writeline(self, KnownHostEntry entry, # <<<<<<<<<<<<<< @@ -5441,7 +5487,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_18writeline(struct __pyx_o return __pyx_r; } -/* "ssh2/knownhost.pyx":369 +/* "ssh2/knownhost.pyx":370 * return output * * def writefile(self, filename not None, # <<<<<<<<<<<<<< @@ -5488,7 +5534,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, 369, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "writefile") < 0)) __PYX_ERR(0, 370, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -5501,21 +5547,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, 370, __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, 371, __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, 369, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("writefile", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 370, __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, 369, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "filename"); __PYX_ERR(0, 370, __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); @@ -5546,19 +5592,19 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_20writefile(struct __pyx_o int __pyx_clineno = 0; __Pyx_RefNannySetupContext("writefile", 0); - /* "ssh2/knownhost.pyx":379 + /* "ssh2/knownhost.pyx":380 * :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, 379, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_filename); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_b_filename = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/knownhost.pyx":380 + /* "ssh2/knownhost.pyx":381 * writing to file.""" * cdef bytes b_filename = to_bytes(filename) * cdef char *_filename = b_filename # <<<<<<<<<<<<<< @@ -5567,12 +5613,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, 380, __pyx_L1_error) + __PYX_ERR(0, 381, __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_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_filename); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 381, __pyx_L1_error) __pyx_v__filename = __pyx_t_2; - /* "ssh2/knownhost.pyx":382 + /* "ssh2/knownhost.pyx":383 * cdef char *_filename = b_filename * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -5587,7 +5633,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_20writefile(struct __pyx_o #endif /*try:*/ { - /* "ssh2/knownhost.pyx":383 + /* "ssh2/knownhost.pyx":384 * cdef int rc * with nogil: * rc = c_ssh2.libssh2_knownhost_writefile( # <<<<<<<<<<<<<< @@ -5597,7 +5643,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":382 + /* "ssh2/knownhost.pyx":383 * cdef char *_filename = b_filename * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -5616,7 +5662,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_20writefile(struct __pyx_o } } - /* "ssh2/knownhost.pyx":385 + /* "ssh2/knownhost.pyx":386 * rc = c_ssh2.libssh2_knownhost_writefile( * self._ptr, _filename, f_type) * if rc != 0: # <<<<<<<<<<<<<< @@ -5626,17 +5672,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":386 + /* "ssh2/knownhost.pyx":387 * 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, 386, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_KnownHostWriteFileError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 387, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - /* "ssh2/knownhost.pyx":387 + /* "ssh2/knownhost.pyx":388 * if rc != 0: * raise KnownHostWriteFileError( * "Error writing known hosts to file %s", filename) # <<<<<<<<<<<<<< @@ -5658,7 +5704,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, 386, __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, 387, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_1); } else @@ -5666,13 +5712,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, 386, __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, 387, __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, 386, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 387, __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; @@ -5683,16 +5729,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, 386, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 387, __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, 386, __pyx_L1_error) + __PYX_ERR(0, 387, __pyx_L1_error) - /* "ssh2/knownhost.pyx":385 + /* "ssh2/knownhost.pyx":386 * rc = c_ssh2.libssh2_knownhost_writefile( * self._ptr, _filename, f_type) * if rc != 0: # <<<<<<<<<<<<<< @@ -5701,7 +5747,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_20writefile(struct __pyx_o */ } - /* "ssh2/knownhost.pyx":369 + /* "ssh2/knownhost.pyx":370 * return output * * def writefile(self, filename not None, # <<<<<<<<<<<<<< @@ -5726,7 +5772,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_20writefile(struct __pyx_o return __pyx_r; } -/* "ssh2/knownhost.pyx":389 +/* "ssh2/knownhost.pyx":390 * "Error writing known hosts to file %s", filename) * * def get(self, KnownHostEntry prev=None): # <<<<<<<<<<<<<< @@ -5767,7 +5813,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, 389, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get") < 0)) __PYX_ERR(0, 390, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -5781,13 +5827,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, 389, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("get", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 390, __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, 389, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_prev), __pyx_ptype_4ssh2_9knownhost_KnownHostEntry, 1, "prev", 0))) __PYX_ERR(0, 390, __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 */ @@ -5821,7 +5867,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_22get(struct __pyx_obj_4ss int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get", 0); - /* "ssh2/knownhost.pyx":400 + /* "ssh2/knownhost.pyx":401 * * :rtype: list(:py:class:`ssh2.knownhost.KnownHostEntry`)""" * cdef c_ssh2.libssh2_knownhost *_store = NULL # <<<<<<<<<<<<<< @@ -5830,7 +5876,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_22get(struct __pyx_obj_4ss */ __pyx_v__store = NULL; - /* "ssh2/knownhost.pyx":401 + /* "ssh2/knownhost.pyx":402 * :rtype: list(:py:class:`ssh2.knownhost.KnownHostEntry`)""" * cdef c_ssh2.libssh2_knownhost *_store = NULL * cdef c_ssh2.libssh2_knownhost *_prev = NULL # <<<<<<<<<<<<<< @@ -5839,19 +5885,19 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_22get(struct __pyx_obj_4ss */ __pyx_v__prev = NULL; - /* "ssh2/knownhost.pyx":403 + /* "ssh2/knownhost.pyx":404 * 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, 403, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 404, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_entries = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/knownhost.pyx":404 + /* "ssh2/knownhost.pyx":405 * cdef int rc * cdef list entries = [] * if prev is not None: # <<<<<<<<<<<<<< @@ -5862,7 +5908,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":405 + /* "ssh2/knownhost.pyx":406 * cdef list entries = [] * if prev is not None: * _prev = prev._store # <<<<<<<<<<<<<< @@ -5872,7 +5918,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":404 + /* "ssh2/knownhost.pyx":405 * cdef int rc * cdef list entries = [] * if prev is not None: # <<<<<<<<<<<<<< @@ -5881,7 +5927,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_22get(struct __pyx_obj_4ss */ } - /* "ssh2/knownhost.pyx":406 + /* "ssh2/knownhost.pyx":407 * if prev is not None: * _prev = prev._store * with nogil: # <<<<<<<<<<<<<< @@ -5896,7 +5942,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_22get(struct __pyx_obj_4ss #endif /*try:*/ { - /* "ssh2/knownhost.pyx":407 + /* "ssh2/knownhost.pyx":408 * _prev = prev._store * with nogil: * rc = c_ssh2.libssh2_knownhost_get( # <<<<<<<<<<<<<< @@ -5906,7 +5952,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":406 + /* "ssh2/knownhost.pyx":407 * if prev is not None: * _prev = prev._store * with nogil: # <<<<<<<<<<<<<< @@ -5925,7 +5971,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_22get(struct __pyx_obj_4ss } } - /* "ssh2/knownhost.pyx":409 + /* "ssh2/knownhost.pyx":410 * rc = c_ssh2.libssh2_knownhost_get( * self._ptr, &_store, _prev) * while rc == 0: # <<<<<<<<<<<<<< @@ -5936,19 +5982,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":410 + /* "ssh2/knownhost.pyx":411 * 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, 410, __pyx_L1_error) + __pyx_t_1 = ((PyObject *)__pyx_f_4ssh2_9knownhost_PyKnownHostEntry(__pyx_v__store)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 411, __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, 410, __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, 411, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/knownhost.pyx":411 + /* "ssh2/knownhost.pyx":412 * while rc == 0: * entries.append(PyKnownHostEntry(_store)) * _prev = _store # <<<<<<<<<<<<<< @@ -5957,7 +6003,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_22get(struct __pyx_obj_4ss */ __pyx_v__prev = __pyx_v__store; - /* "ssh2/knownhost.pyx":412 + /* "ssh2/knownhost.pyx":413 * entries.append(PyKnownHostEntry(_store)) * _prev = _store * with nogil: # <<<<<<<<<<<<<< @@ -5972,7 +6018,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_22get(struct __pyx_obj_4ss #endif /*try:*/ { - /* "ssh2/knownhost.pyx":413 + /* "ssh2/knownhost.pyx":414 * _prev = _store * with nogil: * rc = c_ssh2.libssh2_knownhost_get( # <<<<<<<<<<<<<< @@ -5982,7 +6028,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":412 + /* "ssh2/knownhost.pyx":413 * entries.append(PyKnownHostEntry(_store)) * _prev = _store * with nogil: # <<<<<<<<<<<<<< @@ -6002,7 +6048,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_22get(struct __pyx_obj_4ss } } - /* "ssh2/knownhost.pyx":415 + /* "ssh2/knownhost.pyx":416 * rc = c_ssh2.libssh2_knownhost_get( * self._ptr, &_store, _prev) * if rc < 0: # <<<<<<<<<<<<<< @@ -6012,23 +6058,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":416 + /* "ssh2/knownhost.pyx":417 * 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, 416, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_KnownHostGetError); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 417, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - /* "ssh2/knownhost.pyx":417 + /* "ssh2/knownhost.pyx":418 * 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, 417, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 418, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = NULL; __pyx_t_9 = 0; @@ -6045,7 +6091,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, 416, __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, 417, __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; @@ -6054,14 +6100,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, 416, __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, 417, __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, 416, __pyx_L1_error) + __pyx_t_10 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 417, __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; @@ -6072,16 +6118,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, 416, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 417, __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, 416, __pyx_L1_error) + __PYX_ERR(0, 417, __pyx_L1_error) - /* "ssh2/knownhost.pyx":415 + /* "ssh2/knownhost.pyx":416 * rc = c_ssh2.libssh2_knownhost_get( * self._ptr, &_store, _prev) * if rc < 0: # <<<<<<<<<<<<<< @@ -6090,7 +6136,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_22get(struct __pyx_obj_4ss */ } - /* "ssh2/knownhost.pyx":418 + /* "ssh2/knownhost.pyx":419 * raise KnownHostGetError( * "Error retrieving known hosts - error code %s", rc) * return entries # <<<<<<<<<<<<<< @@ -6100,7 +6146,7 @@ static PyObject *__pyx_pf_4ssh2_9knownhost_9KnownHost_22get(struct __pyx_obj_4ss __pyx_r = __pyx_v_entries; goto __pyx_L0; - /* "ssh2/knownhost.pyx":389 + /* "ssh2/knownhost.pyx":390 * "Error writing known hosts to file %s", filename) * * def get(self, KnownHostEntry prev=None): # <<<<<<<<<<<<<< @@ -6628,9 +6674,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, 76, __pyx_L1_error) + __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(0, 75, __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, 144, __pyx_L1_error) + __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) __PYX_ERR(0, 145, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; @@ -6737,25 +6783,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, 86, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_4ssh2_9knownhost_KnownHostEntry) < 0) __PYX_ERR(0, 85, __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, 86, __pyx_L1_error) - if (__Pyx_setup_reduce((PyObject*)&__pyx_type_4ssh2_9knownhost_KnownHostEntry) < 0) __PYX_ERR(0, 86, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_KnownHostEntry, (PyObject *)&__pyx_type_4ssh2_9knownhost_KnownHostEntry) < 0) __PYX_ERR(0, 85, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_4ssh2_9knownhost_KnownHostEntry) < 0) __PYX_ERR(0, 85, __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, 130, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_4ssh2_9knownhost_KnownHost) < 0) __PYX_ERR(0, 131, __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, 130, __pyx_L1_error) - if (__Pyx_setup_reduce((PyObject*)&__pyx_type_4ssh2_9knownhost_KnownHost) < 0) __PYX_ERR(0, 130, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_KnownHost, (PyObject *)&__pyx_type_4ssh2_9knownhost_KnownHost) < 0) __PYX_ERR(0, 131, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_4ssh2_9knownhost_KnownHost) < 0) __PYX_ERR(0, 131, __pyx_L1_error) __pyx_ptype_4ssh2_9knownhost_KnownHost = &__pyx_type_4ssh2_9knownhost_KnownHost; __Pyx_RefNannyFinishContext(); return 0; @@ -7260,7 +7306,7 @@ if (!__Pyx_RefNanny) { * 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 */ __pyx_t_1 = __Pyx_PyInt_From_int(LIBSSH2_KNOWNHOST_KEY_SSHRSA); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -7271,75 +7317,75 @@ if (!__Pyx_RefNanny) { * 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_256 = c_ssh2.LIBSSH2_KNOWNHOST_KEY_ECDSA_256 + * LIBSSH2_KNOWNHOST_KEY_ECDSA_384 = c_ssh2.LIBSSH2_KNOWNHOST_KEY_ECDSA_384 */ __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); if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_KNOWNHOST_KEY_SSHDSS, __pyx_t_1) < 0) __PYX_ERR(0, 47, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/knownhost.pyx":49 + /* "ssh2/knownhost.pyx":48 + * 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_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_t_1 = __Pyx_PyInt_From_int(LIBSSH2_KNOWNHOST_KEY_ECDSA_256); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 48, __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) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_KNOWNHOST_KEY_ECDSA_256, __pyx_t_1) < 0) __PYX_ERR(0, 48, __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 + /* "ssh2/knownhost.pyx":49 + * LIBSSH2_KNOWNHOST_KEY_SSHDSS = c_ssh2.LIBSSH2_KNOWNHOST_KEY_SSHDSS + * 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_t_1 = __Pyx_PyInt_From_int(LIBSSH2_KNOWNHOST_KEY_ECDSA_384); 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_384, __pyx_t_1) < 0) __PYX_ERR(0, 50, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_KNOWNHOST_KEY_ECDSA_384, __pyx_t_1) < 0) __PYX_ERR(0, 49, __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 + /* "ssh2/knownhost.pyx":50 + * 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_t_1 = __Pyx_PyInt_From_int(LIBSSH2_KNOWNHOST_KEY_ECDSA_521); 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_521, __pyx_t_1) < 0) __PYX_ERR(0, 51, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_KNOWNHOST_KEY_ECDSA_521, __pyx_t_1) < 0) __PYX_ERR(0, 50, __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 + /* "ssh2/knownhost.pyx":51 + * 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_t_1 = __Pyx_PyInt_From_int(LIBSSH2_KNOWNHOST_KEY_ED25519); 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_ED25519, __pyx_t_1) < 0) __PYX_ERR(0, 52, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_KNOWNHOST_KEY_ED25519, __pyx_t_1) < 0) __PYX_ERR(0, 51, __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 # <<<<<<<<<<<<<< + /* "ssh2/knownhost.pyx":52 + * 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, 53, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(LIBSSH2_KNOWNHOST_KEY_UNKNOWN); 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_UNKNOWN, __pyx_t_1) < 0) __PYX_ERR(0, 53, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_KNOWNHOST_KEY_UNKNOWN, __pyx_t_1) < 0) __PYX_ERR(0, 52, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/knownhost.pyx":282 + /* "ssh2/knownhost.pyx":283 * * def readline(self, bytes line not None, * int f_type=c_ssh2.LIBSSH2_KNOWNHOST_FILE_OPENSSH): # <<<<<<<<<<<<<< @@ -7348,7 +7394,7 @@ if (!__Pyx_RefNanny) { */ __pyx_k__3 = LIBSSH2_KNOWNHOST_FILE_OPENSSH; - /* "ssh2/knownhost.pyx":306 + /* "ssh2/knownhost.pyx":307 * * def readfile(self, filename not None, * int f_type=c_ssh2.LIBSSH2_KNOWNHOST_FILE_OPENSSH): # <<<<<<<<<<<<<< @@ -7357,7 +7403,7 @@ if (!__Pyx_RefNanny) { */ __pyx_k__4 = LIBSSH2_KNOWNHOST_FILE_OPENSSH; - /* "ssh2/knownhost.pyx":332 + /* "ssh2/knownhost.pyx":333 * * def writeline(self, KnownHostEntry entry, * int f_type=c_ssh2.LIBSSH2_KNOWNHOST_FILE_OPENSSH, # <<<<<<<<<<<<<< @@ -7366,7 +7412,7 @@ if (!__Pyx_RefNanny) { */ __pyx_k__5 = LIBSSH2_KNOWNHOST_FILE_OPENSSH; - /* "ssh2/knownhost.pyx":370 + /* "ssh2/knownhost.pyx":371 * * 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 d23eb396..9ec0dad9 100644 --- a/ssh2/knownhost.pyx +++ b/ssh2/knownhost.pyx @@ -45,12 +45,11 @@ LIBSSH2_KNOWNHOST_KEY_SHIFT = c_ssh2.LIBSSH2_KNOWNHOST_KEY_SHIFT 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 +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 cdef KnownHost PyKnownHost(Session session, c_ssh2.LIBSSH2_KNOWNHOSTS *_ptr): @@ -93,8 +92,10 @@ cdef class KnownHostEntry: return self.__repr__() def _dealloc__(self): - with nogil: - free(self._store) + if self._store is not NULL: + with nogil: + free(self._store) + self._store = NULL @property def magic(self): @@ -135,9 +136,9 @@ cdef class KnownHost: self._session = session def __dealloc__(self): - if self._ptr is not NULL: + if self._session is not None and self._session._session is not NULL and self._ptr is not NULL: c_ssh2.libssh2_knownhost_free(self._ptr) - self._ptr = NULL + self._ptr = NULL def add(self, bytes host, bytes salt, bytes key, int typemask): """Deprecated - use ``self.addc``""" diff --git a/ssh2/listener.c b/ssh2/listener.c index 4f4752e6..f2a841cf 100644 --- a/ssh2/listener.c +++ b/ssh2/listener.c @@ -619,7 +619,7 @@ static CYTHON_INLINE float __PYX_NAN() { #include #include #include "libssh2.h" -#include "find_eol.h" +#include "ext/find_eol.h" #ifdef _OPENMP #include #endif /* _OPENMP */ diff --git a/ssh2/publickey.c b/ssh2/publickey.c index db2cd964..f91a451e 100644 --- a/ssh2/publickey.c +++ b/ssh2/publickey.c @@ -622,7 +622,7 @@ static CYTHON_INLINE float __PYX_NAN() { #include "libssh2_publickey.h" #include #include -#include "find_eol.h" +#include "ext/find_eol.h" #ifdef _OPENMP #include #endif /* _OPENMP */ @@ -3209,8 +3209,8 @@ static int __pyx_pf_4ssh2_9publickey_15PublicKeySystem___cinit__(struct __pyx_ob * self.session = session * * def __dealloc__(self): # <<<<<<<<<<<<<< - * with nogil: - * c_pkey.libssh2_publickey_shutdown(self.pkey_s) + * if self.session is not None and self.session._session is not NULL and self.pkey_s is not NULL: + * with nogil: */ /* Python wrapper */ @@ -3226,66 +3226,112 @@ static void __pyx_pw_4ssh2_9publickey_15PublicKeySystem_3__dealloc__(PyObject *_ static void __pyx_pf_4ssh2_9publickey_15PublicKeySystem_2__dealloc__(struct __pyx_obj_4ssh2_9publickey_PublicKeySystem *__pyx_v_self) { __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; __Pyx_RefNannySetupContext("__dealloc__", 0); /* "ssh2/publickey.pyx":134 * * def __dealloc__(self): - * with nogil: # <<<<<<<<<<<<<< - * c_pkey.libssh2_publickey_shutdown(self.pkey_s) + * if self.session is not None and self.session._session is not NULL and self.pkey_s is not NULL: # <<<<<<<<<<<<<< + * with nogil: + * c_pkey.libssh2_publickey_shutdown(self.pkey_s) + */ + __pyx_t_2 = (((PyObject *)__pyx_v_self->session) != Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + } else { + __pyx_t_1 = __pyx_t_3; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_3 = ((__pyx_v_self->session->_session != NULL) != 0); + if (__pyx_t_3) { + } else { + __pyx_t_1 = __pyx_t_3; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_3 = ((__pyx_v_self->pkey_s != NULL) != 0); + __pyx_t_1 = __pyx_t_3; + __pyx_L4_bool_binop_done:; + if (__pyx_t_1) { + + /* "ssh2/publickey.pyx":135 + * def __dealloc__(self): + * if self.session is not None and self.session._session is not NULL and self.pkey_s is not NULL: + * with nogil: # <<<<<<<<<<<<<< + * c_pkey.libssh2_publickey_shutdown(self.pkey_s) + * self.pkey_s = NULL + */ + { + #ifdef WITH_THREAD + PyThreadState *_save; + Py_UNBLOCK_THREADS + __Pyx_FastGIL_Remember(); + #endif + /*try:*/ { + + /* "ssh2/publickey.pyx":136 + * if self.session is not None and self.session._session is not NULL and self.pkey_s is not NULL: + * with nogil: + * c_pkey.libssh2_publickey_shutdown(self.pkey_s) # <<<<<<<<<<<<<< + * self.pkey_s = NULL * */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - __Pyx_FastGIL_Remember(); - #endif - /*try:*/ { + (void)(libssh2_publickey_shutdown(__pyx_v_self->pkey_s)); + } /* "ssh2/publickey.pyx":135 * def __dealloc__(self): - * with nogil: - * c_pkey.libssh2_publickey_shutdown(self.pkey_s) # <<<<<<<<<<<<<< - * - * def add(self, bytes name, bytes blob, + * if self.session is not None and self.session._session is not NULL and self.pkey_s is not NULL: + * with nogil: # <<<<<<<<<<<<<< + * c_pkey.libssh2_publickey_shutdown(self.pkey_s) + * self.pkey_s = NULL */ - (void)(libssh2_publickey_shutdown(__pyx_v_self->pkey_s)); - } + /*finally:*/ { + /*normal exit:*/{ + #ifdef WITH_THREAD + __Pyx_FastGIL_Forget(); + Py_BLOCK_THREADS + #endif + goto __pyx_L9; + } + __pyx_L9:; + } + } - /* "ssh2/publickey.pyx":134 + /* "ssh2/publickey.pyx":134 * * def __dealloc__(self): - * with nogil: # <<<<<<<<<<<<<< - * c_pkey.libssh2_publickey_shutdown(self.pkey_s) - * + * if self.session is not None and self.session._session is not NULL and self.pkey_s is not NULL: # <<<<<<<<<<<<<< + * with nogil: + * c_pkey.libssh2_publickey_shutdown(self.pkey_s) */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - __Pyx_FastGIL_Forget(); - Py_BLOCK_THREADS - #endif - goto __pyx_L5; - } - __pyx_L5:; - } } + /* "ssh2/publickey.pyx":137 + * with nogil: + * c_pkey.libssh2_publickey_shutdown(self.pkey_s) + * self.pkey_s = NULL # <<<<<<<<<<<<<< + * + * def add(self, bytes name, bytes blob, + */ + __pyx_v_self->pkey_s = NULL; + /* "ssh2/publickey.pyx":133 * self.session = session * * def __dealloc__(self): # <<<<<<<<<<<<<< - * with nogil: - * c_pkey.libssh2_publickey_shutdown(self.pkey_s) + * if self.session is not None and self.session._session is not NULL and self.pkey_s is not NULL: + * with nogil: */ /* function exit code */ __Pyx_RefNannyFinishContext(); } -/* "ssh2/publickey.pyx":137 - * c_pkey.libssh2_publickey_shutdown(self.pkey_s) +/* "ssh2/publickey.pyx":139 + * self.pkey_s = NULL * * def add(self, bytes name, bytes blob, # <<<<<<<<<<<<<< * char overwrite, @@ -3333,23 +3379,23 @@ static PyObject *__pyx_pw_4ssh2_9publickey_15PublicKeySystem_5add(PyObject *__py case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_blob)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("add", 1, 4, 4, 1); __PYX_ERR(1, 137, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("add", 1, 4, 4, 1); __PYX_ERR(1, 139, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_overwrite)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("add", 1, 4, 4, 2); __PYX_ERR(1, 137, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("add", 1, 4, 4, 2); __PYX_ERR(1, 139, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_attrs)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("add", 1, 4, 4, 3); __PYX_ERR(1, 137, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("add", 1, 4, 4, 3); __PYX_ERR(1, 139, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add") < 0)) __PYX_ERR(1, 137, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add") < 0)) __PYX_ERR(1, 139, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; @@ -3361,20 +3407,20 @@ static PyObject *__pyx_pw_4ssh2_9publickey_15PublicKeySystem_5add(PyObject *__py } __pyx_v_name = ((PyObject*)values[0]); __pyx_v_blob = ((PyObject*)values[1]); - __pyx_v_overwrite = __Pyx_PyInt_As_char(values[2]); if (unlikely((__pyx_v_overwrite == (char)-1) && PyErr_Occurred())) __PYX_ERR(1, 138, __pyx_L3_error) + __pyx_v_overwrite = __Pyx_PyInt_As_char(values[2]); if (unlikely((__pyx_v_overwrite == (char)-1) && PyErr_Occurred())) __PYX_ERR(1, 140, __pyx_L3_error) __pyx_v_attrs = ((PyObject*)values[3]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("add", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 137, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("add", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 139, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.publickey.PublicKeySystem.add", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_name), (&PyBytes_Type), 1, "name", 1))) __PYX_ERR(1, 137, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_blob), (&PyBytes_Type), 1, "blob", 1))) __PYX_ERR(1, 137, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_attrs), (&PyList_Type), 1, "attrs", 1))) __PYX_ERR(1, 139, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_name), (&PyBytes_Type), 1, "name", 1))) __PYX_ERR(1, 139, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_blob), (&PyBytes_Type), 1, "blob", 1))) __PYX_ERR(1, 139, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_attrs), (&PyList_Type), 1, "attrs", 1))) __PYX_ERR(1, 141, __pyx_L1_error) __pyx_r = __pyx_pf_4ssh2_9publickey_15PublicKeySystem_4add(((struct __pyx_obj_4ssh2_9publickey_PublicKeySystem *)__pyx_v_self), __pyx_v_name, __pyx_v_blob, __pyx_v_overwrite, __pyx_v_attrs); /* function exit code */ @@ -3407,7 +3453,7 @@ static PyObject *__pyx_pf_4ssh2_9publickey_15PublicKeySystem_4add(struct __pyx_o int __pyx_clineno = 0; __Pyx_RefNannySetupContext("add", 0); - /* "ssh2/publickey.pyx":140 + /* "ssh2/publickey.pyx":142 * char overwrite, * list attrs): * cdef unsigned long name_len = len(name) # <<<<<<<<<<<<<< @@ -3416,12 +3462,12 @@ static PyObject *__pyx_pf_4ssh2_9publickey_15PublicKeySystem_4add(struct __pyx_o */ if (unlikely(__pyx_v_name == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(1, 140, __pyx_L1_error) + __PYX_ERR(1, 142, __pyx_L1_error) } - __pyx_t_1 = PyBytes_GET_SIZE(__pyx_v_name); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 140, __pyx_L1_error) + __pyx_t_1 = PyBytes_GET_SIZE(__pyx_v_name); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 142, __pyx_L1_error) __pyx_v_name_len = __pyx_t_1; - /* "ssh2/publickey.pyx":141 + /* "ssh2/publickey.pyx":143 * list attrs): * cdef unsigned long name_len = len(name) * cdef unsigned long num_attrs = len(attrs) # <<<<<<<<<<<<<< @@ -3430,12 +3476,12 @@ static PyObject *__pyx_pf_4ssh2_9publickey_15PublicKeySystem_4add(struct __pyx_o */ if (unlikely(__pyx_v_attrs == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(1, 141, __pyx_L1_error) + __PYX_ERR(1, 143, __pyx_L1_error) } - __pyx_t_1 = PyList_GET_SIZE(__pyx_v_attrs); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 141, __pyx_L1_error) + __pyx_t_1 = PyList_GET_SIZE(__pyx_v_attrs); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 143, __pyx_L1_error) __pyx_v_num_attrs = __pyx_t_1; - /* "ssh2/publickey.pyx":142 + /* "ssh2/publickey.pyx":144 * cdef unsigned long name_len = len(name) * cdef unsigned long num_attrs = len(attrs) * cdef c_pkey.libssh2_publickey_attribute *_attrs = NULL # <<<<<<<<<<<<<< @@ -3444,7 +3490,7 @@ static PyObject *__pyx_pf_4ssh2_9publickey_15PublicKeySystem_4add(struct __pyx_o */ __pyx_v__attrs = NULL; - /* "ssh2/publickey.pyx":143 + /* "ssh2/publickey.pyx":145 * cdef unsigned long num_attrs = len(attrs) * cdef c_pkey.libssh2_publickey_attribute *_attrs = NULL * if num_attrs > 0: # <<<<<<<<<<<<<< @@ -3454,7 +3500,7 @@ static PyObject *__pyx_pf_4ssh2_9publickey_15PublicKeySystem_4add(struct __pyx_o __pyx_t_2 = ((__pyx_v_num_attrs > 0) != 0); if (__pyx_t_2) { - /* "ssh2/publickey.pyx":144 + /* "ssh2/publickey.pyx":146 * cdef c_pkey.libssh2_publickey_attribute *_attrs = NULL * if num_attrs > 0: * _attrs = to_c_attr(attrs) # <<<<<<<<<<<<<< @@ -3463,7 +3509,7 @@ static PyObject *__pyx_pf_4ssh2_9publickey_15PublicKeySystem_4add(struct __pyx_o */ __pyx_v__attrs = __pyx_f_4ssh2_9publickey_to_c_attr(__pyx_v_attrs); - /* "ssh2/publickey.pyx":143 + /* "ssh2/publickey.pyx":145 * cdef unsigned long num_attrs = len(attrs) * cdef c_pkey.libssh2_publickey_attribute *_attrs = NULL * if num_attrs > 0: # <<<<<<<<<<<<<< @@ -3472,7 +3518,7 @@ static PyObject *__pyx_pf_4ssh2_9publickey_15PublicKeySystem_4add(struct __pyx_o */ } - /* "ssh2/publickey.pyx":145 + /* "ssh2/publickey.pyx":147 * if num_attrs > 0: * _attrs = to_c_attr(attrs) * cdef const unsigned char *_name = name # <<<<<<<<<<<<<< @@ -3481,12 +3527,12 @@ static PyObject *__pyx_pf_4ssh2_9publickey_15PublicKeySystem_4add(struct __pyx_o */ if (unlikely(__pyx_v_name == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(1, 145, __pyx_L1_error) + __PYX_ERR(1, 147, __pyx_L1_error) } - __pyx_t_3 = __Pyx_PyBytes_AsUString(__pyx_v_name); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) __PYX_ERR(1, 145, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyBytes_AsUString(__pyx_v_name); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) __PYX_ERR(1, 147, __pyx_L1_error) __pyx_v__name = __pyx_t_3; - /* "ssh2/publickey.pyx":146 + /* "ssh2/publickey.pyx":148 * _attrs = to_c_attr(attrs) * cdef const unsigned char *_name = name * cdef size_t blob_len = len(blob) # <<<<<<<<<<<<<< @@ -3495,12 +3541,12 @@ static PyObject *__pyx_pf_4ssh2_9publickey_15PublicKeySystem_4add(struct __pyx_o */ if (unlikely(__pyx_v_blob == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(1, 146, __pyx_L1_error) + __PYX_ERR(1, 148, __pyx_L1_error) } - __pyx_t_1 = PyBytes_GET_SIZE(__pyx_v_blob); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 146, __pyx_L1_error) + __pyx_t_1 = PyBytes_GET_SIZE(__pyx_v_blob); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 148, __pyx_L1_error) __pyx_v_blob_len = __pyx_t_1; - /* "ssh2/publickey.pyx":147 + /* "ssh2/publickey.pyx":149 * cdef const unsigned char *_name = name * cdef size_t blob_len = len(blob) * cdef const unsigned char *_blob = blob # <<<<<<<<<<<<<< @@ -3509,12 +3555,12 @@ static PyObject *__pyx_pf_4ssh2_9publickey_15PublicKeySystem_4add(struct __pyx_o */ if (unlikely(__pyx_v_blob == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(1, 147, __pyx_L1_error) + __PYX_ERR(1, 149, __pyx_L1_error) } - __pyx_t_4 = __Pyx_PyBytes_AsUString(__pyx_v_blob); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(1, 147, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBytes_AsUString(__pyx_v_blob); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(1, 149, __pyx_L1_error) __pyx_v__blob = __pyx_t_4; - /* "ssh2/publickey.pyx":148 + /* "ssh2/publickey.pyx":150 * cdef size_t blob_len = len(blob) * cdef const unsigned char *_blob = blob * with nogil: # <<<<<<<<<<<<<< @@ -3529,7 +3575,7 @@ static PyObject *__pyx_pf_4ssh2_9publickey_15PublicKeySystem_4add(struct __pyx_o #endif /*try:*/ { - /* "ssh2/publickey.pyx":149 + /* "ssh2/publickey.pyx":151 * cdef const unsigned char *_blob = blob * with nogil: * rc = c_pkey.libssh2_publickey_add_ex( # <<<<<<<<<<<<<< @@ -3538,7 +3584,7 @@ static PyObject *__pyx_pf_4ssh2_9publickey_15PublicKeySystem_4add(struct __pyx_o */ __pyx_v_rc = libssh2_publickey_add_ex(__pyx_v_self->pkey_s, __pyx_v__name, __pyx_v_name_len, __pyx_v__blob, __pyx_v_blob_len, __pyx_v_overwrite, __pyx_v_num_attrs, __pyx_v__attrs); - /* "ssh2/publickey.pyx":152 + /* "ssh2/publickey.pyx":154 * self.pkey_s, _name, name_len, _blob, * blob_len, overwrite, num_attrs, _attrs) * if _attrs is not NULL: # <<<<<<<<<<<<<< @@ -3548,7 +3594,7 @@ static PyObject *__pyx_pf_4ssh2_9publickey_15PublicKeySystem_4add(struct __pyx_o __pyx_t_2 = ((__pyx_v__attrs != NULL) != 0); if (__pyx_t_2) { - /* "ssh2/publickey.pyx":153 + /* "ssh2/publickey.pyx":155 * blob_len, overwrite, num_attrs, _attrs) * if _attrs is not NULL: * free(_attrs) # <<<<<<<<<<<<<< @@ -3557,7 +3603,7 @@ static PyObject *__pyx_pf_4ssh2_9publickey_15PublicKeySystem_4add(struct __pyx_o */ free(__pyx_v__attrs); - /* "ssh2/publickey.pyx":152 + /* "ssh2/publickey.pyx":154 * self.pkey_s, _name, name_len, _blob, * blob_len, overwrite, num_attrs, _attrs) * if _attrs is not NULL: # <<<<<<<<<<<<<< @@ -3567,7 +3613,7 @@ static PyObject *__pyx_pf_4ssh2_9publickey_15PublicKeySystem_4add(struct __pyx_o } } - /* "ssh2/publickey.pyx":148 + /* "ssh2/publickey.pyx":150 * cdef size_t blob_len = len(blob) * cdef const unsigned char *_blob = blob * with nogil: # <<<<<<<<<<<<<< @@ -3586,7 +3632,7 @@ static PyObject *__pyx_pf_4ssh2_9publickey_15PublicKeySystem_4add(struct __pyx_o } } - /* "ssh2/publickey.pyx":154 + /* "ssh2/publickey.pyx":156 * if _attrs is not NULL: * free(_attrs) * return handle_error_codes(rc) # <<<<<<<<<<<<<< @@ -3594,15 +3640,15 @@ static PyObject *__pyx_pf_4ssh2_9publickey_15PublicKeySystem_4add(struct __pyx_o * def remove(self, bytes name, bytes blob): */ __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(1, 154, __pyx_L1_error) - __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 154, __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(1, 156, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; - /* "ssh2/publickey.pyx":137 - * c_pkey.libssh2_publickey_shutdown(self.pkey_s) + /* "ssh2/publickey.pyx":139 + * self.pkey_s = NULL * * def add(self, bytes name, bytes blob, # <<<<<<<<<<<<<< * char overwrite, @@ -3620,7 +3666,7 @@ static PyObject *__pyx_pf_4ssh2_9publickey_15PublicKeySystem_4add(struct __pyx_o return __pyx_r; } -/* "ssh2/publickey.pyx":156 +/* "ssh2/publickey.pyx":158 * return handle_error_codes(rc) * * def remove(self, bytes name, bytes blob): # <<<<<<<<<<<<<< @@ -3663,11 +3709,11 @@ static PyObject *__pyx_pw_4ssh2_9publickey_15PublicKeySystem_7remove(PyObject *_ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_blob)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("remove", 1, 2, 2, 1); __PYX_ERR(1, 156, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("remove", 1, 2, 2, 1); __PYX_ERR(1, 158, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "remove") < 0)) __PYX_ERR(1, 156, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "remove") < 0)) __PYX_ERR(1, 158, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -3680,14 +3726,14 @@ static PyObject *__pyx_pw_4ssh2_9publickey_15PublicKeySystem_7remove(PyObject *_ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("remove", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 156, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("remove", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 158, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.publickey.PublicKeySystem.remove", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_name), (&PyBytes_Type), 1, "name", 1))) __PYX_ERR(1, 156, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_blob), (&PyBytes_Type), 1, "blob", 1))) __PYX_ERR(1, 156, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_name), (&PyBytes_Type), 1, "name", 1))) __PYX_ERR(1, 158, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_blob), (&PyBytes_Type), 1, "blob", 1))) __PYX_ERR(1, 158, __pyx_L1_error) __pyx_r = __pyx_pf_4ssh2_9publickey_15PublicKeySystem_6remove(((struct __pyx_obj_4ssh2_9publickey_PublicKeySystem *)__pyx_v_self), __pyx_v_name, __pyx_v_blob); /* function exit code */ @@ -3717,7 +3763,7 @@ static PyObject *__pyx_pf_4ssh2_9publickey_15PublicKeySystem_6remove(struct __py int __pyx_clineno = 0; __Pyx_RefNannySetupContext("remove", 0); - /* "ssh2/publickey.pyx":157 + /* "ssh2/publickey.pyx":159 * * def remove(self, bytes name, bytes blob): * cdef unsigned long name_len = len(name) # <<<<<<<<<<<<<< @@ -3726,12 +3772,12 @@ static PyObject *__pyx_pf_4ssh2_9publickey_15PublicKeySystem_6remove(struct __py */ if (unlikely(__pyx_v_name == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(1, 157, __pyx_L1_error) + __PYX_ERR(1, 159, __pyx_L1_error) } - __pyx_t_1 = PyBytes_GET_SIZE(__pyx_v_name); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 157, __pyx_L1_error) + __pyx_t_1 = PyBytes_GET_SIZE(__pyx_v_name); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 159, __pyx_L1_error) __pyx_v_name_len = __pyx_t_1; - /* "ssh2/publickey.pyx":158 + /* "ssh2/publickey.pyx":160 * def remove(self, bytes name, bytes blob): * cdef unsigned long name_len = len(name) * cdef unsigned long blob_len = len(blob) # <<<<<<<<<<<<<< @@ -3740,12 +3786,12 @@ static PyObject *__pyx_pf_4ssh2_9publickey_15PublicKeySystem_6remove(struct __py */ if (unlikely(__pyx_v_blob == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(1, 158, __pyx_L1_error) + __PYX_ERR(1, 160, __pyx_L1_error) } - __pyx_t_1 = PyBytes_GET_SIZE(__pyx_v_blob); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 158, __pyx_L1_error) + __pyx_t_1 = PyBytes_GET_SIZE(__pyx_v_blob); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 160, __pyx_L1_error) __pyx_v_blob_len = __pyx_t_1; - /* "ssh2/publickey.pyx":159 + /* "ssh2/publickey.pyx":161 * cdef unsigned long name_len = len(name) * cdef unsigned long blob_len = len(blob) * cdef const unsigned char *_name = name # <<<<<<<<<<<<<< @@ -3754,12 +3800,12 @@ static PyObject *__pyx_pf_4ssh2_9publickey_15PublicKeySystem_6remove(struct __py */ if (unlikely(__pyx_v_name == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(1, 159, __pyx_L1_error) + __PYX_ERR(1, 161, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyBytes_AsUString(__pyx_v_name); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(1, 159, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_AsUString(__pyx_v_name); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(1, 161, __pyx_L1_error) __pyx_v__name = __pyx_t_2; - /* "ssh2/publickey.pyx":160 + /* "ssh2/publickey.pyx":162 * cdef unsigned long blob_len = len(blob) * cdef const unsigned char *_name = name * cdef const unsigned char *_blob = blob # <<<<<<<<<<<<<< @@ -3768,12 +3814,12 @@ static PyObject *__pyx_pf_4ssh2_9publickey_15PublicKeySystem_6remove(struct __py */ if (unlikely(__pyx_v_blob == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(1, 160, __pyx_L1_error) + __PYX_ERR(1, 162, __pyx_L1_error) } - __pyx_t_3 = __Pyx_PyBytes_AsUString(__pyx_v_blob); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) __PYX_ERR(1, 160, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyBytes_AsUString(__pyx_v_blob); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) __PYX_ERR(1, 162, __pyx_L1_error) __pyx_v__blob = __pyx_t_3; - /* "ssh2/publickey.pyx":161 + /* "ssh2/publickey.pyx":163 * cdef const unsigned char *_name = name * cdef const unsigned char *_blob = blob * with nogil: # <<<<<<<<<<<<<< @@ -3788,7 +3834,7 @@ static PyObject *__pyx_pf_4ssh2_9publickey_15PublicKeySystem_6remove(struct __py #endif /*try:*/ { - /* "ssh2/publickey.pyx":162 + /* "ssh2/publickey.pyx":164 * cdef const unsigned char *_blob = blob * with nogil: * rc = c_pkey.libssh2_publickey_remove_ex( # <<<<<<<<<<<<<< @@ -3798,7 +3844,7 @@ static PyObject *__pyx_pf_4ssh2_9publickey_15PublicKeySystem_6remove(struct __py __pyx_v_rc = libssh2_publickey_remove_ex(__pyx_v_self->pkey_s, __pyx_v__name, __pyx_v_name_len, __pyx_v__blob, __pyx_v_blob_len); } - /* "ssh2/publickey.pyx":161 + /* "ssh2/publickey.pyx":163 * cdef const unsigned char *_name = name * cdef const unsigned char *_blob = blob * with nogil: # <<<<<<<<<<<<<< @@ -3817,7 +3863,7 @@ static PyObject *__pyx_pf_4ssh2_9publickey_15PublicKeySystem_6remove(struct __py } } - /* "ssh2/publickey.pyx":164 + /* "ssh2/publickey.pyx":166 * rc = c_pkey.libssh2_publickey_remove_ex( * self.pkey_s, _name, name_len, _blob, blob_len) * return handle_error_codes(rc) # <<<<<<<<<<<<<< @@ -3825,14 +3871,14 @@ static PyObject *__pyx_pf_4ssh2_9publickey_15PublicKeySystem_6remove(struct __py * def list_fetch(self): */ __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(1, 164, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 164, __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(1, 166, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 166, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; - /* "ssh2/publickey.pyx":156 + /* "ssh2/publickey.pyx":158 * return handle_error_codes(rc) * * def remove(self, bytes name, bytes blob): # <<<<<<<<<<<<<< @@ -3851,7 +3897,7 @@ static PyObject *__pyx_pf_4ssh2_9publickey_15PublicKeySystem_6remove(struct __py return __pyx_r; } -/* "ssh2/publickey.pyx":166 +/* "ssh2/publickey.pyx":168 * return handle_error_codes(rc) * * def list_fetch(self): # <<<<<<<<<<<<<< @@ -3893,7 +3939,7 @@ static PyObject *__pyx_pf_4ssh2_9publickey_15PublicKeySystem_8list_fetch(struct int __pyx_clineno = 0; __Pyx_RefNannySetupContext("list_fetch", 0); - /* "ssh2/publickey.pyx":167 + /* "ssh2/publickey.pyx":169 * * def list_fetch(self): * cdef unsigned long num_keys = 0 # <<<<<<<<<<<<<< @@ -3902,7 +3948,7 @@ static PyObject *__pyx_pf_4ssh2_9publickey_15PublicKeySystem_8list_fetch(struct */ __pyx_v_num_keys = 0; - /* "ssh2/publickey.pyx":168 + /* "ssh2/publickey.pyx":170 * def list_fetch(self): * cdef unsigned long num_keys = 0 * cdef c_pkey.libssh2_publickey_list **pkey_list = NULL # <<<<<<<<<<<<<< @@ -3911,7 +3957,7 @@ static PyObject *__pyx_pf_4ssh2_9publickey_15PublicKeySystem_8list_fetch(struct */ __pyx_v_pkey_list = NULL; - /* "ssh2/publickey.pyx":171 + /* "ssh2/publickey.pyx":173 * cdef int rc * cdef list keys * with nogil: # <<<<<<<<<<<<<< @@ -3926,7 +3972,7 @@ static PyObject *__pyx_pf_4ssh2_9publickey_15PublicKeySystem_8list_fetch(struct #endif /*try:*/ { - /* "ssh2/publickey.pyx":172 + /* "ssh2/publickey.pyx":174 * cdef list keys * with nogil: * rc = c_pkey.libssh2_publickey_list_fetch( # <<<<<<<<<<<<<< @@ -3936,7 +3982,7 @@ static PyObject *__pyx_pf_4ssh2_9publickey_15PublicKeySystem_8list_fetch(struct __pyx_v_rc = libssh2_publickey_list_fetch(__pyx_v_self->pkey_s, (&__pyx_v_num_keys), __pyx_v_pkey_list); } - /* "ssh2/publickey.pyx":171 + /* "ssh2/publickey.pyx":173 * cdef int rc * cdef list keys * with nogil: # <<<<<<<<<<<<<< @@ -3955,7 +4001,7 @@ static PyObject *__pyx_pf_4ssh2_9publickey_15PublicKeySystem_8list_fetch(struct } } - /* "ssh2/publickey.pyx":174 + /* "ssh2/publickey.pyx":176 * rc = c_pkey.libssh2_publickey_list_fetch( * self.pkey_s, &num_keys, pkey_list) * if rc != 0: # <<<<<<<<<<<<<< @@ -3965,7 +4011,7 @@ static PyObject *__pyx_pf_4ssh2_9publickey_15PublicKeySystem_8list_fetch(struct __pyx_t_1 = ((__pyx_v_rc != 0) != 0); if (__pyx_t_1) { - /* "ssh2/publickey.pyx":175 + /* "ssh2/publickey.pyx":177 * self.pkey_s, &num_keys, pkey_list) * if rc != 0: * return handle_error_codes(rc) # <<<<<<<<<<<<<< @@ -3973,14 +4019,14 @@ static PyObject *__pyx_pf_4ssh2_9publickey_15PublicKeySystem_8list_fetch(struct * return [] */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __pyx_f_4ssh2_5utils_handle_error_codes(__pyx_v_rc, 0); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(1, 175, __pyx_L1_error) - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 175, __pyx_L1_error) + __pyx_t_2 = __pyx_f_4ssh2_5utils_handle_error_codes(__pyx_v_rc, 0); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(1, 177, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - /* "ssh2/publickey.pyx":174 + /* "ssh2/publickey.pyx":176 * rc = c_pkey.libssh2_publickey_list_fetch( * self.pkey_s, &num_keys, pkey_list) * if rc != 0: # <<<<<<<<<<<<<< @@ -3989,7 +4035,7 @@ static PyObject *__pyx_pf_4ssh2_9publickey_15PublicKeySystem_8list_fetch(struct */ } - /* "ssh2/publickey.pyx":176 + /* "ssh2/publickey.pyx":178 * if rc != 0: * return handle_error_codes(rc) * if num_keys < 1: # <<<<<<<<<<<<<< @@ -3999,7 +4045,7 @@ static PyObject *__pyx_pf_4ssh2_9publickey_15PublicKeySystem_8list_fetch(struct __pyx_t_1 = ((__pyx_v_num_keys < 1) != 0); if (__pyx_t_1) { - /* "ssh2/publickey.pyx":177 + /* "ssh2/publickey.pyx":179 * return handle_error_codes(rc) * if num_keys < 1: * return [] # <<<<<<<<<<<<<< @@ -4007,13 +4053,13 @@ static PyObject *__pyx_pf_4ssh2_9publickey_15PublicKeySystem_8list_fetch(struct * return keys */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 177, __pyx_L1_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 179, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - /* "ssh2/publickey.pyx":176 + /* "ssh2/publickey.pyx":178 * if rc != 0: * return handle_error_codes(rc) * if num_keys < 1: # <<<<<<<<<<<<<< @@ -4022,28 +4068,28 @@ static PyObject *__pyx_pf_4ssh2_9publickey_15PublicKeySystem_8list_fetch(struct */ } - /* "ssh2/publickey.pyx":178 + /* "ssh2/publickey.pyx":180 * if num_keys < 1: * return [] * keys = [PyPublicKeyList(pkey_list[i]) for i in range(num_keys)] # <<<<<<<<<<<<<< * return keys * */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 178, __pyx_L1_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __pyx_v_num_keys; __pyx_t_5 = __pyx_t_4; for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { __pyx_v_i = __pyx_t_6; - __pyx_t_7 = __pyx_f_4ssh2_9publickey_PyPublicKeyList((__pyx_v_pkey_list[__pyx_v_i])); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 178, __pyx_L1_error) + __pyx_t_7 = __pyx_f_4ssh2_9publickey_PyPublicKeyList((__pyx_v_pkey_list[__pyx_v_i])); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_7))) __PYX_ERR(1, 178, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_7))) __PYX_ERR(1, 180, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __pyx_v_keys = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; - /* "ssh2/publickey.pyx":179 + /* "ssh2/publickey.pyx":181 * return [] * keys = [PyPublicKeyList(pkey_list[i]) for i in range(num_keys)] * return keys # <<<<<<<<<<<<<< @@ -4055,7 +4101,7 @@ static PyObject *__pyx_pf_4ssh2_9publickey_15PublicKeySystem_8list_fetch(struct __pyx_r = __pyx_v_keys; goto __pyx_L0; - /* "ssh2/publickey.pyx":166 + /* "ssh2/publickey.pyx":168 * return handle_error_codes(rc) * * def list_fetch(self): # <<<<<<<<<<<<<< @@ -4076,7 +4122,7 @@ static PyObject *__pyx_pf_4ssh2_9publickey_15PublicKeySystem_8list_fetch(struct return __pyx_r; } -/* "ssh2/publickey.pyx":181 +/* "ssh2/publickey.pyx":183 * return keys * * def list_free(self): # <<<<<<<<<<<<<< @@ -4110,7 +4156,7 @@ static PyObject *__pyx_pf_4ssh2_9publickey_15PublicKeySystem_10list_free(CYTHON_ return __pyx_r; } -/* "ssh2/publickey.pyx":186 +/* "ssh2/publickey.pyx":188 * pass * * def shutdown(self): # <<<<<<<<<<<<<< @@ -4143,7 +4189,7 @@ static PyObject *__pyx_pf_4ssh2_9publickey_15PublicKeySystem_12shutdown(struct _ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("shutdown", 0); - /* "ssh2/publickey.pyx":190 + /* "ssh2/publickey.pyx":192 * Called automatically by object destructor""" * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -4158,7 +4204,7 @@ static PyObject *__pyx_pf_4ssh2_9publickey_15PublicKeySystem_12shutdown(struct _ #endif /*try:*/ { - /* "ssh2/publickey.pyx":191 + /* "ssh2/publickey.pyx":193 * cdef int rc * with nogil: * rc = c_pkey.libssh2_publickey_shutdown(self.pkey_s) # <<<<<<<<<<<<<< @@ -4167,7 +4213,7 @@ static PyObject *__pyx_pf_4ssh2_9publickey_15PublicKeySystem_12shutdown(struct _ __pyx_v_rc = libssh2_publickey_shutdown(__pyx_v_self->pkey_s); } - /* "ssh2/publickey.pyx":190 + /* "ssh2/publickey.pyx":192 * Called automatically by object destructor""" * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -4186,20 +4232,20 @@ static PyObject *__pyx_pf_4ssh2_9publickey_15PublicKeySystem_12shutdown(struct _ } } - /* "ssh2/publickey.pyx":192 + /* "ssh2/publickey.pyx":194 * with nogil: * rc = c_pkey.libssh2_publickey_shutdown(self.pkey_s) * return handle_error_codes(rc) # <<<<<<<<<<<<<< */ __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(1, 192, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 192, __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(1, 194, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "ssh2/publickey.pyx":186 + /* "ssh2/publickey.pyx":188 * pass * * def shutdown(self): # <<<<<<<<<<<<<< diff --git a/ssh2/publickey.pyx b/ssh2/publickey.pyx index 451b0c53..5ea44866 100644 --- a/ssh2/publickey.pyx +++ b/ssh2/publickey.pyx @@ -131,8 +131,10 @@ cdef class PublicKeySystem: self.session = session def __dealloc__(self): - with nogil: - c_pkey.libssh2_publickey_shutdown(self.pkey_s) + if self.session is not None and self.session._session is not NULL and self.pkey_s is not NULL: + with nogil: + c_pkey.libssh2_publickey_shutdown(self.pkey_s) + self.pkey_s = NULL def add(self, bytes name, bytes blob, char overwrite, diff --git a/ssh2/session.c b/ssh2/session.c index eae4c9b7..5b90040b 100644 --- a/ssh2/session.c +++ b/ssh2/session.c @@ -625,7 +625,7 @@ static CYTHON_INLINE float __PYX_NAN() { #include #include "libssh2_sftp.h" #include "libssh2_publickey.h" -#include "find_eol.h" +#include "ext/find_eol.h" #ifdef _OPENMP #include #endif /* _OPENMP */ @@ -969,12 +969,12 @@ struct __pyx_obj_4ssh2_9knownhost_KnownHost { }; -/* "fileinfo.pxd":20 +/* "fileinfo.pxd":19 + * cimport c_ssh2 * - * IF EMBEDDED_LIB: - * cdef class FileInfo: # <<<<<<<<<<<<<< - * """Representation of stat structure""" - * cdef c_ssh2.libssh2_struct_stat* _stat + * cdef class FileInfo: # <<<<<<<<<<<<<< + * """Representation of stat structure""" + * cdef c_ssh2.libssh2_struct_stat* _stat */ struct __pyx_obj_4ssh2_8fileinfo_FileInfo { PyObject_HEAD @@ -1010,7 +1010,7 @@ struct __pyx_obj_4ssh2_7session_MethodType { }; -/* "ssh2/session.pyx":323 +/* "ssh2/session.pyx":312 * return handle_error_codes(rc) * * def userauth_keyboardinteractive(self, username not None, # <<<<<<<<<<<<<< @@ -1886,7 +1886,7 @@ static PyObject *__pyx_tuple__7; static PyObject *__pyx_codeobj__5; /* Late includes */ -/* "ssh2/session.pyx":66 +/* "ssh2/session.pyx":57 * * cdef class MethodType: * def __cinit__(self, value): # <<<<<<<<<<<<<< @@ -1923,7 +1923,7 @@ static int __pyx_pw_4ssh2_7session_10MethodType_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(1, 66, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 57, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; @@ -1934,7 +1934,7 @@ static int __pyx_pw_4ssh2_7session_10MethodType_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(1, 66, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 57, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.session.MethodType.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -1956,17 +1956,17 @@ static int __pyx_pf_4ssh2_7session_10MethodType___cinit__(struct __pyx_obj_4ssh2 int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "ssh2/session.pyx":67 + /* "ssh2/session.pyx":58 * cdef class MethodType: * def __cinit__(self, value): * self.value = value # <<<<<<<<<<<<<< * * */ - __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 67, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 58, __pyx_L1_error) __pyx_v_self->value = __pyx_t_1; - /* "ssh2/session.pyx":66 + /* "ssh2/session.pyx":57 * * cdef class MethodType: * def __cinit__(self, value): # <<<<<<<<<<<<<< @@ -2100,7 +2100,7 @@ static PyObject *__pyx_pf_4ssh2_7session_10MethodType_4__setstate_cython__(CYTHO return __pyx_r; } -/* "ssh2/session.pyx":83 +/* "ssh2/session.pyx":73 * * * cdef void kbd_callback(const char *name, int name_len, # <<<<<<<<<<<<<< @@ -2132,7 +2132,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":89 + /* "ssh2/session.pyx":79 * c_ssh2.LIBSSH2_USERAUTH_KBDINT_RESPONSE *responses, * void **abstract) except *: * py_sess = (c_dereference(abstract)) # <<<<<<<<<<<<<< @@ -2145,7 +2145,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":90 + /* "ssh2/session.pyx":80 * void **abstract) except *: * py_sess = (c_dereference(abstract)) * if py_sess._kbd_callback is None: # <<<<<<<<<<<<<< @@ -2156,7 +2156,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":91 + /* "ssh2/session.pyx":81 * py_sess = (c_dereference(abstract)) * if py_sess._kbd_callback is None: * return # <<<<<<<<<<<<<< @@ -2165,7 +2165,7 @@ static void __pyx_f_4ssh2_7session_kbd_callback(CYTHON_UNUSED char const *__pyx_ */ goto __pyx_L0; - /* "ssh2/session.pyx":90 + /* "ssh2/session.pyx":80 * void **abstract) except *: * py_sess = (c_dereference(abstract)) * if py_sess._kbd_callback is None: # <<<<<<<<<<<<<< @@ -2174,7 +2174,7 @@ static void __pyx_f_4ssh2_7session_kbd_callback(CYTHON_UNUSED char const *__pyx_ */ } - /* "ssh2/session.pyx":92 + /* "ssh2/session.pyx":82 * if py_sess._kbd_callback is None: * return * cdef bytes b_password = to_bytes(py_sess._kbd_callback()) # <<<<<<<<<<<<<< @@ -2194,16 +2194,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(1, 92, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 82, __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(1, 92, __pyx_L1_error) + __pyx_t_5 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 82, __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":93 + /* "ssh2/session.pyx":83 * return * cdef bytes b_password = to_bytes(py_sess._kbd_callback()) * cdef size_t _len = len(b_password) # <<<<<<<<<<<<<< @@ -2212,12 +2212,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(1, 93, __pyx_L1_error) + __PYX_ERR(1, 83, __pyx_L1_error) } - __pyx_t_7 = PyBytes_GET_SIZE(__pyx_v_b_password); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(1, 93, __pyx_L1_error) + __pyx_t_7 = PyBytes_GET_SIZE(__pyx_v_b_password); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(1, 83, __pyx_L1_error) __pyx_v__len = __pyx_t_7; - /* "ssh2/session.pyx":94 + /* "ssh2/session.pyx":84 * cdef bytes b_password = to_bytes(py_sess._kbd_callback()) * cdef size_t _len = len(b_password) * cdef char *_password = b_password # <<<<<<<<<<<<<< @@ -2226,12 +2226,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(1, 94, __pyx_L1_error) + __PYX_ERR(1, 84, __pyx_L1_error) } - __pyx_t_8 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_password); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(1, 94, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_password); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(1, 84, __pyx_L1_error) __pyx_v__password = __pyx_t_8; - /* "ssh2/session.pyx":96 + /* "ssh2/session.pyx":86 * cdef char *_password = b_password * cdef char *_password_copy * if num_prompts == 1: # <<<<<<<<<<<<<< @@ -2241,7 +2241,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":97 + /* "ssh2/session.pyx":87 * cdef char *_password_copy * if num_prompts == 1: * _password_copy = malloc(sizeof(char) * _len) # <<<<<<<<<<<<<< @@ -2250,7 +2250,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":98 + /* "ssh2/session.pyx":88 * if num_prompts == 1: * _password_copy = malloc(sizeof(char) * _len) * for i in range(_len): # <<<<<<<<<<<<<< @@ -2262,7 +2262,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":99 + /* "ssh2/session.pyx":89 * _password_copy = malloc(sizeof(char) * _len) * for i in range(_len): * _password_copy[i] = _password[i] # <<<<<<<<<<<<<< @@ -2272,7 +2272,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":100 + /* "ssh2/session.pyx":90 * for i in range(_len): * _password_copy[i] = _password[i] * responses[0].text = _password_copy # <<<<<<<<<<<<<< @@ -2281,7 +2281,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":101 + /* "ssh2/session.pyx":91 * _password_copy[i] = _password[i] * responses[0].text = _password_copy * responses[0].length = _len # <<<<<<<<<<<<<< @@ -2290,7 +2290,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":96 + /* "ssh2/session.pyx":86 * cdef char *_password = b_password * cdef char *_password_copy * if num_prompts == 1: # <<<<<<<<<<<<<< @@ -2299,7 +2299,7 @@ static void __pyx_f_4ssh2_7session_kbd_callback(CYTHON_UNUSED char const *__pyx_ */ } - /* "ssh2/session.pyx":83 + /* "ssh2/session.pyx":73 * * * cdef void kbd_callback(const char *name, int name_len, # <<<<<<<<<<<<<< @@ -2320,7 +2320,7 @@ static void __pyx_f_4ssh2_7session_kbd_callback(CYTHON_UNUSED char const *__pyx_ __Pyx_RefNannyFinishContext(); } -/* "ssh2/session.pyx":108 +/* "ssh2/session.pyx":98 * """LibSSH2 Session class providing session functions""" * * def __cinit__(self): # <<<<<<<<<<<<<< @@ -2353,7 +2353,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":109 + /* "ssh2/session.pyx":99 * * def __cinit__(self): * self._session = c_ssh2.libssh2_session_init_ex( # <<<<<<<<<<<<<< @@ -2362,7 +2362,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":111 + /* "ssh2/session.pyx":101 * self._session = c_ssh2.libssh2_session_init_ex( * NULL, NULL, NULL, self) * if self._session is NULL: # <<<<<<<<<<<<<< @@ -2372,16 +2372,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":112 + /* "ssh2/session.pyx":102 * NULL, NULL, NULL, self) * if self._session is NULL: * raise MemoryError # <<<<<<<<<<<<<< * self._sock = 0 * self.sock = None */ - PyErr_NoMemory(); __PYX_ERR(1, 112, __pyx_L1_error) + PyErr_NoMemory(); __PYX_ERR(1, 102, __pyx_L1_error) - /* "ssh2/session.pyx":111 + /* "ssh2/session.pyx":101 * self._session = c_ssh2.libssh2_session_init_ex( * NULL, NULL, NULL, self) * if self._session is NULL: # <<<<<<<<<<<<<< @@ -2390,7 +2390,7 @@ static int __pyx_pf_4ssh2_7session_7Session___cinit__(struct __pyx_obj_4ssh2_7se */ } - /* "ssh2/session.pyx":113 + /* "ssh2/session.pyx":103 * if self._session is NULL: * raise MemoryError * self._sock = 0 # <<<<<<<<<<<<<< @@ -2399,7 +2399,7 @@ static int __pyx_pf_4ssh2_7session_7Session___cinit__(struct __pyx_obj_4ssh2_7se */ __pyx_v_self->_sock = 0; - /* "ssh2/session.pyx":114 + /* "ssh2/session.pyx":104 * raise MemoryError * self._sock = 0 * self.sock = None # <<<<<<<<<<<<<< @@ -2412,7 +2412,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":115 + /* "ssh2/session.pyx":105 * self._sock = 0 * self.sock = None * self._kbd_callback = None # <<<<<<<<<<<<<< @@ -2425,7 +2425,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":108 + /* "ssh2/session.pyx":98 * """LibSSH2 Session class providing session functions""" * * def __cinit__(self): # <<<<<<<<<<<<<< @@ -2444,7 +2444,7 @@ static int __pyx_pf_4ssh2_7session_7Session___cinit__(struct __pyx_obj_4ssh2_7se return __pyx_r; } -/* "ssh2/session.pyx":117 +/* "ssh2/session.pyx":107 * self._kbd_callback = None * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -2468,7 +2468,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":118 + /* "ssh2/session.pyx":108 * * def __dealloc__(self): * if self._session is not NULL: # <<<<<<<<<<<<<< @@ -2478,7 +2478,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":119 + /* "ssh2/session.pyx":109 * def __dealloc__(self): * if self._session is not NULL: * c_ssh2.libssh2_session_free(self._session) # <<<<<<<<<<<<<< @@ -2487,7 +2487,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":118 + /* "ssh2/session.pyx":108 * * def __dealloc__(self): * if self._session is not NULL: # <<<<<<<<<<<<<< @@ -2496,7 +2496,7 @@ static void __pyx_pf_4ssh2_7session_7Session_2__dealloc__(struct __pyx_obj_4ssh2 */ } - /* "ssh2/session.pyx":120 + /* "ssh2/session.pyx":110 * if self._session is not NULL: * c_ssh2.libssh2_session_free(self._session) * self._session = NULL # <<<<<<<<<<<<<< @@ -2505,7 +2505,7 @@ static void __pyx_pf_4ssh2_7session_7Session_2__dealloc__(struct __pyx_obj_4ssh2 */ __pyx_v_self->_session = NULL; - /* "ssh2/session.pyx":117 + /* "ssh2/session.pyx":107 * self._kbd_callback = None * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -2517,7 +2517,7 @@ static void __pyx_pf_4ssh2_7session_7Session_2__dealloc__(struct __pyx_obj_4ssh2 __Pyx_RefNannyFinishContext(); } -/* "ssh2/session.pyx":122 +/* "ssh2/session.pyx":112 * self._session = NULL * * def disconnect(self): # <<<<<<<<<<<<<< @@ -2550,7 +2550,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_4disconnect(struct __pyx_obj_4 int __pyx_clineno = 0; __Pyx_RefNannySetupContext("disconnect", 0); - /* "ssh2/session.pyx":124 + /* "ssh2/session.pyx":114 * def disconnect(self): * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -2565,7 +2565,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_4disconnect(struct __pyx_obj_4 #endif /*try:*/ { - /* "ssh2/session.pyx":125 + /* "ssh2/session.pyx":115 * cdef int rc * with nogil: * rc = c_ssh2.libssh2_session_disconnect(self._session, b"end") # <<<<<<<<<<<<<< @@ -2575,7 +2575,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":124 + /* "ssh2/session.pyx":114 * def disconnect(self): * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -2594,7 +2594,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_4disconnect(struct __pyx_obj_4 } } - /* "ssh2/session.pyx":126 + /* "ssh2/session.pyx":116 * with nogil: * rc = c_ssh2.libssh2_session_disconnect(self._session, b"end") * return handle_error_codes(rc) # <<<<<<<<<<<<<< @@ -2602,14 +2602,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(1, 126, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 126, __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(1, 116, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":122 + /* "ssh2/session.pyx":112 * self._session = NULL * * def disconnect(self): # <<<<<<<<<<<<<< @@ -2628,7 +2628,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_4disconnect(struct __pyx_obj_4 return __pyx_r; } -/* "ssh2/session.pyx":128 +/* "ssh2/session.pyx":118 * return handle_error_codes(rc) * * def handshake(self, sock not None): # <<<<<<<<<<<<<< @@ -2647,7 +2647,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(1, 128, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "sock"); __PYX_ERR(1, 118, __pyx_L1_error) } __pyx_r = __pyx_pf_4ssh2_7session_7Session_6handshake(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), ((PyObject *)__pyx_v_sock)); @@ -2672,17 +2672,17 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_6handshake(struct __pyx_obj_4s int __pyx_clineno = 0; __Pyx_RefNannySetupContext("handshake", 0); - /* "ssh2/session.pyx":132 + /* "ssh2/session.pyx":122 * * 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(1, 132, __pyx_L1_error) + __pyx_t_1 = PyObject_AsFileDescriptor(__pyx_v_sock); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 122, __pyx_L1_error) __pyx_v__sock = __pyx_t_1; - /* "ssh2/session.pyx":134 + /* "ssh2/session.pyx":124 * cdef int _sock = PyObject_AsFileDescriptor(sock) * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -2697,7 +2697,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_6handshake(struct __pyx_obj_4s #endif /*try:*/ { - /* "ssh2/session.pyx":135 + /* "ssh2/session.pyx":125 * cdef int rc * with nogil: * rc = c_ssh2.libssh2_session_handshake(self._session, _sock) # <<<<<<<<<<<<<< @@ -2706,7 +2706,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":136 + /* "ssh2/session.pyx":126 * with nogil: * rc = c_ssh2.libssh2_session_handshake(self._session, _sock) * self._sock = _sock # <<<<<<<<<<<<<< @@ -2716,7 +2716,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_6handshake(struct __pyx_obj_4s __pyx_v_self->_sock = __pyx_v__sock; } - /* "ssh2/session.pyx":134 + /* "ssh2/session.pyx":124 * cdef int _sock = PyObject_AsFileDescriptor(sock) * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -2735,7 +2735,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_6handshake(struct __pyx_obj_4s } } - /* "ssh2/session.pyx":137 + /* "ssh2/session.pyx":127 * rc = c_ssh2.libssh2_session_handshake(self._session, _sock) * self._sock = _sock * self.sock = sock # <<<<<<<<<<<<<< @@ -2748,7 +2748,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":138 + /* "ssh2/session.pyx":128 * self._sock = _sock * self.sock = sock * return handle_error_codes(rc) # <<<<<<<<<<<<<< @@ -2756,14 +2756,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(1, 138, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 138, __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(1, 128, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":128 + /* "ssh2/session.pyx":118 * return handle_error_codes(rc) * * def handshake(self, sock not None): # <<<<<<<<<<<<<< @@ -2782,7 +2782,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_6handshake(struct __pyx_obj_4s return __pyx_r; } -/* "ssh2/session.pyx":140 +/* "ssh2/session.pyx":130 * return handle_error_codes(rc) * * def startup(self, sock): # <<<<<<<<<<<<<< @@ -2816,17 +2816,17 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_8startup(struct __pyx_obj_4ssh int __pyx_clineno = 0; __Pyx_RefNannySetupContext("startup", 0); - /* "ssh2/session.pyx":142 + /* "ssh2/session.pyx":132 * 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(1, 142, __pyx_L1_error) + __pyx_t_1 = PyObject_AsFileDescriptor(__pyx_v_sock); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 132, __pyx_L1_error) __pyx_v__sock = __pyx_t_1; - /* "ssh2/session.pyx":144 + /* "ssh2/session.pyx":134 * cdef int _sock = PyObject_AsFileDescriptor(sock) * cdef int rc * rc = c_ssh2.libssh2_session_startup(self._session, _sock) # <<<<<<<<<<<<<< @@ -2835,7 +2835,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":145 + /* "ssh2/session.pyx":135 * cdef int rc * rc = c_ssh2.libssh2_session_startup(self._session, _sock) * return handle_error_codes(rc) # <<<<<<<<<<<<<< @@ -2843,14 +2843,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(1, 145, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 145, __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(1, 135, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":140 + /* "ssh2/session.pyx":130 * return handle_error_codes(rc) * * def startup(self, sock): # <<<<<<<<<<<<<< @@ -2869,7 +2869,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_8startup(struct __pyx_obj_4ssh return __pyx_r; } -/* "ssh2/session.pyx":147 +/* "ssh2/session.pyx":137 * return handle_error_codes(rc) * * def set_blocking(self, bint blocking): # <<<<<<<<<<<<<< @@ -2889,7 +2889,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(1, 147, __pyx_L3_error) + __pyx_v_blocking = __Pyx_PyObject_IsTrue(__pyx_arg_blocking); if (unlikely((__pyx_v_blocking == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 137, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -2909,7 +2909,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_10set_blocking(struct __pyx_ob __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_blocking", 0); - /* "ssh2/session.pyx":153 + /* "ssh2/session.pyx":143 * Session default is blocking unless set otherwise. * :type blocking: bool""" * with nogil: # <<<<<<<<<<<<<< @@ -2924,7 +2924,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_10set_blocking(struct __pyx_ob #endif /*try:*/ { - /* "ssh2/session.pyx":154 + /* "ssh2/session.pyx":144 * :type blocking: bool""" * with nogil: * c_ssh2.libssh2_session_set_blocking( # <<<<<<<<<<<<<< @@ -2934,7 +2934,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":153 + /* "ssh2/session.pyx":143 * Session default is blocking unless set otherwise. * :type blocking: bool""" * with nogil: # <<<<<<<<<<<<<< @@ -2953,7 +2953,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_10set_blocking(struct __pyx_ob } } - /* "ssh2/session.pyx":147 + /* "ssh2/session.pyx":137 * return handle_error_codes(rc) * * def set_blocking(self, bint blocking): # <<<<<<<<<<<<<< @@ -2968,7 +2968,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_10set_blocking(struct __pyx_ob return __pyx_r; } -/* "ssh2/session.pyx":157 +/* "ssh2/session.pyx":147 * self._session, blocking) * * def get_blocking(self): # <<<<<<<<<<<<<< @@ -3001,7 +3001,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":162 + /* "ssh2/session.pyx":152 * :rtype: bool""" * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -3016,7 +3016,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_12get_blocking(struct __pyx_ob #endif /*try:*/ { - /* "ssh2/session.pyx":163 + /* "ssh2/session.pyx":153 * cdef int rc * with nogil: * rc = c_ssh2.libssh2_session_get_blocking(self._session) # <<<<<<<<<<<<<< @@ -3026,7 +3026,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":162 + /* "ssh2/session.pyx":152 * :rtype: bool""" * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -3045,7 +3045,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_12get_blocking(struct __pyx_ob } } - /* "ssh2/session.pyx":164 + /* "ssh2/session.pyx":154 * with nogil: * rc = c_ssh2.libssh2_session_get_blocking(self._session) * return bool(rc) # <<<<<<<<<<<<<< @@ -3053,17 +3053,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(1, 164, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 154, __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(1, 164, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 154, __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(1, 164, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":157 + /* "ssh2/session.pyx":147 * self._session, blocking) * * def get_blocking(self): # <<<<<<<<<<<<<< @@ -3082,7 +3082,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_12get_blocking(struct __pyx_ob return __pyx_r; } -/* "ssh2/session.pyx":166 +/* "ssh2/session.pyx":156 * return bool(rc) * * def set_timeout(self, long timeout): # <<<<<<<<<<<<<< @@ -3102,7 +3102,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(1, 166, __pyx_L3_error) + __pyx_v_timeout = __Pyx_PyInt_As_long(__pyx_arg_timeout); if (unlikely((__pyx_v_timeout == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 156, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -3122,7 +3122,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_14set_timeout(struct __pyx_obj __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_timeout", 0); - /* "ssh2/session.pyx":174 + /* "ssh2/session.pyx":164 * time out. * :param timeout: Milliseconds to wait before timeout.""" * with nogil: # <<<<<<<<<<<<<< @@ -3137,7 +3137,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_14set_timeout(struct __pyx_obj #endif /*try:*/ { - /* "ssh2/session.pyx":175 + /* "ssh2/session.pyx":165 * :param timeout: Milliseconds to wait before timeout.""" * with nogil: * c_ssh2.libssh2_session_set_timeout(self._session, timeout) # <<<<<<<<<<<<<< @@ -3147,7 +3147,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":174 + /* "ssh2/session.pyx":164 * time out. * :param timeout: Milliseconds to wait before timeout.""" * with nogil: # <<<<<<<<<<<<<< @@ -3166,7 +3166,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_14set_timeout(struct __pyx_obj } } - /* "ssh2/session.pyx":166 + /* "ssh2/session.pyx":156 * return bool(rc) * * def set_timeout(self, long timeout): # <<<<<<<<<<<<<< @@ -3181,7 +3181,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_14set_timeout(struct __pyx_obj return __pyx_r; } -/* "ssh2/session.pyx":177 +/* "ssh2/session.pyx":167 * c_ssh2.libssh2_session_set_timeout(self._session, timeout) * * def get_timeout(self): # <<<<<<<<<<<<<< @@ -3213,7 +3213,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":180 + /* "ssh2/session.pyx":170 * """Get current session timeout setting""" * cdef long timeout * with nogil: # <<<<<<<<<<<<<< @@ -3228,7 +3228,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_16get_timeout(struct __pyx_obj #endif /*try:*/ { - /* "ssh2/session.pyx":181 + /* "ssh2/session.pyx":171 * cdef long timeout * with nogil: * timeout = c_ssh2.libssh2_session_get_timeout(self._session) # <<<<<<<<<<<<<< @@ -3238,7 +3238,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":180 + /* "ssh2/session.pyx":170 * """Get current session timeout setting""" * cdef long timeout * with nogil: # <<<<<<<<<<<<<< @@ -3257,7 +3257,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_16get_timeout(struct __pyx_obj } } - /* "ssh2/session.pyx":182 + /* "ssh2/session.pyx":172 * with nogil: * timeout = c_ssh2.libssh2_session_get_timeout(self._session) * return timeout # <<<<<<<<<<<<<< @@ -3265,13 +3265,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(1, 182, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_timeout); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 172, __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":167 * c_ssh2.libssh2_session_set_timeout(self._session, timeout) * * def get_timeout(self): # <<<<<<<<<<<<<< @@ -3290,7 +3290,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_16get_timeout(struct __pyx_obj return __pyx_r; } -/* "ssh2/session.pyx":184 +/* "ssh2/session.pyx":174 * return timeout * * def userauth_authenticated(self): # <<<<<<<<<<<<<< @@ -3323,7 +3323,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_18userauth_authenticated(struc int __pyx_clineno = 0; __Pyx_RefNannySetupContext("userauth_authenticated", 0); - /* "ssh2/session.pyx":189 + /* "ssh2/session.pyx":179 * :rtype: bool""" * cdef bint rc * with nogil: # <<<<<<<<<<<<<< @@ -3338,7 +3338,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_18userauth_authenticated(struc #endif /*try:*/ { - /* "ssh2/session.pyx":190 + /* "ssh2/session.pyx":180 * cdef bint rc * with nogil: * rc = c_ssh2.libssh2_userauth_authenticated(self._session) # <<<<<<<<<<<<<< @@ -3348,7 +3348,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_18userauth_authenticated(struc __pyx_v_rc = libssh2_userauth_authenticated(__pyx_v_self->_session); } - /* "ssh2/session.pyx":189 + /* "ssh2/session.pyx":179 * :rtype: bool""" * cdef bint rc * with nogil: # <<<<<<<<<<<<<< @@ -3367,7 +3367,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_18userauth_authenticated(struc } } - /* "ssh2/session.pyx":191 + /* "ssh2/session.pyx":181 * with nogil: * rc = c_ssh2.libssh2_userauth_authenticated(self._session) * return bool(rc) # <<<<<<<<<<<<<< @@ -3376,13 +3376,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(1, 191, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBool_FromLong((!(!__pyx_t_1))); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":184 + /* "ssh2/session.pyx":174 * return timeout * * def userauth_authenticated(self): # <<<<<<<<<<<<<< @@ -3401,7 +3401,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_18userauth_authenticated(struc return __pyx_r; } -/* "ssh2/session.pyx":193 +/* "ssh2/session.pyx":183 * return bool(rc) * * def userauth_list(self, username not None): # <<<<<<<<<<<<<< @@ -3420,7 +3420,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(1, 193, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "username"); __PYX_ERR(1, 183, __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)); @@ -3450,19 +3450,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":197 + /* "ssh2/session.pyx":187 * * :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(1, 197, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_username); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_b_username = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/session.pyx":198 + /* "ssh2/session.pyx":188 * :rtype: list""" * cdef bytes b_username = to_bytes(username) * cdef char *_username = b_username # <<<<<<<<<<<<<< @@ -3471,12 +3471,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(1, 198, __pyx_L1_error) + __PYX_ERR(1, 188, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_username); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(1, 198, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_username); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(1, 188, __pyx_L1_error) __pyx_v__username = __pyx_t_2; - /* "ssh2/session.pyx":199 + /* "ssh2/session.pyx":189 * cdef bytes b_username = to_bytes(username) * cdef char *_username = b_username * cdef size_t username_len = len(b_username) # <<<<<<<<<<<<<< @@ -3485,12 +3485,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(1, 199, __pyx_L1_error) + __PYX_ERR(1, 189, __pyx_L1_error) } - __pyx_t_3 = PyBytes_GET_SIZE(__pyx_v_b_username); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 199, __pyx_L1_error) + __pyx_t_3 = PyBytes_GET_SIZE(__pyx_v_b_username); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 189, __pyx_L1_error) __pyx_v_username_len = __pyx_t_3; - /* "ssh2/session.pyx":202 + /* "ssh2/session.pyx":192 * cdef char *_auth * cdef str auth * with nogil: # <<<<<<<<<<<<<< @@ -3505,7 +3505,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_20userauth_list(struct __pyx_o #endif /*try:*/ { - /* "ssh2/session.pyx":203 + /* "ssh2/session.pyx":193 * cdef str auth * with nogil: * _auth = c_ssh2.libssh2_userauth_list( # <<<<<<<<<<<<<< @@ -3515,7 +3515,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":202 + /* "ssh2/session.pyx":192 * cdef char *_auth * cdef str auth * with nogil: # <<<<<<<<<<<<<< @@ -3534,7 +3534,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_20userauth_list(struct __pyx_o } } - /* "ssh2/session.pyx":205 + /* "ssh2/session.pyx":195 * _auth = c_ssh2.libssh2_userauth_list( * self._session, _username, username_len) * if _auth is NULL: # <<<<<<<<<<<<<< @@ -3544,7 +3544,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":206 + /* "ssh2/session.pyx":196 * self._session, _username, username_len) * if _auth is NULL: * return # <<<<<<<<<<<<<< @@ -3555,7 +3555,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":205 + /* "ssh2/session.pyx":195 * _auth = c_ssh2.libssh2_userauth_list( * self._session, _username, username_len) * if _auth is NULL: # <<<<<<<<<<<<<< @@ -3564,20 +3564,20 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_20userauth_list(struct __pyx_o */ } - /* "ssh2/session.pyx":207 + /* "ssh2/session.pyx":197 * 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(1, 207, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_5utils_to_str(__pyx_v__auth); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 197, __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(1, 207, __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(1, 197, __pyx_L1_error) __pyx_v_auth = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/session.pyx":208 + /* "ssh2/session.pyx":198 * return * auth = to_str(_auth) * return auth.split(',') # <<<<<<<<<<<<<< @@ -3585,13 +3585,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__3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 208, __pyx_L1_error) + __pyx_t_1 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyString_Type_split, __pyx_v_auth, __pyx_kp_s__3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":193 + /* "ssh2/session.pyx":183 * return bool(rc) * * def userauth_list(self, username not None): # <<<<<<<<<<<<<< @@ -3612,7 +3612,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_20userauth_list(struct __pyx_o return __pyx_r; } -/* "ssh2/session.pyx":210 +/* "ssh2/session.pyx":200 * return auth.split(',') * * def userauth_publickey_fromfile(self, username not None, # <<<<<<<<<<<<<< @@ -3639,7 +3639,7 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_23userauth_publickey_fromfile( PyObject* values[4] = {0,0,0,0}; values[2] = ((PyObject *)__pyx_kp_s__4); - /* "ssh2/session.pyx":213 + /* "ssh2/session.pyx":203 * privatekey not None, * passphrase='', * publickey=None): # <<<<<<<<<<<<<< @@ -3671,7 +3671,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(1, 210, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("userauth_publickey_fromfile", 0, 2, 4, 1); __PYX_ERR(1, 200, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -3687,7 +3687,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(1, 210, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "userauth_publickey_fromfile") < 0)) __PYX_ERR(1, 200, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -3708,21 +3708,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(1, 210, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("userauth_publickey_fromfile", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 200, __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(1, 210, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "username"); __PYX_ERR(1, 200, __pyx_L1_error) } if (unlikely(((PyObject *)__pyx_v_privatekey) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "privatekey"); __PYX_ERR(1, 211, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "privatekey"); __PYX_ERR(1, 201, __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":210 + /* "ssh2/session.pyx":200 * return auth.split(',') * * def userauth_publickey_fromfile(self, username not None, # <<<<<<<<<<<<<< @@ -3762,19 +3762,19 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_22userauth_publickey_fromfile( int __pyx_clineno = 0; __Pyx_RefNannySetupContext("userauth_publickey_fromfile", 0); - /* "ssh2/session.pyx":218 + /* "ssh2/session.pyx":208 * :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(1, 218, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_username); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_b_username = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/session.pyx":220 + /* "ssh2/session.pyx":210 * cdef bytes b_username = to_bytes(username) * cdef bytes b_publickey = to_bytes(publickey) \ * if publickey is not None else None # <<<<<<<<<<<<<< @@ -3784,20 +3784,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":219 + /* "ssh2/session.pyx":209 * 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(1, 219, __pyx_L1_error) + __pyx_t_3 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_publickey); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 209, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { - /* "ssh2/session.pyx":220 + /* "ssh2/session.pyx":210 * cdef bytes b_username = to_bytes(username) * cdef bytes b_publickey = to_bytes(publickey) \ * if publickey is not None else None # <<<<<<<<<<<<<< @@ -3810,31 +3810,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":221 + /* "ssh2/session.pyx":211 * 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(1, 221, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_privatekey); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_b_privatekey = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/session.pyx":222 + /* "ssh2/session.pyx":212 * 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(1, 222, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_passphrase); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_b_passphrase = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/session.pyx":223 + /* "ssh2/session.pyx":213 * cdef bytes b_privatekey = to_bytes(privatekey) * cdef bytes b_passphrase = to_bytes(passphrase) * cdef char *_username = b_username # <<<<<<<<<<<<<< @@ -3843,12 +3843,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(1, 223, __pyx_L1_error) + __PYX_ERR(1, 213, __pyx_L1_error) } - __pyx_t_4 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_username); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(1, 223, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_username); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(1, 213, __pyx_L1_error) __pyx_v__username = __pyx_t_4; - /* "ssh2/session.pyx":224 + /* "ssh2/session.pyx":214 * cdef bytes b_passphrase = to_bytes(passphrase) * cdef char *_username = b_username * cdef char *_publickey = NULL # <<<<<<<<<<<<<< @@ -3857,7 +3857,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_22userauth_publickey_fromfile( */ __pyx_v__publickey = NULL; - /* "ssh2/session.pyx":225 + /* "ssh2/session.pyx":215 * cdef char *_username = b_username * cdef char *_publickey = NULL * cdef char *_privatekey = b_privatekey # <<<<<<<<<<<<<< @@ -3866,12 +3866,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(1, 225, __pyx_L1_error) + __PYX_ERR(1, 215, __pyx_L1_error) } - __pyx_t_4 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_privatekey); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(1, 225, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_privatekey); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(1, 215, __pyx_L1_error) __pyx_v__privatekey = __pyx_t_4; - /* "ssh2/session.pyx":226 + /* "ssh2/session.pyx":216 * cdef char *_publickey = NULL * cdef char *_privatekey = b_privatekey * cdef char *_passphrase = b_passphrase # <<<<<<<<<<<<<< @@ -3880,12 +3880,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(1, 226, __pyx_L1_error) + __PYX_ERR(1, 216, __pyx_L1_error) } - __pyx_t_4 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_passphrase); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(1, 226, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_passphrase); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(1, 216, __pyx_L1_error) __pyx_v__passphrase = __pyx_t_4; - /* "ssh2/session.pyx":227 + /* "ssh2/session.pyx":217 * cdef char *_privatekey = b_privatekey * cdef char *_passphrase = b_passphrase * if b_publickey is not None: # <<<<<<<<<<<<<< @@ -3896,7 +3896,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":228 + /* "ssh2/session.pyx":218 * cdef char *_passphrase = b_passphrase * if b_publickey is not None: * _publickey = b_publickey # <<<<<<<<<<<<<< @@ -3905,12 +3905,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(1, 228, __pyx_L1_error) + __PYX_ERR(1, 218, __pyx_L1_error) } - __pyx_t_4 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_publickey); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(1, 228, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_publickey); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(1, 218, __pyx_L1_error) __pyx_v__publickey = __pyx_t_4; - /* "ssh2/session.pyx":227 + /* "ssh2/session.pyx":217 * cdef char *_privatekey = b_privatekey * cdef char *_passphrase = b_passphrase * if b_publickey is not None: # <<<<<<<<<<<<<< @@ -3919,7 +3919,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_22userauth_publickey_fromfile( */ } - /* "ssh2/session.pyx":229 + /* "ssh2/session.pyx":219 * if b_publickey is not None: * _publickey = b_publickey * with nogil: # <<<<<<<<<<<<<< @@ -3934,7 +3934,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_22userauth_publickey_fromfile( #endif /*try:*/ { - /* "ssh2/session.pyx":230 + /* "ssh2/session.pyx":220 * _publickey = b_publickey * with nogil: * rc = c_ssh2.libssh2_userauth_publickey_fromfile( # <<<<<<<<<<<<<< @@ -3944,7 +3944,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":229 + /* "ssh2/session.pyx":219 * if b_publickey is not None: * _publickey = b_publickey * with nogil: # <<<<<<<<<<<<<< @@ -3963,7 +3963,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_22userauth_publickey_fromfile( } } - /* "ssh2/session.pyx":232 + /* "ssh2/session.pyx":222 * rc = c_ssh2.libssh2_userauth_publickey_fromfile( * self._session, _username, _publickey, _privatekey, _passphrase) * return handle_error_codes(rc) # <<<<<<<<<<<<<< @@ -3971,14 +3971,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(1, 232, __pyx_L1_error) - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 232, __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(1, 222, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":210 + /* "ssh2/session.pyx":200 * return auth.split(',') * * def userauth_publickey_fromfile(self, username not None, # <<<<<<<<<<<<<< @@ -4002,7 +4002,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_22userauth_publickey_fromfile( return __pyx_r; } -/* "ssh2/session.pyx":234 +/* "ssh2/session.pyx":224 * return handle_error_codes(rc) * * def userauth_publickey(self, username not None, # <<<<<<<<<<<<<< @@ -4045,11 +4045,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(1, 234, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("userauth_publickey", 1, 2, 2, 1); __PYX_ERR(1, 224, __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(1, 234, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "userauth_publickey") < 0)) __PYX_ERR(1, 224, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -4062,16 +4062,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(1, 234, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("userauth_publickey", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 224, __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(1, 234, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "username"); __PYX_ERR(1, 224, __pyx_L1_error) } - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pubkeydata), (&PyBytes_Type), 0, "pubkeydata", 1))) __PYX_ERR(1, 235, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pubkeydata), (&PyBytes_Type), 0, "pubkeydata", 1))) __PYX_ERR(1, 225, __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 */ @@ -4101,19 +4101,19 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_24userauth_publickey(struct __ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("userauth_publickey", 0); - /* "ssh2/session.pyx":245 + /* "ssh2/session.pyx":235 * :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(1, 245, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_username); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_b_username = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/session.pyx":246 + /* "ssh2/session.pyx":236 * cdef int rc * cdef bytes b_username = to_bytes(username) * cdef char *_username = b_username # <<<<<<<<<<<<<< @@ -4122,32 +4122,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(1, 246, __pyx_L1_error) + __PYX_ERR(1, 236, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_username); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(1, 246, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_username); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(1, 236, __pyx_L1_error) __pyx_v__username = __pyx_t_2; - /* "ssh2/session.pyx":247 + /* "ssh2/session.pyx":237 * 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(1, 247, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyBytes_AsWritableUString(__pyx_v_pubkeydata); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) __PYX_ERR(1, 237, __pyx_L1_error) __pyx_v__pubkeydata = __pyx_t_3; - /* "ssh2/session.pyx":248 + /* "ssh2/session.pyx":238 * 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(1, 248, __pyx_L1_error) + __pyx_t_4 = PyBytes_GET_SIZE(__pyx_v_pubkeydata); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(1, 238, __pyx_L1_error) __pyx_v_pubkeydata_len = __pyx_t_4; - /* "ssh2/session.pyx":249 + /* "ssh2/session.pyx":239 * cdef unsigned char *_pubkeydata = pubkeydata * cdef size_t pubkeydata_len = len(pubkeydata) * with nogil: # <<<<<<<<<<<<<< @@ -4162,7 +4162,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_24userauth_publickey(struct __ #endif /*try:*/ { - /* "ssh2/session.pyx":250 + /* "ssh2/session.pyx":240 * cdef size_t pubkeydata_len = len(pubkeydata) * with nogil: * rc = c_ssh2.libssh2_userauth_publickey( # <<<<<<<<<<<<<< @@ -4172,7 +4172,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":249 + /* "ssh2/session.pyx":239 * cdef unsigned char *_pubkeydata = pubkeydata * cdef size_t pubkeydata_len = len(pubkeydata) * with nogil: # <<<<<<<<<<<<<< @@ -4191,7 +4191,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_24userauth_publickey(struct __ } } - /* "ssh2/session.pyx":253 + /* "ssh2/session.pyx":243 * self._session, _username, _pubkeydata, * pubkeydata_len, NULL, NULL) * return handle_error_codes(rc) # <<<<<<<<<<<<<< @@ -4199,14 +4199,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(1, 253, __pyx_L1_error) - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 253, __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(1, 243, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":234 + /* "ssh2/session.pyx":224 * return handle_error_codes(rc) * * def userauth_publickey(self, username not None, # <<<<<<<<<<<<<< @@ -4226,7 +4226,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_24userauth_publickey(struct __ return __pyx_r; } -/* "ssh2/session.pyx":255 +/* "ssh2/session.pyx":245 * return handle_error_codes(rc) * * def userauth_hostbased_fromfile(self, # <<<<<<<<<<<<<< @@ -4253,7 +4253,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":259 + /* "ssh2/session.pyx":249 * privatekey not None, * hostname not None, * publickey=None, # <<<<<<<<<<<<<< @@ -4288,13 +4288,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(1, 255, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("userauth_hostbased_fromfile", 0, 3, 5, 1); __PYX_ERR(1, 245, __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(1, 255, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("userauth_hostbased_fromfile", 0, 3, 5, 2); __PYX_ERR(1, 245, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: @@ -4310,7 +4310,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(1, 255, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "userauth_hostbased_fromfile") < 0)) __PYX_ERR(1, 245, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -4333,24 +4333,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(1, 255, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("userauth_hostbased_fromfile", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 245, __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(1, 256, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "username"); __PYX_ERR(1, 246, __pyx_L1_error) } if (unlikely(((PyObject *)__pyx_v_privatekey) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "privatekey"); __PYX_ERR(1, 257, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "privatekey"); __PYX_ERR(1, 247, __pyx_L1_error) } if (unlikely(((PyObject *)__pyx_v_hostname) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "hostname"); __PYX_ERR(1, 258, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "hostname"); __PYX_ERR(1, 248, __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":255 + /* "ssh2/session.pyx":245 * return handle_error_codes(rc) * * def userauth_hostbased_fromfile(self, # <<<<<<<<<<<<<< @@ -4392,19 +4392,19 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_26userauth_hostbased_fromfile( int __pyx_clineno = 0; __Pyx_RefNannySetupContext("userauth_hostbased_fromfile", 0); - /* "ssh2/session.pyx":262 + /* "ssh2/session.pyx":252 * 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(1, 262, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_username); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_b_username = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/session.pyx":264 + /* "ssh2/session.pyx":254 * cdef bytes b_username = to_bytes(username) * cdef bytes b_publickey = to_bytes(publickey) \ * if publickey is not None else None # <<<<<<<<<<<<<< @@ -4414,20 +4414,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":263 + /* "ssh2/session.pyx":253 * 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(1, 263, __pyx_L1_error) + __pyx_t_3 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_publickey); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { - /* "ssh2/session.pyx":264 + /* "ssh2/session.pyx":254 * cdef bytes b_username = to_bytes(username) * cdef bytes b_publickey = to_bytes(publickey) \ * if publickey is not None else None # <<<<<<<<<<<<<< @@ -4440,43 +4440,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":265 + /* "ssh2/session.pyx":255 * 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(1, 265, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_privatekey); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_b_privatekey = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/session.pyx":266 + /* "ssh2/session.pyx":256 * 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(1, 266, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_passphrase); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_b_passphrase = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/session.pyx":267 + /* "ssh2/session.pyx":257 * 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(1, 267, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_hostname); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_b_hostname = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/session.pyx":268 + /* "ssh2/session.pyx":258 * cdef bytes b_passphrase = to_bytes(passphrase) * cdef bytes b_hostname = to_bytes(hostname) * cdef char *_username = b_username # <<<<<<<<<<<<<< @@ -4485,12 +4485,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(1, 268, __pyx_L1_error) + __PYX_ERR(1, 258, __pyx_L1_error) } - __pyx_t_4 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_username); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(1, 268, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_username); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(1, 258, __pyx_L1_error) __pyx_v__username = __pyx_t_4; - /* "ssh2/session.pyx":269 + /* "ssh2/session.pyx":259 * cdef bytes b_hostname = to_bytes(hostname) * cdef char *_username = b_username * cdef char *_publickey = NULL # <<<<<<<<<<<<<< @@ -4499,7 +4499,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_26userauth_hostbased_fromfile( */ __pyx_v__publickey = NULL; - /* "ssh2/session.pyx":270 + /* "ssh2/session.pyx":260 * cdef char *_username = b_username * cdef char *_publickey = NULL * cdef char *_privatekey = b_privatekey # <<<<<<<<<<<<<< @@ -4508,12 +4508,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(1, 270, __pyx_L1_error) + __PYX_ERR(1, 260, __pyx_L1_error) } - __pyx_t_4 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_privatekey); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(1, 270, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_privatekey); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(1, 260, __pyx_L1_error) __pyx_v__privatekey = __pyx_t_4; - /* "ssh2/session.pyx":271 + /* "ssh2/session.pyx":261 * cdef char *_publickey = NULL * cdef char *_privatekey = b_privatekey * cdef char *_passphrase = b_passphrase # <<<<<<<<<<<<<< @@ -4522,12 +4522,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(1, 271, __pyx_L1_error) + __PYX_ERR(1, 261, __pyx_L1_error) } - __pyx_t_4 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_passphrase); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(1, 271, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_passphrase); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(1, 261, __pyx_L1_error) __pyx_v__passphrase = __pyx_t_4; - /* "ssh2/session.pyx":272 + /* "ssh2/session.pyx":262 * cdef char *_privatekey = b_privatekey * cdef char *_passphrase = b_passphrase * cdef char *_hostname = b_hostname # <<<<<<<<<<<<<< @@ -4536,12 +4536,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(1, 272, __pyx_L1_error) + __PYX_ERR(1, 262, __pyx_L1_error) } - __pyx_t_4 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_hostname); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(1, 272, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_hostname); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(1, 262, __pyx_L1_error) __pyx_v__hostname = __pyx_t_4; - /* "ssh2/session.pyx":273 + /* "ssh2/session.pyx":263 * cdef char *_passphrase = b_passphrase * cdef char *_hostname = b_hostname * if b_publickey is not None: # <<<<<<<<<<<<<< @@ -4552,7 +4552,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":274 + /* "ssh2/session.pyx":264 * cdef char *_hostname = b_hostname * if b_publickey is not None: * _publickey = b_publickey # <<<<<<<<<<<<<< @@ -4561,12 +4561,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(1, 274, __pyx_L1_error) + __PYX_ERR(1, 264, __pyx_L1_error) } - __pyx_t_4 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_publickey); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(1, 274, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_publickey); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(1, 264, __pyx_L1_error) __pyx_v__publickey = __pyx_t_4; - /* "ssh2/session.pyx":273 + /* "ssh2/session.pyx":263 * cdef char *_passphrase = b_passphrase * cdef char *_hostname = b_hostname * if b_publickey is not None: # <<<<<<<<<<<<<< @@ -4575,7 +4575,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_26userauth_hostbased_fromfile( */ } - /* "ssh2/session.pyx":275 + /* "ssh2/session.pyx":265 * if b_publickey is not None: * _publickey = b_publickey * with nogil: # <<<<<<<<<<<<<< @@ -4590,7 +4590,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_26userauth_hostbased_fromfile( #endif /*try:*/ { - /* "ssh2/session.pyx":276 + /* "ssh2/session.pyx":266 * _publickey = b_publickey * with nogil: * rc = c_ssh2.libssh2_userauth_hostbased_fromfile( # <<<<<<<<<<<<<< @@ -4600,7 +4600,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":275 + /* "ssh2/session.pyx":265 * if b_publickey is not None: * _publickey = b_publickey * with nogil: # <<<<<<<<<<<<<< @@ -4619,22 +4619,22 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_26userauth_hostbased_fromfile( } } - /* "ssh2/session.pyx":279 + /* "ssh2/session.pyx":269 * self._session, _username, _publickey, * _privatekey, _passphrase, _hostname) * return handle_error_codes(rc) # <<<<<<<<<<<<<< * - * IF EMBEDDED_LIB: + * def userauth_publickey_frommemory( */ __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(1, 279, __pyx_L1_error) - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 279, __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(1, 269, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":255 + /* "ssh2/session.pyx":245 * return handle_error_codes(rc) * * def userauth_hostbased_fromfile(self, # <<<<<<<<<<<<<< @@ -4659,12 +4659,12 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_26userauth_hostbased_fromfile( return __pyx_r; } -/* "ssh2/session.pyx":282 +/* "ssh2/session.pyx":271 + * return handle_error_codes(rc) * - * IF EMBEDDED_LIB: - * def userauth_publickey_frommemory( # <<<<<<<<<<<<<< - * self, username, bytes privatekeyfiledata, - * passphrase='', bytes publickeyfiledata=None): + * def userauth_publickey_frommemory( # <<<<<<<<<<<<<< + * self, username, bytes privatekeyfiledata, + * passphrase='', bytes publickeyfiledata=None): */ /* Python wrapper */ @@ -4686,12 +4686,12 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_29userauth_publickey_frommemor PyObject* values[4] = {0,0,0,0}; values[2] = ((PyObject *)__pyx_kp_s__4); - /* "ssh2/session.pyx":284 - * def userauth_publickey_frommemory( - * self, username, bytes privatekeyfiledata, - * passphrase='', bytes publickeyfiledata=None): # <<<<<<<<<<<<<< - * cdef int rc - * cdef bytes b_username = to_bytes(username) + /* "ssh2/session.pyx":273 + * def userauth_publickey_frommemory( + * self, username, bytes privatekeyfiledata, + * passphrase='', bytes publickeyfiledata=None): # <<<<<<<<<<<<<< + * cdef int rc + * cdef bytes b_username = to_bytes(username) */ values[3] = ((PyObject*)Py_None); if (unlikely(__pyx_kwds)) { @@ -4718,7 +4718,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(1, 282, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("userauth_publickey_frommemory", 0, 2, 4, 1); __PYX_ERR(1, 271, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -4734,7 +4734,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(1, 282, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "userauth_publickey_frommemory") < 0)) __PYX_ERR(1, 271, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -4755,22 +4755,22 @@ 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(1, 282, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("userauth_publickey_frommemory", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 271, __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(1, 283, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_publickeyfiledata), (&PyBytes_Type), 1, "publickeyfiledata", 1))) __PYX_ERR(1, 284, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_privatekeyfiledata), (&PyBytes_Type), 1, "privatekeyfiledata", 1))) __PYX_ERR(1, 272, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_publickeyfiledata), (&PyBytes_Type), 1, "publickeyfiledata", 1))) __PYX_ERR(1, 273, __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":282 + /* "ssh2/session.pyx":271 + * return handle_error_codes(rc) * - * IF EMBEDDED_LIB: - * def userauth_publickey_frommemory( # <<<<<<<<<<<<<< - * self, username, bytes privatekeyfiledata, - * passphrase='', bytes publickeyfiledata=None): + * def userauth_publickey_frommemory( # <<<<<<<<<<<<<< + * self, username, bytes privatekeyfiledata, + * passphrase='', bytes publickeyfiledata=None): */ /* function exit code */ @@ -4807,164 +4807,164 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_28userauth_publickey_frommemor int __pyx_clineno = 0; __Pyx_RefNannySetupContext("userauth_publickey_frommemory", 0); - /* "ssh2/session.pyx":286 - * 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 + /* "ssh2/session.pyx":275 + * 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(1, 286, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_username); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_b_username = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/session.pyx":287 - * 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 + /* "ssh2/session.pyx":276 + * 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(1, 287, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_passphrase); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 276, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_b_passphrase = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/session.pyx":288 - * cdef bytes b_username = to_bytes(username) - * cdef bytes b_passphrase = to_bytes(passphrase) - * cdef char *_username = b_username # <<<<<<<<<<<<<< - * cdef char *_passphrase = b_passphrase - * cdef char *_publickeyfiledata = NULL + /* "ssh2/session.pyx":277 + * cdef bytes b_username = to_bytes(username) + * cdef bytes b_passphrase = to_bytes(passphrase) + * cdef char *_username = b_username # <<<<<<<<<<<<<< + * cdef char *_passphrase = b_passphrase + * cdef char *_publickeyfiledata = NULL */ if (unlikely(__pyx_v_b_username == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(1, 288, __pyx_L1_error) + __PYX_ERR(1, 277, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_username); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(1, 288, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_username); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(1, 277, __pyx_L1_error) __pyx_v__username = __pyx_t_2; - /* "ssh2/session.pyx":289 - * cdef bytes b_passphrase = to_bytes(passphrase) - * cdef char *_username = b_username - * cdef char *_passphrase = b_passphrase # <<<<<<<<<<<<<< - * cdef char *_publickeyfiledata = NULL - * cdef char *_privatekeyfiledata = privatekeyfiledata + /* "ssh2/session.pyx":278 + * cdef bytes b_passphrase = to_bytes(passphrase) + * cdef char *_username = b_username + * cdef char *_passphrase = b_passphrase # <<<<<<<<<<<<<< + * cdef char *_publickeyfiledata = NULL + * cdef char *_privatekeyfiledata = privatekeyfiledata */ if (unlikely(__pyx_v_b_passphrase == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(1, 289, __pyx_L1_error) + __PYX_ERR(1, 278, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_passphrase); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(1, 289, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_passphrase); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(1, 278, __pyx_L1_error) __pyx_v__passphrase = __pyx_t_2; - /* "ssh2/session.pyx":290 - * cdef char *_username = b_username - * cdef char *_passphrase = b_passphrase - * cdef char *_publickeyfiledata = NULL # <<<<<<<<<<<<<< - * cdef char *_privatekeyfiledata = privatekeyfiledata - * cdef size_t username_len, privatekeydata_len + /* "ssh2/session.pyx":279 + * cdef char *_username = b_username + * cdef char *_passphrase = b_passphrase + * cdef char *_publickeyfiledata = NULL # <<<<<<<<<<<<<< + * cdef char *_privatekeyfiledata = privatekeyfiledata + * cdef size_t username_len, privatekeydata_len */ __pyx_v__publickeyfiledata = NULL; - /* "ssh2/session.pyx":291 - * cdef char *_passphrase = b_passphrase - * cdef char *_publickeyfiledata = NULL - * cdef char *_privatekeyfiledata = privatekeyfiledata # <<<<<<<<<<<<<< - * cdef size_t username_len, privatekeydata_len - * cdef size_t pubkeydata_len = 0 + /* "ssh2/session.pyx":280 + * cdef char *_passphrase = b_passphrase + * cdef char *_publickeyfiledata = NULL + * cdef char *_privatekeyfiledata = privatekeyfiledata # <<<<<<<<<<<<<< + * cdef size_t username_len, privatekeydata_len + * cdef size_t pubkeydata_len = 0 */ if (unlikely(__pyx_v_privatekeyfiledata == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(1, 291, __pyx_L1_error) + __PYX_ERR(1, 280, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_privatekeyfiledata); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(1, 291, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_privatekeyfiledata); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(1, 280, __pyx_L1_error) __pyx_v__privatekeyfiledata = __pyx_t_2; - /* "ssh2/session.pyx":293 - * cdef char *_privatekeyfiledata = privatekeyfiledata - * cdef size_t username_len, privatekeydata_len - * cdef size_t pubkeydata_len = 0 # <<<<<<<<<<<<<< - * username_len, privatekeydata_len = \ - * len(b_username), len(privatekeyfiledata) + /* "ssh2/session.pyx":282 + * cdef char *_privatekeyfiledata = privatekeyfiledata + * cdef size_t username_len, privatekeydata_len + * cdef size_t pubkeydata_len = 0 # <<<<<<<<<<<<<< + * username_len, privatekeydata_len = \ + * len(b_username), len(privatekeyfiledata) */ __pyx_v_pubkeydata_len = 0; - /* "ssh2/session.pyx":295 - * cdef size_t pubkeydata_len = 0 - * username_len, privatekeydata_len = \ - * len(b_username), len(privatekeyfiledata) # <<<<<<<<<<<<<< - * if publickeyfiledata is not None: - * _publickeyfiledata = publickeyfiledata + /* "ssh2/session.pyx":284 + * cdef size_t pubkeydata_len = 0 + * username_len, privatekeydata_len = \ + * len(b_username), len(privatekeyfiledata) # <<<<<<<<<<<<<< + * if publickeyfiledata is not None: + * _publickeyfiledata = publickeyfiledata */ if (unlikely(__pyx_v_b_username == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(1, 295, __pyx_L1_error) + __PYX_ERR(1, 284, __pyx_L1_error) } - __pyx_t_3 = PyBytes_GET_SIZE(__pyx_v_b_username); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 295, __pyx_L1_error) + __pyx_t_3 = PyBytes_GET_SIZE(__pyx_v_b_username); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 284, __pyx_L1_error) if (unlikely(__pyx_v_privatekeyfiledata == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(1, 295, __pyx_L1_error) + __PYX_ERR(1, 284, __pyx_L1_error) } - __pyx_t_4 = PyBytes_GET_SIZE(__pyx_v_privatekeyfiledata); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(1, 295, __pyx_L1_error) + __pyx_t_4 = PyBytes_GET_SIZE(__pyx_v_privatekeyfiledata); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(1, 284, __pyx_L1_error) __pyx_v_username_len = __pyx_t_3; __pyx_v_privatekeydata_len = __pyx_t_4; - /* "ssh2/session.pyx":296 - * username_len, privatekeydata_len = \ - * len(b_username), len(privatekeyfiledata) - * if publickeyfiledata is not None: # <<<<<<<<<<<<<< - * _publickeyfiledata = publickeyfiledata - * pubkeydata_len = len(publickeyfiledata) + /* "ssh2/session.pyx":285 + * username_len, privatekeydata_len = \ + * len(b_username), len(privatekeyfiledata) + * if publickeyfiledata is not None: # <<<<<<<<<<<<<< + * _publickeyfiledata = publickeyfiledata + * pubkeydata_len = len(publickeyfiledata) */ __pyx_t_5 = (__pyx_v_publickeyfiledata != ((PyObject*)Py_None)); __pyx_t_6 = (__pyx_t_5 != 0); if (__pyx_t_6) { - /* "ssh2/session.pyx":297 - * len(b_username), len(privatekeyfiledata) - * if publickeyfiledata is not None: - * _publickeyfiledata = publickeyfiledata # <<<<<<<<<<<<<< - * pubkeydata_len = len(publickeyfiledata) - * with nogil: + /* "ssh2/session.pyx":286 + * len(b_username), len(privatekeyfiledata) + * if publickeyfiledata is not None: + * _publickeyfiledata = publickeyfiledata # <<<<<<<<<<<<<< + * pubkeydata_len = len(publickeyfiledata) + * with nogil: */ if (unlikely(__pyx_v_publickeyfiledata == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(1, 297, __pyx_L1_error) + __PYX_ERR(1, 286, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_publickeyfiledata); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(1, 297, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_publickeyfiledata); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(1, 286, __pyx_L1_error) __pyx_v__publickeyfiledata = __pyx_t_2; - /* "ssh2/session.pyx":298 - * if publickeyfiledata is not None: - * _publickeyfiledata = publickeyfiledata - * pubkeydata_len = len(publickeyfiledata) # <<<<<<<<<<<<<< - * with nogil: - * rc = c_ssh2.libssh2_userauth_publickey_frommemory( + /* "ssh2/session.pyx":287 + * if publickeyfiledata is not None: + * _publickeyfiledata = publickeyfiledata + * pubkeydata_len = len(publickeyfiledata) # <<<<<<<<<<<<<< + * with nogil: + * rc = c_ssh2.libssh2_userauth_publickey_frommemory( */ if (unlikely(__pyx_v_publickeyfiledata == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(1, 298, __pyx_L1_error) + __PYX_ERR(1, 287, __pyx_L1_error) } - __pyx_t_4 = PyBytes_GET_SIZE(__pyx_v_publickeyfiledata); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(1, 298, __pyx_L1_error) + __pyx_t_4 = PyBytes_GET_SIZE(__pyx_v_publickeyfiledata); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(1, 287, __pyx_L1_error) __pyx_v_pubkeydata_len = __pyx_t_4; - /* "ssh2/session.pyx":296 - * username_len, privatekeydata_len = \ - * len(b_username), len(privatekeyfiledata) - * if publickeyfiledata is not None: # <<<<<<<<<<<<<< - * _publickeyfiledata = publickeyfiledata - * pubkeydata_len = len(publickeyfiledata) + /* "ssh2/session.pyx":285 + * username_len, privatekeydata_len = \ + * len(b_username), len(privatekeyfiledata) + * if publickeyfiledata is not None: # <<<<<<<<<<<<<< + * _publickeyfiledata = publickeyfiledata + * pubkeydata_len = len(publickeyfiledata) */ } - /* "ssh2/session.pyx":299 - * _publickeyfiledata = publickeyfiledata - * pubkeydata_len = len(publickeyfiledata) - * with nogil: # <<<<<<<<<<<<<< - * rc = c_ssh2.libssh2_userauth_publickey_frommemory( - * self._session, _username, username_len, _publickeyfiledata, + /* "ssh2/session.pyx":288 + * _publickeyfiledata = publickeyfiledata + * pubkeydata_len = len(publickeyfiledata) + * with nogil: # <<<<<<<<<<<<<< + * rc = c_ssh2.libssh2_userauth_publickey_frommemory( + * self._session, _username, username_len, _publickeyfiledata, */ { #ifdef WITH_THREAD @@ -4974,22 +4974,22 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_28userauth_publickey_frommemor #endif /*try:*/ { - /* "ssh2/session.pyx":300 - * pubkeydata_len = len(publickeyfiledata) - * with nogil: - * rc = c_ssh2.libssh2_userauth_publickey_frommemory( # <<<<<<<<<<<<<< - * self._session, _username, username_len, _publickeyfiledata, - * pubkeydata_len, _privatekeyfiledata, + /* "ssh2/session.pyx":289 + * pubkeydata_len = len(publickeyfiledata) + * with nogil: + * rc = c_ssh2.libssh2_userauth_publickey_frommemory( # <<<<<<<<<<<<<< + * self._session, _username, username_len, _publickeyfiledata, + * pubkeydata_len, _privatekeyfiledata, */ __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":299 - * _publickeyfiledata = publickeyfiledata - * pubkeydata_len = len(publickeyfiledata) - * with nogil: # <<<<<<<<<<<<<< - * rc = c_ssh2.libssh2_userauth_publickey_frommemory( - * self._session, _username, username_len, _publickeyfiledata, + /* "ssh2/session.pyx":288 + * _publickeyfiledata = publickeyfiledata + * pubkeydata_len = len(publickeyfiledata) + * with nogil: # <<<<<<<<<<<<<< + * rc = c_ssh2.libssh2_userauth_publickey_frommemory( + * self._session, _username, username_len, _publickeyfiledata, */ /*finally:*/ { /*normal exit:*/{ @@ -5003,27 +5003,27 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_28userauth_publickey_frommemor } } - /* "ssh2/session.pyx":304 - * pubkeydata_len, _privatekeyfiledata, - * privatekeydata_len, _passphrase) - * return handle_error_codes(rc) # <<<<<<<<<<<<<< + /* "ssh2/session.pyx":293 + * pubkeydata_len, _privatekeyfiledata, + * privatekeydata_len, _passphrase) + * return handle_error_codes(rc) # <<<<<<<<<<<<<< * * 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(1, 304, __pyx_L1_error) - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 304, __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(1, 293, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 293, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":282 + /* "ssh2/session.pyx":271 + * return handle_error_codes(rc) * - * IF EMBEDDED_LIB: - * def userauth_publickey_frommemory( # <<<<<<<<<<<<<< - * self, username, bytes privatekeyfiledata, - * passphrase='', bytes publickeyfiledata=None): + * def userauth_publickey_frommemory( # <<<<<<<<<<<<<< + * self, username, bytes privatekeyfiledata, + * passphrase='', bytes publickeyfiledata=None): */ /* function exit code */ @@ -5039,8 +5039,8 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_28userauth_publickey_frommemor return __pyx_r; } -/* "ssh2/session.pyx":306 - * return handle_error_codes(rc) +/* "ssh2/session.pyx":295 + * return handle_error_codes(rc) * * def userauth_password(self, username not None, password not None): # <<<<<<<<<<<<<< * """Perform password authentication @@ -5082,11 +5082,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(1, 306, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("userauth_password", 1, 2, 2, 1); __PYX_ERR(1, 295, __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(1, 306, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "userauth_password") < 0)) __PYX_ERR(1, 295, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -5099,17 +5099,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(1, 306, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("userauth_password", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 295, __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(1, 306, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "username"); __PYX_ERR(1, 295, __pyx_L1_error) } if (unlikely(((PyObject *)__pyx_v_password) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "password"); __PYX_ERR(1, 306, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "password"); __PYX_ERR(1, 295, __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); @@ -5139,31 +5139,31 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_30userauth_password(struct __p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("userauth_password", 0); - /* "ssh2/session.pyx":314 + /* "ssh2/session.pyx":303 * :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(1, 314, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_username); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_b_username = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/session.pyx":315 + /* "ssh2/session.pyx":304 * 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(1, 315, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_password); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_b_password = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/session.pyx":316 + /* "ssh2/session.pyx":305 * cdef bytes b_username = to_bytes(username) * cdef bytes b_password = to_bytes(password) * cdef const char *_username = b_username # <<<<<<<<<<<<<< @@ -5172,12 +5172,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(1, 316, __pyx_L1_error) + __PYX_ERR(1, 305, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyBytes_AsString(__pyx_v_b_username); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(1, 316, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_AsString(__pyx_v_b_username); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(1, 305, __pyx_L1_error) __pyx_v__username = __pyx_t_2; - /* "ssh2/session.pyx":317 + /* "ssh2/session.pyx":306 * cdef bytes b_password = to_bytes(password) * cdef const char *_username = b_username * cdef const char *_password = b_password # <<<<<<<<<<<<<< @@ -5186,12 +5186,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(1, 317, __pyx_L1_error) + __PYX_ERR(1, 306, __pyx_L1_error) } - __pyx_t_3 = __Pyx_PyBytes_AsString(__pyx_v_b_password); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) __PYX_ERR(1, 317, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyBytes_AsString(__pyx_v_b_password); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) __PYX_ERR(1, 306, __pyx_L1_error) __pyx_v__password = __pyx_t_3; - /* "ssh2/session.pyx":318 + /* "ssh2/session.pyx":307 * cdef const char *_username = b_username * cdef const char *_password = b_password * with nogil: # <<<<<<<<<<<<<< @@ -5206,7 +5206,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_30userauth_password(struct __p #endif /*try:*/ { - /* "ssh2/session.pyx":319 + /* "ssh2/session.pyx":308 * cdef const char *_password = b_password * with nogil: * rc = c_ssh2.libssh2_userauth_password( # <<<<<<<<<<<<<< @@ -5216,7 +5216,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":318 + /* "ssh2/session.pyx":307 * cdef const char *_username = b_username * cdef const char *_password = b_password * with nogil: # <<<<<<<<<<<<<< @@ -5235,7 +5235,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_30userauth_password(struct __p } } - /* "ssh2/session.pyx":321 + /* "ssh2/session.pyx":310 * rc = c_ssh2.libssh2_userauth_password( * self._session, _username, _password) * return handle_error_codes(rc) # <<<<<<<<<<<<<< @@ -5243,15 +5243,15 @@ 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(1, 321, __pyx_L1_error) - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 321, __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(1, 310, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 310, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":306 - * return handle_error_codes(rc) + /* "ssh2/session.pyx":295 + * return handle_error_codes(rc) * * def userauth_password(self, username not None, password not None): # <<<<<<<<<<<<<< * """Perform password authentication @@ -5271,7 +5271,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_30userauth_password(struct __p return __pyx_r; } -/* "ssh2/session.pyx":323 +/* "ssh2/session.pyx":312 * return handle_error_codes(rc) * * def userauth_keyboardinteractive(self, username not None, # <<<<<<<<<<<<<< @@ -5314,11 +5314,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(1, 323, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("userauth_keyboardinteractive", 1, 2, 2, 1); __PYX_ERR(1, 312, __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(1, 323, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "userauth_keyboardinteractive") < 0)) __PYX_ERR(1, 312, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -5331,17 +5331,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(1, 323, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("userauth_keyboardinteractive", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 312, __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(1, 323, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "username"); __PYX_ERR(1, 312, __pyx_L1_error) } if (unlikely(((PyObject *)__pyx_v_password) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "password"); __PYX_ERR(1, 324, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "password"); __PYX_ERR(1, 313, __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); @@ -5354,7 +5354,7 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_33userauth_keyboardinteractive return __pyx_r; } -/* "ssh2/session.pyx":336 +/* "ssh2/session.pyx":325 * cdef const char *_username = b_username * * def passwd(): # <<<<<<<<<<<<<< @@ -5388,7 +5388,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":337 + /* "ssh2/session.pyx":326 * * def passwd(): * return password # <<<<<<<<<<<<<< @@ -5396,12 +5396,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(1, 337, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_v_password)) { __Pyx_RaiseClosureNameError("password"); __PYX_ERR(1, 326, __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":336 + /* "ssh2/session.pyx":325 * cdef const char *_username = b_username * * def passwd(): # <<<<<<<<<<<<<< @@ -5419,7 +5419,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_28userauth_keyboardinteractive return __pyx_r; } -/* "ssh2/session.pyx":323 +/* "ssh2/session.pyx":312 * return handle_error_codes(rc) * * def userauth_keyboardinteractive(self, username not None, # <<<<<<<<<<<<<< @@ -5446,7 +5446,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(1, 323, __pyx_L1_error) + __PYX_ERR(1, 312, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } @@ -5454,19 +5454,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":333 + /* "ssh2/session.pyx":322 * """ * 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(1, 333, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_username); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_b_username = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/session.pyx":334 + /* "ssh2/session.pyx":323 * cdef int rc * cdef bytes b_username = to_bytes(username) * cdef const char *_username = b_username # <<<<<<<<<<<<<< @@ -5475,24 +5475,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(1, 334, __pyx_L1_error) + __PYX_ERR(1, 323, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyBytes_AsString(__pyx_v_b_username); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(1, 334, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_AsString(__pyx_v_b_username); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(1, 323, __pyx_L1_error) __pyx_v__username = __pyx_t_2; - /* "ssh2/session.pyx":336 + /* "ssh2/session.pyx":325 * 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__5)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 336, __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__5)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 325, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_passwd = __pyx_t_1; __pyx_t_1 = 0; - /* "ssh2/session.pyx":339 + /* "ssh2/session.pyx":328 * return password * * self._kbd_callback = passwd # <<<<<<<<<<<<<< @@ -5505,7 +5505,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":340 + /* "ssh2/session.pyx":329 * * self._kbd_callback = passwd * rc = c_ssh2.libssh2_userauth_keyboard_interactive( # <<<<<<<<<<<<<< @@ -5514,7 +5514,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":342 + /* "ssh2/session.pyx":331 * rc = c_ssh2.libssh2_userauth_keyboard_interactive( * self._session, _username, &kbd_callback) * self._kbd_callback = None # <<<<<<<<<<<<<< @@ -5527,7 +5527,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":343 + /* "ssh2/session.pyx":332 * self._session, _username, &kbd_callback) * self._kbd_callback = None * return handle_error_codes(rc) # <<<<<<<<<<<<<< @@ -5535,14 +5535,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(1, 343, __pyx_L1_error) - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 343, __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(1, 332, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 332, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":323 + /* "ssh2/session.pyx":312 * return handle_error_codes(rc) * * def userauth_keyboardinteractive(self, username not None, # <<<<<<<<<<<<<< @@ -5564,7 +5564,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_32userauth_keyboardinteractive return __pyx_r; } -/* "ssh2/session.pyx":345 +/* "ssh2/session.pyx":334 * return handle_error_codes(rc) * * def agent_init(self): # <<<<<<<<<<<<<< @@ -5597,7 +5597,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":351 + /* "ssh2/session.pyx":340 * """ * cdef c_ssh2.LIBSSH2_AGENT *agent * with nogil: # <<<<<<<<<<<<<< @@ -5612,18 +5612,18 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_34agent_init(struct __pyx_obj_ #endif /*try:*/ { - /* "ssh2/session.pyx":352 + /* "ssh2/session.pyx":341 * 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(1, 352, __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(1, 341, __pyx_L4_error) __pyx_v_agent = __pyx_t_1; } - /* "ssh2/session.pyx":351 + /* "ssh2/session.pyx":340 * """ * cdef c_ssh2.LIBSSH2_AGENT *agent * with nogil: # <<<<<<<<<<<<<< @@ -5649,7 +5649,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_34agent_init(struct __pyx_obj_ } } - /* "ssh2/session.pyx":353 + /* "ssh2/session.pyx":342 * with nogil: * agent = agent_init(self._session) * return PyAgent(agent, self) # <<<<<<<<<<<<<< @@ -5657,13 +5657,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(1, 353, __pyx_L1_error) + __pyx_t_2 = __pyx_f_4ssh2_5agent_PyAgent(__pyx_v_agent, __pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 342, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":345 + /* "ssh2/session.pyx":334 * return handle_error_codes(rc) * * def agent_init(self): # <<<<<<<<<<<<<< @@ -5682,7 +5682,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_34agent_init(struct __pyx_obj_ return __pyx_r; } -/* "ssh2/session.pyx":355 +/* "ssh2/session.pyx":344 * return PyAgent(agent, self) * * def agent_auth(self, username not None): # <<<<<<<<<<<<<< @@ -5701,7 +5701,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(1, 355, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "username"); __PYX_ERR(1, 344, __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)); @@ -5731,19 +5731,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":381 + /* "ssh2/session.pyx":370 * * :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(1, 381, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_username); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 370, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_b_username = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/session.pyx":382 + /* "ssh2/session.pyx":371 * :rtype: None""" * cdef bytes b_username = to_bytes(username) * cdef char *_username = b_username # <<<<<<<<<<<<<< @@ -5752,12 +5752,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(1, 382, __pyx_L1_error) + __PYX_ERR(1, 371, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_username); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(1, 382, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_username); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(1, 371, __pyx_L1_error) __pyx_v__username = __pyx_t_2; - /* "ssh2/session.pyx":383 + /* "ssh2/session.pyx":372 * cdef bytes b_username = to_bytes(username) * cdef char *_username = b_username * cdef c_ssh2.LIBSSH2_AGENT *agent = NULL # <<<<<<<<<<<<<< @@ -5766,7 +5766,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_36agent_auth(struct __pyx_obj_ */ __pyx_v_agent = NULL; - /* "ssh2/session.pyx":384 + /* "ssh2/session.pyx":373 * cdef char *_username = b_username * cdef c_ssh2.LIBSSH2_AGENT *agent = NULL * cdef c_ssh2.libssh2_agent_publickey *identity = NULL # <<<<<<<<<<<<<< @@ -5775,7 +5775,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_36agent_auth(struct __pyx_obj_ */ __pyx_v_identity = NULL; - /* "ssh2/session.pyx":385 + /* "ssh2/session.pyx":374 * cdef c_ssh2.LIBSSH2_AGENT *agent = NULL * cdef c_ssh2.libssh2_agent_publickey *identity = NULL * cdef c_ssh2.libssh2_agent_publickey *prev = NULL # <<<<<<<<<<<<<< @@ -5784,17 +5784,17 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_36agent_auth(struct __pyx_obj_ */ __pyx_v_prev = NULL; - /* "ssh2/session.pyx":386 + /* "ssh2/session.pyx":375 * 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(1, 386, __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(1, 375, __pyx_L1_error) __pyx_v_agent = __pyx_t_3; - /* "ssh2/session.pyx":387 + /* "ssh2/session.pyx":376 * cdef c_ssh2.libssh2_agent_publickey *prev = NULL * agent = init_connect_agent(self._session) * with nogil: # <<<<<<<<<<<<<< @@ -5809,17 +5809,17 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_36agent_auth(struct __pyx_obj_ #endif /*try:*/ { - /* "ssh2/session.pyx":388 + /* "ssh2/session.pyx":377 * 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(1, 388, __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(1, 377, __pyx_L4_error) } - /* "ssh2/session.pyx":387 + /* "ssh2/session.pyx":376 * cdef c_ssh2.libssh2_agent_publickey *prev = NULL * agent = init_connect_agent(self._session) * with nogil: # <<<<<<<<<<<<<< @@ -5845,7 +5845,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_36agent_auth(struct __pyx_obj_ } } - /* "ssh2/session.pyx":355 + /* "ssh2/session.pyx":344 * return PyAgent(agent, self) * * def agent_auth(self, username not None): # <<<<<<<<<<<<<< @@ -5867,7 +5867,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_36agent_auth(struct __pyx_obj_ return __pyx_r; } -/* "ssh2/session.pyx":390 +/* "ssh2/session.pyx":379 * agent_auth(_username, agent) * * def open_session(self): # <<<<<<<<<<<<<< @@ -5901,7 +5901,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":396 + /* "ssh2/session.pyx":385 * """ * cdef c_ssh2.LIBSSH2_CHANNEL *channel * with nogil: # <<<<<<<<<<<<<< @@ -5916,7 +5916,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_38open_session(struct __pyx_ob #endif /*try:*/ { - /* "ssh2/session.pyx":397 + /* "ssh2/session.pyx":386 * cdef c_ssh2.LIBSSH2_CHANNEL *channel * with nogil: * channel = c_ssh2.libssh2_channel_open_session( # <<<<<<<<<<<<<< @@ -5926,7 +5926,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":396 + /* "ssh2/session.pyx":385 * """ * cdef c_ssh2.LIBSSH2_CHANNEL *channel * with nogil: # <<<<<<<<<<<<<< @@ -5945,7 +5945,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_38open_session(struct __pyx_ob } } - /* "ssh2/session.pyx":399 + /* "ssh2/session.pyx":388 * channel = c_ssh2.libssh2_channel_open_session( * self._session) * if channel is NULL: # <<<<<<<<<<<<<< @@ -5955,7 +5955,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":400 + /* "ssh2/session.pyx":389 * self._session) * if channel is NULL: * return handle_error_codes(c_ssh2.libssh2_session_last_errno( # <<<<<<<<<<<<<< @@ -5964,29 +5964,29 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_38open_session(struct __pyx_ob */ __Pyx_XDECREF(__pyx_r); - /* "ssh2/session.pyx":401 + /* "ssh2/session.pyx":390 * 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(1, 400, __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(1, 389, __pyx_L1_error) - /* "ssh2/session.pyx":400 + /* "ssh2/session.pyx":389 * 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(1, 400, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":399 + /* "ssh2/session.pyx":388 * channel = c_ssh2.libssh2_channel_open_session( * self._session) * if channel is NULL: # <<<<<<<<<<<<<< @@ -5995,7 +5995,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_38open_session(struct __pyx_ob */ } - /* "ssh2/session.pyx":402 + /* "ssh2/session.pyx":391 * return handle_error_codes(c_ssh2.libssh2_session_last_errno( * self._session)) * return PyChannel(channel, self) # <<<<<<<<<<<<<< @@ -6003,13 +6003,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(1, 402, __pyx_L1_error) + __pyx_t_3 = __pyx_f_4ssh2_7channel_PyChannel(__pyx_v_channel, __pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 391, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":390 + /* "ssh2/session.pyx":379 * agent_auth(_username, agent) * * def open_session(self): # <<<<<<<<<<<<<< @@ -6028,7 +6028,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_38open_session(struct __pyx_ob return __pyx_r; } -/* "ssh2/session.pyx":404 +/* "ssh2/session.pyx":393 * return PyChannel(channel, self) * * def direct_tcpip_ex(self, host not None, int port, # <<<<<<<<<<<<<< @@ -6077,23 +6077,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(1, 404, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("direct_tcpip_ex", 1, 4, 4, 1); __PYX_ERR(1, 393, __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(1, 404, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("direct_tcpip_ex", 1, 4, 4, 2); __PYX_ERR(1, 393, __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(1, 404, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("direct_tcpip_ex", 1, 4, 4, 3); __PYX_ERR(1, 393, __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(1, 404, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "direct_tcpip_ex") < 0)) __PYX_ERR(1, 393, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; @@ -6104,23 +6104,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(1, 404, __pyx_L3_error) + __pyx_v_port = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_port == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 393, __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(1, 405, __pyx_L3_error) + __pyx_v_sport = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_sport == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 394, __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(1, 404, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("direct_tcpip_ex", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 393, __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(1, 404, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "host"); __PYX_ERR(1, 393, __pyx_L1_error) } if (unlikely(((PyObject *)__pyx_v_shost) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "shost"); __PYX_ERR(1, 405, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "shost"); __PYX_ERR(1, 394, __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); @@ -6150,31 +6150,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":407 + /* "ssh2/session.pyx":396 * 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(1, 407, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_host); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 396, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_b_host = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/session.pyx":408 + /* "ssh2/session.pyx":397 * 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(1, 408, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_shost); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 397, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_b_shost = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/session.pyx":409 + /* "ssh2/session.pyx":398 * cdef bytes b_host = to_bytes(host) * cdef bytes b_shost = to_bytes(shost) * cdef char *_host = b_host # <<<<<<<<<<<<<< @@ -6183,12 +6183,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(1, 409, __pyx_L1_error) + __PYX_ERR(1, 398, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_host); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(1, 409, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_host); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(1, 398, __pyx_L1_error) __pyx_v__host = __pyx_t_2; - /* "ssh2/session.pyx":410 + /* "ssh2/session.pyx":399 * cdef bytes b_shost = to_bytes(shost) * cdef char *_host = b_host * cdef char *_shost = b_shost # <<<<<<<<<<<<<< @@ -6197,12 +6197,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(1, 410, __pyx_L1_error) + __PYX_ERR(1, 399, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_shost); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(1, 410, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_shost); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(1, 399, __pyx_L1_error) __pyx_v__shost = __pyx_t_2; - /* "ssh2/session.pyx":411 + /* "ssh2/session.pyx":400 * cdef char *_host = b_host * cdef char *_shost = b_shost * with nogil: # <<<<<<<<<<<<<< @@ -6217,7 +6217,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_40direct_tcpip_ex(struct __pyx #endif /*try:*/ { - /* "ssh2/session.pyx":412 + /* "ssh2/session.pyx":401 * cdef char *_shost = b_shost * with nogil: * channel = c_ssh2.libssh2_channel_direct_tcpip_ex( # <<<<<<<<<<<<<< @@ -6227,7 +6227,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":411 + /* "ssh2/session.pyx":400 * cdef char *_host = b_host * cdef char *_shost = b_shost * with nogil: # <<<<<<<<<<<<<< @@ -6246,7 +6246,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_40direct_tcpip_ex(struct __pyx } } - /* "ssh2/session.pyx":414 + /* "ssh2/session.pyx":403 * channel = c_ssh2.libssh2_channel_direct_tcpip_ex( * self._session, _host, port, _shost, sport) * if channel is NULL: # <<<<<<<<<<<<<< @@ -6256,7 +6256,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":415 + /* "ssh2/session.pyx":404 * self._session, _host, port, _shost, sport) * if channel is NULL: * return handle_error_codes(c_ssh2.libssh2_session_last_errno( # <<<<<<<<<<<<<< @@ -6265,29 +6265,29 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_40direct_tcpip_ex(struct __pyx */ __Pyx_XDECREF(__pyx_r); - /* "ssh2/session.pyx":416 + /* "ssh2/session.pyx":405 * 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(1, 415, __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(1, 404, __pyx_L1_error) - /* "ssh2/session.pyx":415 + /* "ssh2/session.pyx":404 * 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(1, 415, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 404, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":414 + /* "ssh2/session.pyx":403 * channel = c_ssh2.libssh2_channel_direct_tcpip_ex( * self._session, _host, port, _shost, sport) * if channel is NULL: # <<<<<<<<<<<<<< @@ -6296,7 +6296,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_40direct_tcpip_ex(struct __pyx */ } - /* "ssh2/session.pyx":417 + /* "ssh2/session.pyx":406 * return handle_error_codes(c_ssh2.libssh2_session_last_errno( * self._session)) * return PyChannel(channel, self) # <<<<<<<<<<<<<< @@ -6304,13 +6304,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(1, 417, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_7channel_PyChannel(__pyx_v_channel, __pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 406, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":404 + /* "ssh2/session.pyx":393 * return PyChannel(channel, self) * * def direct_tcpip_ex(self, host not None, int port, # <<<<<<<<<<<<<< @@ -6331,7 +6331,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_40direct_tcpip_ex(struct __pyx return __pyx_r; } -/* "ssh2/session.pyx":419 +/* "ssh2/session.pyx":408 * return PyChannel(channel, self) * * def direct_tcpip(self, host not None, int port): # <<<<<<<<<<<<<< @@ -6374,11 +6374,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(1, 419, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("direct_tcpip", 1, 2, 2, 1); __PYX_ERR(1, 408, __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(1, 419, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "direct_tcpip") < 0)) __PYX_ERR(1, 408, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -6387,18 +6387,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(1, 419, __pyx_L3_error) + __pyx_v_port = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_port == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 408, __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(1, 419, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("direct_tcpip", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 408, __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(1, 419, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "host"); __PYX_ERR(1, 408, __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); @@ -6426,19 +6426,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":426 + /* "ssh2/session.pyx":415 * """ * 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(1, 426, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_host); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 415, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_b_host = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/session.pyx":427 + /* "ssh2/session.pyx":416 * cdef c_ssh2.LIBSSH2_CHANNEL *channel * cdef bytes b_host = to_bytes(host) * cdef char *_host = b_host # <<<<<<<<<<<<<< @@ -6447,12 +6447,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(1, 427, __pyx_L1_error) + __PYX_ERR(1, 416, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_host); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(1, 427, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_host); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(1, 416, __pyx_L1_error) __pyx_v__host = __pyx_t_2; - /* "ssh2/session.pyx":428 + /* "ssh2/session.pyx":417 * cdef bytes b_host = to_bytes(host) * cdef char *_host = b_host * with nogil: # <<<<<<<<<<<<<< @@ -6467,7 +6467,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_42direct_tcpip(struct __pyx_ob #endif /*try:*/ { - /* "ssh2/session.pyx":429 + /* "ssh2/session.pyx":418 * cdef char *_host = b_host * with nogil: * channel = c_ssh2.libssh2_channel_direct_tcpip( # <<<<<<<<<<<<<< @@ -6477,7 +6477,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":428 + /* "ssh2/session.pyx":417 * cdef bytes b_host = to_bytes(host) * cdef char *_host = b_host * with nogil: # <<<<<<<<<<<<<< @@ -6496,7 +6496,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_42direct_tcpip(struct __pyx_ob } } - /* "ssh2/session.pyx":431 + /* "ssh2/session.pyx":420 * channel = c_ssh2.libssh2_channel_direct_tcpip( * self._session, _host, port) * if channel is NULL: # <<<<<<<<<<<<<< @@ -6506,7 +6506,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":432 + /* "ssh2/session.pyx":421 * self._session, _host, port) * if channel is NULL: * return handle_error_codes(c_ssh2.libssh2_session_last_errno( # <<<<<<<<<<<<<< @@ -6515,29 +6515,29 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_42direct_tcpip(struct __pyx_ob */ __Pyx_XDECREF(__pyx_r); - /* "ssh2/session.pyx":433 + /* "ssh2/session.pyx":422 * 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(1, 432, __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(1, 421, __pyx_L1_error) - /* "ssh2/session.pyx":432 + /* "ssh2/session.pyx":421 * 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(1, 432, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 421, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":431 + /* "ssh2/session.pyx":420 * channel = c_ssh2.libssh2_channel_direct_tcpip( * self._session, _host, port) * if channel is NULL: # <<<<<<<<<<<<<< @@ -6546,7 +6546,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_42direct_tcpip(struct __pyx_ob */ } - /* "ssh2/session.pyx":434 + /* "ssh2/session.pyx":423 * return handle_error_codes(c_ssh2.libssh2_session_last_errno( * self._session)) * return PyChannel(channel, self) # <<<<<<<<<<<<<< @@ -6554,13 +6554,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(1, 434, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_7channel_PyChannel(__pyx_v_channel, __pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 423, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":419 + /* "ssh2/session.pyx":408 * return PyChannel(channel, self) * * def direct_tcpip(self, host not None, int port): # <<<<<<<<<<<<<< @@ -6580,7 +6580,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_42direct_tcpip(struct __pyx_ob return __pyx_r; } -/* "ssh2/session.pyx":436 +/* "ssh2/session.pyx":425 * return PyChannel(channel, self) * * def block_directions(self): # <<<<<<<<<<<<<< @@ -6612,7 +6612,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_44block_directions(struct __py int __pyx_clineno = 0; __Pyx_RefNannySetupContext("block_directions", 0); - /* "ssh2/session.pyx":458 + /* "ssh2/session.pyx":447 * :rtype: int""" * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -6627,7 +6627,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_44block_directions(struct __py #endif /*try:*/ { - /* "ssh2/session.pyx":459 + /* "ssh2/session.pyx":448 * cdef int rc * with nogil: * rc = c_ssh2.libssh2_session_block_directions( # <<<<<<<<<<<<<< @@ -6637,7 +6637,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":458 + /* "ssh2/session.pyx":447 * :rtype: int""" * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -6656,7 +6656,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_44block_directions(struct __py } } - /* "ssh2/session.pyx":461 + /* "ssh2/session.pyx":450 * rc = c_ssh2.libssh2_session_block_directions( * self._session) * return rc # <<<<<<<<<<<<<< @@ -6664,13 +6664,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(1, 461, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 450, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":436 + /* "ssh2/session.pyx":425 * return PyChannel(channel, self) * * def block_directions(self): # <<<<<<<<<<<<<< @@ -6689,7 +6689,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_44block_directions(struct __py return __pyx_r; } -/* "ssh2/session.pyx":463 +/* "ssh2/session.pyx":452 * return rc * * def forward_listen(self, int port): # <<<<<<<<<<<<<< @@ -6709,7 +6709,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(1, 463, __pyx_L3_error) + __pyx_v_port = __Pyx_PyInt_As_int(__pyx_arg_port); if (unlikely((__pyx_v_port == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 452, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -6736,7 +6736,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_46forward_listen(struct __pyx_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("forward_listen", 0); - /* "ssh2/session.pyx":471 + /* "ssh2/session.pyx":460 * :rtype: :py:class:`ssh2.listener.Listener` or None""" * cdef c_ssh2.LIBSSH2_LISTENER *listener * with nogil: # <<<<<<<<<<<<<< @@ -6751,7 +6751,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_46forward_listen(struct __pyx_ #endif /*try:*/ { - /* "ssh2/session.pyx":472 + /* "ssh2/session.pyx":461 * cdef c_ssh2.LIBSSH2_LISTENER *listener * with nogil: * listener = c_ssh2.libssh2_channel_forward_listen( # <<<<<<<<<<<<<< @@ -6761,7 +6761,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":471 + /* "ssh2/session.pyx":460 * :rtype: :py:class:`ssh2.listener.Listener` or None""" * cdef c_ssh2.LIBSSH2_LISTENER *listener * with nogil: # <<<<<<<<<<<<<< @@ -6780,7 +6780,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_46forward_listen(struct __pyx_ } } - /* "ssh2/session.pyx":474 + /* "ssh2/session.pyx":463 * listener = c_ssh2.libssh2_channel_forward_listen( * self._session, port) * if listener is NULL: # <<<<<<<<<<<<<< @@ -6790,7 +6790,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":475 + /* "ssh2/session.pyx":464 * self._session, port) * if listener is NULL: * return handle_error_codes(c_ssh2.libssh2_session_last_errno( # <<<<<<<<<<<<<< @@ -6799,29 +6799,29 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_46forward_listen(struct __pyx_ */ __Pyx_XDECREF(__pyx_r); - /* "ssh2/session.pyx":476 + /* "ssh2/session.pyx":465 * 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(1, 475, __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(1, 464, __pyx_L1_error) - /* "ssh2/session.pyx":475 + /* "ssh2/session.pyx":464 * 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(1, 475, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":474 + /* "ssh2/session.pyx":463 * listener = c_ssh2.libssh2_channel_forward_listen( * self._session, port) * if listener is NULL: # <<<<<<<<<<<<<< @@ -6830,7 +6830,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_46forward_listen(struct __pyx_ */ } - /* "ssh2/session.pyx":477 + /* "ssh2/session.pyx":466 * return handle_error_codes(c_ssh2.libssh2_session_last_errno( * self._session)) * return PyListener(listener, self) # <<<<<<<<<<<<<< @@ -6838,13 +6838,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(1, 477, __pyx_L1_error) + __pyx_t_3 = __pyx_f_4ssh2_8listener_PyListener(__pyx_v_listener, __pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":463 + /* "ssh2/session.pyx":452 * return rc * * def forward_listen(self, int port): # <<<<<<<<<<<<<< @@ -6863,7 +6863,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_46forward_listen(struct __pyx_ return __pyx_r; } -/* "ssh2/session.pyx":479 +/* "ssh2/session.pyx":468 * return PyListener(listener, self) * * def forward_listen_ex(self, int queue_maxsize, host=None, int port=0): # <<<<<<<<<<<<<< @@ -6920,7 +6920,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(1, 479, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "forward_listen_ex") < 0)) __PYX_ERR(1, 468, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -6933,17 +6933,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(1, 479, __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(1, 468, __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(1, 479, __pyx_L3_error) + __pyx_v_port = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_port == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 468, __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(1, 479, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("forward_listen_ex", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 468, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.session.Session.forward_listen_ex", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -6975,7 +6975,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":502 + /* "ssh2/session.pyx":491 * """ * cdef c_ssh2.LIBSSH2_LISTENER *listener * cdef bytes b_host = None if host is None else to_bytes(host) # <<<<<<<<<<<<<< @@ -6987,7 +6987,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(1, 502, __pyx_L1_error) + __pyx_t_3 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_host); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 491, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; @@ -6995,7 +6995,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":503 + /* "ssh2/session.pyx":492 * cdef c_ssh2.LIBSSH2_LISTENER *listener * cdef bytes b_host = None if host is None else to_bytes(host) * cdef char *_host = NULL # <<<<<<<<<<<<<< @@ -7004,7 +7004,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_48forward_listen_ex(struct __p */ __pyx_v__host = NULL; - /* "ssh2/session.pyx":504 + /* "ssh2/session.pyx":493 * cdef bytes b_host = None if host is None else to_bytes(host) * cdef char *_host = NULL * if b_host is not None: # <<<<<<<<<<<<<< @@ -7015,7 +7015,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":505 + /* "ssh2/session.pyx":494 * cdef char *_host = NULL * if b_host is not None: * _host = b_host # <<<<<<<<<<<<<< @@ -7024,12 +7024,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(1, 505, __pyx_L1_error) + __PYX_ERR(1, 494, __pyx_L1_error) } - __pyx_t_5 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_host); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) __PYX_ERR(1, 505, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_host); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) __PYX_ERR(1, 494, __pyx_L1_error) __pyx_v__host = __pyx_t_5; - /* "ssh2/session.pyx":504 + /* "ssh2/session.pyx":493 * cdef bytes b_host = None if host is None else to_bytes(host) * cdef char *_host = NULL * if b_host is not None: # <<<<<<<<<<<<<< @@ -7038,7 +7038,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_48forward_listen_ex(struct __p */ } - /* "ssh2/session.pyx":506 + /* "ssh2/session.pyx":495 * if b_host is not None: * _host = b_host * cdef int bound_port = 0 # <<<<<<<<<<<<<< @@ -7047,7 +7047,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_48forward_listen_ex(struct __p */ __pyx_v_bound_port = 0; - /* "ssh2/session.pyx":507 + /* "ssh2/session.pyx":496 * _host = b_host * cdef int bound_port = 0 * with nogil: # <<<<<<<<<<<<<< @@ -7062,7 +7062,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_48forward_listen_ex(struct __p #endif /*try:*/ { - /* "ssh2/session.pyx":508 + /* "ssh2/session.pyx":497 * cdef int bound_port = 0 * with nogil: * listener = c_ssh2.libssh2_channel_forward_listen_ex( # <<<<<<<<<<<<<< @@ -7072,7 +7072,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":507 + /* "ssh2/session.pyx":496 * _host = b_host * cdef int bound_port = 0 * with nogil: # <<<<<<<<<<<<<< @@ -7091,7 +7091,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_48forward_listen_ex(struct __p } } - /* "ssh2/session.pyx":510 + /* "ssh2/session.pyx":499 * listener = c_ssh2.libssh2_channel_forward_listen_ex( * self._session, _host, port, &bound_port, queue_maxsize) * if listener is NULL: # <<<<<<<<<<<<<< @@ -7101,7 +7101,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":511 + /* "ssh2/session.pyx":500 * self._session, _host, port, &bound_port, queue_maxsize) * if listener is NULL: * return (handle_error_codes(c_ssh2.libssh2_session_last_errno( # <<<<<<<<<<<<<< @@ -7110,25 +7110,25 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_48forward_listen_ex(struct __p */ __Pyx_XDECREF(__pyx_r); - /* "ssh2/session.pyx":512 + /* "ssh2/session.pyx":501 * 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(1, 511, __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(1, 500, __pyx_L1_error) - /* "ssh2/session.pyx":511 + /* "ssh2/session.pyx":500 * 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(1, 511, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 500, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 511, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 500, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); @@ -7140,7 +7140,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_48forward_listen_ex(struct __p __pyx_t_3 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":510 + /* "ssh2/session.pyx":499 * listener = c_ssh2.libssh2_channel_forward_listen_ex( * self._session, _host, port, &bound_port, queue_maxsize) * if listener is NULL: # <<<<<<<<<<<<<< @@ -7149,7 +7149,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_48forward_listen_ex(struct __p */ } - /* "ssh2/session.pyx":513 + /* "ssh2/session.pyx":502 * return (handle_error_codes(c_ssh2.libssh2_session_last_errno( * self._session)), 0) * return (PyListener(listener, self), bound_port) # <<<<<<<<<<<<<< @@ -7157,11 +7157,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(1, 513, __pyx_L1_error) + __pyx_t_3 = __pyx_f_4ssh2_8listener_PyListener(__pyx_v_listener, __pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 502, __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(1, 513, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_bound_port); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 502, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 513, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 502, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); @@ -7173,7 +7173,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_48forward_listen_ex(struct __p __pyx_t_7 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":479 + /* "ssh2/session.pyx":468 * return PyListener(listener, self) * * def forward_listen_ex(self, int queue_maxsize, host=None, int port=0): # <<<<<<<<<<<<<< @@ -7195,7 +7195,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_48forward_listen_ex(struct __p return __pyx_r; } -/* "ssh2/session.pyx":515 +/* "ssh2/session.pyx":504 * return (PyListener(listener, self), bound_port) * * def sftp_init(self): # <<<<<<<<<<<<<< @@ -7229,7 +7229,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":521 + /* "ssh2/session.pyx":510 * """ * cdef c_sftp.LIBSSH2_SFTP *_sftp * with nogil: # <<<<<<<<<<<<<< @@ -7244,7 +7244,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_50sftp_init(struct __pyx_obj_4 #endif /*try:*/ { - /* "ssh2/session.pyx":522 + /* "ssh2/session.pyx":511 * cdef c_sftp.LIBSSH2_SFTP *_sftp * with nogil: * _sftp = c_sftp.libssh2_sftp_init(self._session) # <<<<<<<<<<<<<< @@ -7254,7 +7254,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":521 + /* "ssh2/session.pyx":510 * """ * cdef c_sftp.LIBSSH2_SFTP *_sftp * with nogil: # <<<<<<<<<<<<<< @@ -7273,7 +7273,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_50sftp_init(struct __pyx_obj_4 } } - /* "ssh2/session.pyx":523 + /* "ssh2/session.pyx":512 * with nogil: * _sftp = c_sftp.libssh2_sftp_init(self._session) * if _sftp is NULL: # <<<<<<<<<<<<<< @@ -7283,7 +7283,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":524 + /* "ssh2/session.pyx":513 * _sftp = c_sftp.libssh2_sftp_init(self._session) * if _sftp is NULL: * return handle_error_codes(c_ssh2.libssh2_session_last_errno( # <<<<<<<<<<<<<< @@ -7292,29 +7292,29 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_50sftp_init(struct __pyx_obj_4 */ __Pyx_XDECREF(__pyx_r); - /* "ssh2/session.pyx":525 + /* "ssh2/session.pyx":514 * 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(1, 524, __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(1, 513, __pyx_L1_error) - /* "ssh2/session.pyx":524 + /* "ssh2/session.pyx":513 * _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(1, 524, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 513, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":523 + /* "ssh2/session.pyx":512 * with nogil: * _sftp = c_sftp.libssh2_sftp_init(self._session) * if _sftp is NULL: # <<<<<<<<<<<<<< @@ -7323,7 +7323,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_50sftp_init(struct __pyx_obj_4 */ } - /* "ssh2/session.pyx":526 + /* "ssh2/session.pyx":515 * return handle_error_codes(c_ssh2.libssh2_session_last_errno( * self._session)) * return PySFTP(_sftp, self) # <<<<<<<<<<<<<< @@ -7331,13 +7331,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(1, 526, __pyx_L1_error) + __pyx_t_3 = __pyx_f_4ssh2_4sftp_PySFTP(__pyx_v__sftp, __pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 515, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":515 + /* "ssh2/session.pyx":504 * return (PyListener(listener, self), bound_port) * * def sftp_init(self): # <<<<<<<<<<<<<< @@ -7356,7 +7356,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_50sftp_init(struct __pyx_obj_4 return __pyx_r; } -/* "ssh2/session.pyx":528 +/* "ssh2/session.pyx":517 * return PySFTP(_sftp, self) * * def last_error(self, size_t msg_size=1024): # <<<<<<<<<<<<<< @@ -7396,7 +7396,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(1, 528, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "last_error") < 0)) __PYX_ERR(1, 517, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -7407,14 +7407,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(1, 528, __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(1, 517, __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(1, 528, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("last_error", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 517, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.session.Session.last_error", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -7449,7 +7449,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":535 + /* "ssh2/session.pyx":524 * """ * cdef char *_error_msg * cdef bytes msg = b'' # <<<<<<<<<<<<<< @@ -7459,7 +7459,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_52last_error(struct __pyx_obj_ __Pyx_INCREF(__pyx_kp_b__4); __pyx_v_msg = __pyx_kp_b__4; - /* "ssh2/session.pyx":536 + /* "ssh2/session.pyx":525 * cdef char *_error_msg * cdef bytes msg = b'' * cdef int errmsg_len = 0 # <<<<<<<<<<<<<< @@ -7468,7 +7468,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_52last_error(struct __pyx_obj_ */ __pyx_v_errmsg_len = 0; - /* "ssh2/session.pyx":537 + /* "ssh2/session.pyx":526 * cdef bytes msg = b'' * cdef int errmsg_len = 0 * with nogil: # <<<<<<<<<<<<<< @@ -7483,7 +7483,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_52last_error(struct __pyx_obj_ #endif /*try:*/ { - /* "ssh2/session.pyx":538 + /* "ssh2/session.pyx":527 * cdef int errmsg_len = 0 * with nogil: * _error_msg = malloc(sizeof(char) * msg_size) # <<<<<<<<<<<<<< @@ -7492,7 +7492,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":539 + /* "ssh2/session.pyx":528 * with nogil: * _error_msg = malloc(sizeof(char) * msg_size) * c_ssh2.libssh2_session_last_error( # <<<<<<<<<<<<<< @@ -7502,7 +7502,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":537 + /* "ssh2/session.pyx":526 * cdef bytes msg = b'' * cdef int errmsg_len = 0 * with nogil: # <<<<<<<<<<<<<< @@ -7521,7 +7521,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_52last_error(struct __pyx_obj_ } } - /* "ssh2/session.pyx":541 + /* "ssh2/session.pyx":530 * c_ssh2.libssh2_session_last_error( * self._session, &_error_msg, &errmsg_len, 1) * try: # <<<<<<<<<<<<<< @@ -7530,7 +7530,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_52last_error(struct __pyx_obj_ */ /*try:*/ { - /* "ssh2/session.pyx":542 + /* "ssh2/session.pyx":531 * self._session, &_error_msg, &errmsg_len, 1) * try: * if errmsg_len > 0: # <<<<<<<<<<<<<< @@ -7540,19 +7540,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":543 + /* "ssh2/session.pyx":532 * 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(1, 543, __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(1, 532, __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":542 + /* "ssh2/session.pyx":531 * self._session, &_error_msg, &errmsg_len, 1) * try: * if errmsg_len > 0: # <<<<<<<<<<<<<< @@ -7561,7 +7561,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_52last_error(struct __pyx_obj_ */ } - /* "ssh2/session.pyx":544 + /* "ssh2/session.pyx":533 * if errmsg_len > 0: * msg = _error_msg[:errmsg_len] * return msg # <<<<<<<<<<<<<< @@ -7574,7 +7574,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_52last_error(struct __pyx_obj_ goto __pyx_L6_return; } - /* "ssh2/session.pyx":546 + /* "ssh2/session.pyx":535 * return msg * finally: * free(_error_msg) # <<<<<<<<<<<<<< @@ -7624,7 +7624,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_52last_error(struct __pyx_obj_ } } - /* "ssh2/session.pyx":528 + /* "ssh2/session.pyx":517 * return PySFTP(_sftp, self) * * def last_error(self, size_t msg_size=1024): # <<<<<<<<<<<<<< @@ -7644,7 +7644,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_52last_error(struct __pyx_obj_ return __pyx_r; } -/* "ssh2/session.pyx":548 +/* "ssh2/session.pyx":537 * free(_error_msg) * * def last_errno(self): # <<<<<<<<<<<<<< @@ -7676,7 +7676,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":555 + /* "ssh2/session.pyx":544 * """ * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -7691,7 +7691,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_54last_errno(struct __pyx_obj_ #endif /*try:*/ { - /* "ssh2/session.pyx":556 + /* "ssh2/session.pyx":545 * cdef int rc * with nogil: * rc = c_ssh2.libssh2_session_last_errno( # <<<<<<<<<<<<<< @@ -7701,7 +7701,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":555 + /* "ssh2/session.pyx":544 * """ * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -7720,21 +7720,21 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_54last_errno(struct __pyx_obj_ } } - /* "ssh2/session.pyx":558 + /* "ssh2/session.pyx":547 * rc = c_ssh2.libssh2_session_last_errno( * self._session) * return rc # <<<<<<<<<<<<<< * - * IF EMBEDDED_LIB: + * def set_last_error(self, int errcode, errmsg not None): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 558, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 547, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":548 + /* "ssh2/session.pyx":537 * free(_error_msg) * * def last_errno(self): # <<<<<<<<<<<<<< @@ -7753,12 +7753,12 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_54last_errno(struct __pyx_obj_ return __pyx_r; } -/* "ssh2/session.pyx":561 +/* "ssh2/session.pyx":549 + * return rc * - * 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 + * def set_last_error(self, int errcode, errmsg not None): # <<<<<<<<<<<<<< + * cdef bytes b_errmsg = to_bytes(errmsg) + * cdef char *_errmsg = b_errmsg */ /* Python wrapper */ @@ -7796,11 +7796,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(1, 561, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("set_last_error", 1, 2, 2, 1); __PYX_ERR(1, 549, __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(1, 561, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_last_error") < 0)) __PYX_ERR(1, 549, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -7808,19 +7808,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(1, 561, __pyx_L3_error) + __pyx_v_errcode = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_errcode == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 549, __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(1, 561, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("set_last_error", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 549, __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(1, 561, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "errmsg"); __PYX_ERR(1, 549, __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); @@ -7846,38 +7846,38 @@ 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":562 - * 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 + /* "ssh2/session.pyx":550 + * + * 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(1, 562, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_errmsg); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_b_errmsg = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/session.pyx":563 - * 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 - * with nogil: + /* "ssh2/session.pyx":551 + * 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 + * with nogil: */ if (unlikely(__pyx_v_b_errmsg == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(1, 563, __pyx_L1_error) + __PYX_ERR(1, 551, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_errmsg); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(1, 563, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_errmsg); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(1, 551, __pyx_L1_error) __pyx_v__errmsg = __pyx_t_2; - /* "ssh2/session.pyx":565 - * cdef char *_errmsg = b_errmsg - * cdef int rc - * with nogil: # <<<<<<<<<<<<<< - * rc = c_ssh2.libssh2_session_set_last_error( - * self._session, errcode, _errmsg) + /* "ssh2/session.pyx":553 + * cdef char *_errmsg = b_errmsg + * cdef int rc + * with nogil: # <<<<<<<<<<<<<< + * rc = c_ssh2.libssh2_session_set_last_error( + * self._session, errcode, _errmsg) */ { #ifdef WITH_THREAD @@ -7887,22 +7887,22 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_56set_last_error(struct __pyx_ #endif /*try:*/ { - /* "ssh2/session.pyx":566 - * cdef int rc - * with nogil: - * rc = c_ssh2.libssh2_session_set_last_error( # <<<<<<<<<<<<<< - * self._session, errcode, _errmsg) - * return rc + /* "ssh2/session.pyx":554 + * cdef int rc + * with nogil: + * rc = c_ssh2.libssh2_session_set_last_error( # <<<<<<<<<<<<<< + * self._session, errcode, _errmsg) + * return rc */ __pyx_v_rc = libssh2_session_set_last_error(__pyx_v_self->_session, __pyx_v_errcode, __pyx_v__errmsg); } - /* "ssh2/session.pyx":565 - * cdef char *_errmsg = b_errmsg - * cdef int rc - * with nogil: # <<<<<<<<<<<<<< - * rc = c_ssh2.libssh2_session_set_last_error( - * self._session, errcode, _errmsg) + /* "ssh2/session.pyx":553 + * cdef char *_errmsg = b_errmsg + * cdef int rc + * with nogil: # <<<<<<<<<<<<<< + * rc = c_ssh2.libssh2_session_set_last_error( + * self._session, errcode, _errmsg) */ /*finally:*/ { /*normal exit:*/{ @@ -7916,26 +7916,26 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_56set_last_error(struct __pyx_ } } - /* "ssh2/session.pyx":568 - * rc = c_ssh2.libssh2_session_set_last_error( - * self._session, errcode, _errmsg) - * return rc # <<<<<<<<<<<<<< + /* "ssh2/session.pyx":556 + * rc = c_ssh2.libssh2_session_set_last_error( + * self._session, errcode, _errmsg) + * return rc # <<<<<<<<<<<<<< * * 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(1, 568, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 556, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":561 + /* "ssh2/session.pyx":549 + * return rc * - * 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 + * def set_last_error(self, int errcode, errmsg not None): # <<<<<<<<<<<<<< + * cdef bytes b_errmsg = to_bytes(errmsg) + * cdef char *_errmsg = b_errmsg */ /* function exit code */ @@ -7950,8 +7950,8 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_56set_last_error(struct __pyx_ return __pyx_r; } -/* "ssh2/session.pyx":570 - * return rc +/* "ssh2/session.pyx":558 + * return rc * * def scp_recv(self, path not None): # <<<<<<<<<<<<<< * """Receive file via SCP. @@ -7969,7 +7969,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(1, 570, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "path"); __PYX_ERR(1, 558, __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)); @@ -7999,19 +7999,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":580 + /* "ssh2/session.pyx":568 * :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(1, 580, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_b_path = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/session.pyx":581 + /* "ssh2/session.pyx":569 * :py:class:`ssh2.statinfo.StatInfo`) or None""" * cdef bytes b_path = to_bytes(path) * cdef char *_path = b_path # <<<<<<<<<<<<<< @@ -8020,24 +8020,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(1, 581, __pyx_L1_error) + __PYX_ERR(1, 569, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_path); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(1, 581, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_path); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(1, 569, __pyx_L1_error) __pyx_v__path = __pyx_t_2; - /* "ssh2/session.pyx":582 + /* "ssh2/session.pyx":570 * 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(1, 582, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_4ssh2_8statinfo_StatInfo)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 570, __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":584 + /* "ssh2/session.pyx":572 * cdef StatInfo statinfo = StatInfo() * cdef c_ssh2.LIBSSH2_CHANNEL *channel * with nogil: # <<<<<<<<<<<<<< @@ -8052,7 +8052,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_58scp_recv(struct __pyx_obj_4s #endif /*try:*/ { - /* "ssh2/session.pyx":585 + /* "ssh2/session.pyx":573 * cdef c_ssh2.LIBSSH2_CHANNEL *channel * with nogil: * channel = c_ssh2.libssh2_scp_recv( # <<<<<<<<<<<<<< @@ -8062,7 +8062,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":584 + /* "ssh2/session.pyx":572 * cdef StatInfo statinfo = StatInfo() * cdef c_ssh2.LIBSSH2_CHANNEL *channel * with nogil: # <<<<<<<<<<<<<< @@ -8081,7 +8081,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_58scp_recv(struct __pyx_obj_4s } } - /* "ssh2/session.pyx":587 + /* "ssh2/session.pyx":575 * channel = c_ssh2.libssh2_scp_recv( * self._session, _path, statinfo._stat) * if channel is NULL: # <<<<<<<<<<<<<< @@ -8091,7 +8091,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":588 + /* "ssh2/session.pyx":576 * self._session, _path, statinfo._stat) * if channel is NULL: * return handle_error_codes(c_ssh2.libssh2_session_last_errno( # <<<<<<<<<<<<<< @@ -8100,29 +8100,29 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_58scp_recv(struct __pyx_obj_4s */ __Pyx_XDECREF(__pyx_r); - /* "ssh2/session.pyx":589 + /* "ssh2/session.pyx":577 * 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(1, 588, __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(1, 576, __pyx_L1_error) - /* "ssh2/session.pyx":588 + /* "ssh2/session.pyx":576 * 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(1, 588, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 576, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":587 + /* "ssh2/session.pyx":575 * channel = c_ssh2.libssh2_scp_recv( * self._session, _path, statinfo._stat) * if channel is NULL: # <<<<<<<<<<<<<< @@ -8131,17 +8131,17 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_58scp_recv(struct __pyx_obj_4s */ } - /* "ssh2/session.pyx":590 + /* "ssh2/session.pyx":578 * return handle_error_codes(c_ssh2.libssh2_session_last_errno( * self._session)) * return PyChannel(channel, self), statinfo # <<<<<<<<<<<<<< * - * IF EMBEDDED_LIB: + * def scp_recv2(self, path not None): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_4ssh2_7channel_PyChannel(__pyx_v_channel, __pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 590, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_7channel_PyChannel(__pyx_v_channel, __pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 578, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 590, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 578, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); @@ -8153,8 +8153,8 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_58scp_recv(struct __pyx_obj_4s __pyx_t_5 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":570 - * return rc + /* "ssh2/session.pyx":558 + * return rc * * def scp_recv(self, path not None): # <<<<<<<<<<<<<< * """Receive file via SCP. @@ -8175,17 +8175,17 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_58scp_recv(struct __pyx_obj_4s return __pyx_r; } -/* "ssh2/session.pyx":593 +/* "ssh2/session.pyx":580 + * return PyChannel(channel, self), statinfo * - * IF EMBEDDED_LIB: - * def scp_recv2(self, path not None): # <<<<<<<<<<<<<< - * """Receive file via SCP. + * def scp_recv2(self, path not None): # <<<<<<<<<<<<<< + * """Receive file via SCP. * */ /* Python wrapper */ static PyObject *__pyx_pw_4ssh2_7session_7Session_61scp_recv2(PyObject *__pyx_v_self, PyObject *__pyx_v_path); /*proto*/ -static char __pyx_doc_4ssh2_7session_7Session_60scp_recv2[] = "Session.scp_recv2(self, path)\nReceive file via SCP.\n\n Available only on libssh2 >= 1.7.\n\n :param path: File path to receive.\n :type path: str\n\n :rtype: tuple(:py:class:`ssh2.channel.Channel`,\n :py:class:`ssh2.fileinfo.FileInfo`) or ``None``"; +static char __pyx_doc_4ssh2_7session_7Session_60scp_recv2[] = "Session.scp_recv2(self, path)\nReceive file via SCP.\n\n :param path: File path to receive.\n :type path: str\n\n :rtype: tuple(:py:class:`ssh2.channel.Channel`,\n :py:class:`ssh2.fileinfo.FileInfo`) or ``None``"; static PyObject *__pyx_pw_4ssh2_7session_7Session_61scp_recv2(PyObject *__pyx_v_self, PyObject *__pyx_v_path) { int __pyx_lineno = 0; const char *__pyx_filename = NULL; @@ -8194,7 +8194,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(1, 593, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "path"); __PYX_ERR(1, 580, __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)); @@ -8224,50 +8224,50 @@ 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":603 - * :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 + /* "ssh2/session.pyx":588 + * :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(1, 603, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_4ssh2_8fileinfo_FileInfo)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 588, __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":604 - * :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 + /* "ssh2/session.pyx":589 + * :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(1, 604, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 589, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_b_path = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/session.pyx":605 - * cdef FileInfo fileinfo = FileInfo() - * cdef bytes b_path = to_bytes(path) - * cdef char *_path = b_path # <<<<<<<<<<<<<< - * cdef c_ssh2.LIBSSH2_CHANNEL *channel - * with nogil: + /* "ssh2/session.pyx":590 + * cdef FileInfo fileinfo = FileInfo() + * cdef bytes b_path = to_bytes(path) + * cdef char *_path = b_path # <<<<<<<<<<<<<< + * cdef c_ssh2.LIBSSH2_CHANNEL *channel + * with nogil: */ if (unlikely(__pyx_v_b_path == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(1, 605, __pyx_L1_error) + __PYX_ERR(1, 590, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_path); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(1, 605, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_path); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(1, 590, __pyx_L1_error) __pyx_v__path = __pyx_t_2; - /* "ssh2/session.pyx":607 - * cdef char *_path = b_path - * cdef c_ssh2.LIBSSH2_CHANNEL *channel - * with nogil: # <<<<<<<<<<<<<< - * channel = c_ssh2.libssh2_scp_recv2( - * self._session, _path, fileinfo._stat) + /* "ssh2/session.pyx":592 + * cdef char *_path = b_path + * cdef c_ssh2.LIBSSH2_CHANNEL *channel + * with nogil: # <<<<<<<<<<<<<< + * channel = c_ssh2.libssh2_scp_recv2( + * self._session, _path, fileinfo._stat) */ { #ifdef WITH_THREAD @@ -8277,22 +8277,22 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_60scp_recv2(struct __pyx_obj_4 #endif /*try:*/ { - /* "ssh2/session.pyx":608 - * cdef c_ssh2.LIBSSH2_CHANNEL *channel - * with nogil: - * channel = c_ssh2.libssh2_scp_recv2( # <<<<<<<<<<<<<< - * self._session, _path, fileinfo._stat) - * if channel is NULL: + /* "ssh2/session.pyx":593 + * cdef c_ssh2.LIBSSH2_CHANNEL *channel + * with nogil: + * channel = c_ssh2.libssh2_scp_recv2( # <<<<<<<<<<<<<< + * self._session, _path, fileinfo._stat) + * if channel is NULL: */ __pyx_v_channel = libssh2_scp_recv2(__pyx_v_self->_session, __pyx_v__path, __pyx_v_fileinfo->_stat); } - /* "ssh2/session.pyx":607 - * cdef char *_path = b_path - * cdef c_ssh2.LIBSSH2_CHANNEL *channel - * with nogil: # <<<<<<<<<<<<<< - * channel = c_ssh2.libssh2_scp_recv2( - * self._session, _path, fileinfo._stat) + /* "ssh2/session.pyx":592 + * cdef char *_path = b_path + * cdef c_ssh2.LIBSSH2_CHANNEL *channel + * with nogil: # <<<<<<<<<<<<<< + * channel = c_ssh2.libssh2_scp_recv2( + * self._session, _path, fileinfo._stat) */ /*finally:*/ { /*normal exit:*/{ @@ -8306,67 +8306,67 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_60scp_recv2(struct __pyx_obj_4 } } - /* "ssh2/session.pyx":610 - * channel = c_ssh2.libssh2_scp_recv2( - * self._session, _path, fileinfo._stat) - * if channel is NULL: # <<<<<<<<<<<<<< - * return handle_error_codes(c_ssh2.libssh2_session_last_errno( - * self._session)) + /* "ssh2/session.pyx":595 + * channel = c_ssh2.libssh2_scp_recv2( + * self._session, _path, fileinfo._stat) + * if channel is NULL: # <<<<<<<<<<<<<< + * return handle_error_codes(c_ssh2.libssh2_session_last_errno( + * self._session)) */ __pyx_t_3 = ((__pyx_v_channel == NULL) != 0); if (__pyx_t_3) { - /* "ssh2/session.pyx":611 - * 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 + /* "ssh2/session.pyx":596 + * 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_XDECREF(__pyx_r); - /* "ssh2/session.pyx":612 - * if channel is NULL: - * return handle_error_codes(c_ssh2.libssh2_session_last_errno( - * self._session)) # <<<<<<<<<<<<<< - * return PyChannel(channel, self), fileinfo + /* "ssh2/session.pyx":597 + * 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(1, 611, __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(1, 596, __pyx_L1_error) - /* "ssh2/session.pyx":611 - * 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 + /* "ssh2/session.pyx":596 + * 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(1, 611, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 596, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":610 - * channel = c_ssh2.libssh2_scp_recv2( - * self._session, _path, fileinfo._stat) - * if channel is NULL: # <<<<<<<<<<<<<< - * return handle_error_codes(c_ssh2.libssh2_session_last_errno( - * self._session)) + /* "ssh2/session.pyx":595 + * channel = c_ssh2.libssh2_scp_recv2( + * self._session, _path, fileinfo._stat) + * if channel is NULL: # <<<<<<<<<<<<<< + * return handle_error_codes(c_ssh2.libssh2_session_last_errno( + * self._session)) */ } - /* "ssh2/session.pyx":613 - * return handle_error_codes(c_ssh2.libssh2_session_last_errno( - * self._session)) - * return PyChannel(channel, self), fileinfo # <<<<<<<<<<<<<< + /* "ssh2/session.pyx":598 + * return handle_error_codes(c_ssh2.libssh2_session_last_errno( + * self._session)) + * return PyChannel(channel, self), fileinfo # <<<<<<<<<<<<<< * * 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(1, 613, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_7channel_PyChannel(__pyx_v_channel, __pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 613, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); @@ -8378,11 +8378,11 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_60scp_recv2(struct __pyx_obj_4 __pyx_t_5 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":593 + /* "ssh2/session.pyx":580 + * return PyChannel(channel, self), statinfo * - * IF EMBEDDED_LIB: - * def scp_recv2(self, path not None): # <<<<<<<<<<<<<< - * """Receive file via SCP. + * def scp_recv2(self, path not None): # <<<<<<<<<<<<<< + * """Receive file via SCP. * */ @@ -8400,8 +8400,8 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_60scp_recv2(struct __pyx_obj_4 return __pyx_r; } -/* "ssh2/session.pyx":615 - * return PyChannel(channel, self), fileinfo +/* "ssh2/session.pyx":600 + * return PyChannel(channel, self), fileinfo * * def scp_send(self, path not None, int mode, size_t size): # <<<<<<<<<<<<<< * """Deprecated in favour of scp_send64. Send file via SCP. @@ -8446,17 +8446,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(1, 615, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("scp_send", 1, 3, 3, 1); __PYX_ERR(1, 600, __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(1, 615, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("scp_send", 1, 3, 3, 2); __PYX_ERR(1, 600, __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(1, 615, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "scp_send") < 0)) __PYX_ERR(1, 600, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -8466,19 +8466,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(1, 615, __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(1, 615, __pyx_L3_error) + __pyx_v_mode = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_mode == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 600, __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(1, 600, __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(1, 615, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("scp_send", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 600, __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(1, 615, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "path"); __PYX_ERR(1, 600, __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); @@ -8506,19 +8506,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":626 + /* "ssh2/session.pyx":611 * * :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(1, 626, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 611, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_b_path = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/session.pyx":627 + /* "ssh2/session.pyx":612 * :rtype: :py:class:`ssh2.channel.Channel`""" * cdef bytes b_path = to_bytes(path) * cdef char *_path = b_path # <<<<<<<<<<<<<< @@ -8527,12 +8527,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(1, 627, __pyx_L1_error) + __PYX_ERR(1, 612, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_path); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(1, 627, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_path); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(1, 612, __pyx_L1_error) __pyx_v__path = __pyx_t_2; - /* "ssh2/session.pyx":629 + /* "ssh2/session.pyx":614 * cdef char *_path = b_path * cdef c_ssh2.LIBSSH2_CHANNEL *channel * with nogil: # <<<<<<<<<<<<<< @@ -8547,7 +8547,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_62scp_send(struct __pyx_obj_4s #endif /*try:*/ { - /* "ssh2/session.pyx":630 + /* "ssh2/session.pyx":615 * cdef c_ssh2.LIBSSH2_CHANNEL *channel * with nogil: * channel = c_ssh2.libssh2_scp_send( # <<<<<<<<<<<<<< @@ -8557,7 +8557,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":629 + /* "ssh2/session.pyx":614 * cdef char *_path = b_path * cdef c_ssh2.LIBSSH2_CHANNEL *channel * with nogil: # <<<<<<<<<<<<<< @@ -8576,7 +8576,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_62scp_send(struct __pyx_obj_4s } } - /* "ssh2/session.pyx":632 + /* "ssh2/session.pyx":617 * channel = c_ssh2.libssh2_scp_send( * self._session, _path, mode, size) * if channel is NULL: # <<<<<<<<<<<<<< @@ -8586,7 +8586,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":633 + /* "ssh2/session.pyx":618 * self._session, _path, mode, size) * if channel is NULL: * return handle_error_codes(c_ssh2.libssh2_session_last_errno( # <<<<<<<<<<<<<< @@ -8595,29 +8595,29 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_62scp_send(struct __pyx_obj_4s */ __Pyx_XDECREF(__pyx_r); - /* "ssh2/session.pyx":634 + /* "ssh2/session.pyx":619 * 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(1, 633, __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(1, 618, __pyx_L1_error) - /* "ssh2/session.pyx":633 + /* "ssh2/session.pyx":618 * 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(1, 633, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":632 + /* "ssh2/session.pyx":617 * channel = c_ssh2.libssh2_scp_send( * self._session, _path, mode, size) * if channel is NULL: # <<<<<<<<<<<<<< @@ -8626,7 +8626,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_62scp_send(struct __pyx_obj_4s */ } - /* "ssh2/session.pyx":635 + /* "ssh2/session.pyx":620 * return handle_error_codes(c_ssh2.libssh2_session_last_errno( * self._session)) * return PyChannel(channel, self) # <<<<<<<<<<<<<< @@ -8634,14 +8634,14 @@ 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(1, 635, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_7channel_PyChannel(__pyx_v_channel, __pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 620, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":615 - * return PyChannel(channel, self), fileinfo + /* "ssh2/session.pyx":600 + * return PyChannel(channel, self), fileinfo * * def scp_send(self, path not None, int mode, size_t size): # <<<<<<<<<<<<<< * """Deprecated in favour of scp_send64. Send file via SCP. @@ -8660,7 +8660,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_62scp_send(struct __pyx_obj_4s return __pyx_r; } -/* "ssh2/session.pyx":637 +/* "ssh2/session.pyx":622 * return PyChannel(channel, self) * * def scp_send64(self, path not None, int mode, c_ssh2.libssh2_uint64_t size, # <<<<<<<<<<<<<< @@ -8712,29 +8712,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(1, 637, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("scp_send64", 1, 5, 5, 1); __PYX_ERR(1, 622, __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(1, 637, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("scp_send64", 1, 5, 5, 2); __PYX_ERR(1, 622, __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(1, 637, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("scp_send64", 1, 5, 5, 3); __PYX_ERR(1, 622, __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(1, 637, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("scp_send64", 1, 5, 5, 4); __PYX_ERR(1, 622, __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(1, 637, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "scp_send64") < 0)) __PYX_ERR(1, 622, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 5) { goto __pyx_L5_argtuple_error; @@ -8746,21 +8746,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(1, 637, __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(1, 637, __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(1, 638, __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(1, 638, __pyx_L3_error) + __pyx_v_mode = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_mode == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 622, __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(1, 622, __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(1, 623, __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(1, 623, __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(1, 637, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("scp_send64", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 622, __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(1, 637, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "path"); __PYX_ERR(1, 622, __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); @@ -8788,19 +8788,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":649 + /* "ssh2/session.pyx":634 * * :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(1, 649, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 634, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_b_path = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/session.pyx":650 + /* "ssh2/session.pyx":635 * :rtype: :py:class:`ssh2.channel.Channel`""" * cdef bytes b_path = to_bytes(path) * cdef char *_path = b_path # <<<<<<<<<<<<<< @@ -8809,12 +8809,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(1, 650, __pyx_L1_error) + __PYX_ERR(1, 635, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_path); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(1, 650, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_path); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(1, 635, __pyx_L1_error) __pyx_v__path = __pyx_t_2; - /* "ssh2/session.pyx":652 + /* "ssh2/session.pyx":637 * cdef char *_path = b_path * cdef c_ssh2.LIBSSH2_CHANNEL *channel * with nogil: # <<<<<<<<<<<<<< @@ -8829,7 +8829,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_64scp_send64(struct __pyx_obj_ #endif /*try:*/ { - /* "ssh2/session.pyx":653 + /* "ssh2/session.pyx":638 * cdef c_ssh2.LIBSSH2_CHANNEL *channel * with nogil: * channel = c_ssh2.libssh2_scp_send64( # <<<<<<<<<<<<<< @@ -8839,7 +8839,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":652 + /* "ssh2/session.pyx":637 * cdef char *_path = b_path * cdef c_ssh2.LIBSSH2_CHANNEL *channel * with nogil: # <<<<<<<<<<<<<< @@ -8858,7 +8858,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_64scp_send64(struct __pyx_obj_ } } - /* "ssh2/session.pyx":655 + /* "ssh2/session.pyx":640 * channel = c_ssh2.libssh2_scp_send64( * self._session, _path, mode, size, mtime, atime) * if channel is NULL: # <<<<<<<<<<<<<< @@ -8868,7 +8868,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":656 + /* "ssh2/session.pyx":641 * self._session, _path, mode, size, mtime, atime) * if channel is NULL: * return handle_error_codes(c_ssh2.libssh2_session_last_errno( # <<<<<<<<<<<<<< @@ -8877,29 +8877,29 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_64scp_send64(struct __pyx_obj_ */ __Pyx_XDECREF(__pyx_r); - /* "ssh2/session.pyx":657 + /* "ssh2/session.pyx":642 * 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(1, 656, __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(1, 641, __pyx_L1_error) - /* "ssh2/session.pyx":656 + /* "ssh2/session.pyx":641 * 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(1, 656, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 641, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":655 + /* "ssh2/session.pyx":640 * channel = c_ssh2.libssh2_scp_send64( * self._session, _path, mode, size, mtime, atime) * if channel is NULL: # <<<<<<<<<<<<<< @@ -8908,7 +8908,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_64scp_send64(struct __pyx_obj_ */ } - /* "ssh2/session.pyx":658 + /* "ssh2/session.pyx":643 * return handle_error_codes(c_ssh2.libssh2_session_last_errno( * self._session)) * return PyChannel(channel, self) # <<<<<<<<<<<<<< @@ -8916,13 +8916,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(1, 658, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_7channel_PyChannel(__pyx_v_channel, __pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 643, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":637 + /* "ssh2/session.pyx":622 * return PyChannel(channel, self) * * def scp_send64(self, path not None, int mode, c_ssh2.libssh2_uint64_t size, # <<<<<<<<<<<<<< @@ -8942,7 +8942,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_64scp_send64(struct __pyx_obj_ return __pyx_r; } -/* "ssh2/session.pyx":660 +/* "ssh2/session.pyx":645 * return PyChannel(channel, self) * * def publickey_init(self): # <<<<<<<<<<<<<< @@ -8975,7 +8975,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_66publickey_init(struct __pyx_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("publickey_init", 0); - /* "ssh2/session.pyx":664 + /* "ssh2/session.pyx":649 * public keys""" * cdef c_pkey.LIBSSH2_PUBLICKEY *_pkey * with nogil: # <<<<<<<<<<<<<< @@ -8990,7 +8990,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_66publickey_init(struct __pyx_ #endif /*try:*/ { - /* "ssh2/session.pyx":665 + /* "ssh2/session.pyx":650 * cdef c_pkey.LIBSSH2_PUBLICKEY *_pkey * with nogil: * _pkey = c_pkey.libssh2_publickey_init(self._session) # <<<<<<<<<<<<<< @@ -9000,7 +9000,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":664 + /* "ssh2/session.pyx":649 * public keys""" * cdef c_pkey.LIBSSH2_PUBLICKEY *_pkey * with nogil: # <<<<<<<<<<<<<< @@ -9019,7 +9019,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_66publickey_init(struct __pyx_ } } - /* "ssh2/session.pyx":666 + /* "ssh2/session.pyx":651 * with nogil: * _pkey = c_pkey.libssh2_publickey_init(self._session) * if _pkey is NULL: # <<<<<<<<<<<<<< @@ -9029,20 +9029,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":667 + /* "ssh2/session.pyx":652 * _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(1, 667, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_PublicKeyInitError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 652, __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(1, 667, __pyx_L1_error) + __PYX_ERR(1, 652, __pyx_L1_error) - /* "ssh2/session.pyx":666 + /* "ssh2/session.pyx":651 * with nogil: * _pkey = c_pkey.libssh2_publickey_init(self._session) * if _pkey is NULL: # <<<<<<<<<<<<<< @@ -9051,7 +9051,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_66publickey_init(struct __pyx_ */ } - /* "ssh2/session.pyx":668 + /* "ssh2/session.pyx":653 * if _pkey is NULL: * raise PublicKeyInitError * return PyPublicKeySystem(_pkey, self) # <<<<<<<<<<<<<< @@ -9059,13 +9059,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(1, 668, __pyx_L1_error) + __pyx_t_2 = __pyx_f_4ssh2_9publickey_PyPublicKeySystem(__pyx_v__pkey, __pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 653, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":660 + /* "ssh2/session.pyx":645 * return PyChannel(channel, self) * * def publickey_init(self): # <<<<<<<<<<<<<< @@ -9084,7 +9084,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_66publickey_init(struct __pyx_ return __pyx_r; } -/* "ssh2/session.pyx":670 +/* "ssh2/session.pyx":655 * return PyPublicKeySystem(_pkey, self) * * def hostkey_hash(self, int hash_type): # <<<<<<<<<<<<<< @@ -9104,7 +9104,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(1, 670, __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(1, 655, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -9131,7 +9131,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":680 + /* "ssh2/session.pyx":665 * cdef const char *_hash * cdef bytes b_hash * with nogil: # <<<<<<<<<<<<<< @@ -9146,7 +9146,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_68hostkey_hash(struct __pyx_ob #endif /*try:*/ { - /* "ssh2/session.pyx":681 + /* "ssh2/session.pyx":666 * cdef bytes b_hash * with nogil: * _hash = c_ssh2.libssh2_hostkey_hash(self._session, hash_type) # <<<<<<<<<<<<<< @@ -9156,7 +9156,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":680 + /* "ssh2/session.pyx":665 * cdef const char *_hash * cdef bytes b_hash * with nogil: # <<<<<<<<<<<<<< @@ -9175,7 +9175,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_68hostkey_hash(struct __pyx_ob } } - /* "ssh2/session.pyx":682 + /* "ssh2/session.pyx":667 * with nogil: * _hash = c_ssh2.libssh2_hostkey_hash(self._session, hash_type) * if _hash is NULL: # <<<<<<<<<<<<<< @@ -9185,7 +9185,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":683 + /* "ssh2/session.pyx":668 * _hash = c_ssh2.libssh2_hostkey_hash(self._session, hash_type) * if _hash is NULL: * return # <<<<<<<<<<<<<< @@ -9196,7 +9196,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":682 + /* "ssh2/session.pyx":667 * with nogil: * _hash = c_ssh2.libssh2_hostkey_hash(self._session, hash_type) * if _hash is NULL: # <<<<<<<<<<<<<< @@ -9205,19 +9205,19 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_68hostkey_hash(struct __pyx_ob */ } - /* "ssh2/session.pyx":684 + /* "ssh2/session.pyx":669 * 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(1, 684, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v__hash); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 669, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_b_hash = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "ssh2/session.pyx":685 + /* "ssh2/session.pyx":670 * return * b_hash = _hash * return b_hash # <<<<<<<<<<<<<< @@ -9229,7 +9229,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":670 + /* "ssh2/session.pyx":655 * return PyPublicKeySystem(_pkey, self) * * def hostkey_hash(self, int hash_type): # <<<<<<<<<<<<<< @@ -9249,7 +9249,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_68hostkey_hash(struct __pyx_ob return __pyx_r; } -/* "ssh2/session.pyx":687 +/* "ssh2/session.pyx":672 * return b_hash * * def hostkey(self): # <<<<<<<<<<<<<< @@ -9287,7 +9287,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_70hostkey(struct __pyx_obj_4ss int __pyx_clineno = 0; __Pyx_RefNannySetupContext("hostkey", 0); - /* "ssh2/session.pyx":696 + /* "ssh2/session.pyx":681 * * :rtype: tuple(bytes, int)""" * cdef bytes key = b"" # <<<<<<<<<<<<<< @@ -9297,7 +9297,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_70hostkey(struct __pyx_obj_4ss __Pyx_INCREF(__pyx_kp_b__4); __pyx_v_key = __pyx_kp_b__4; - /* "ssh2/session.pyx":698 + /* "ssh2/session.pyx":683 * cdef bytes key = b"" * cdef const char *_key * cdef size_t key_len = 0 # <<<<<<<<<<<<<< @@ -9306,7 +9306,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_70hostkey(struct __pyx_obj_4ss */ __pyx_v_key_len = 0; - /* "ssh2/session.pyx":699 + /* "ssh2/session.pyx":684 * cdef const char *_key * cdef size_t key_len = 0 * cdef int key_type = 0 # <<<<<<<<<<<<<< @@ -9315,7 +9315,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_70hostkey(struct __pyx_obj_4ss */ __pyx_v_key_type = 0; - /* "ssh2/session.pyx":700 + /* "ssh2/session.pyx":685 * cdef size_t key_len = 0 * cdef int key_type = 0 * with nogil: # <<<<<<<<<<<<<< @@ -9330,7 +9330,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_70hostkey(struct __pyx_obj_4ss #endif /*try:*/ { - /* "ssh2/session.pyx":701 + /* "ssh2/session.pyx":686 * cdef int key_type = 0 * with nogil: * _key = c_ssh2.libssh2_session_hostkey( # <<<<<<<<<<<<<< @@ -9340,7 +9340,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":700 + /* "ssh2/session.pyx":685 * cdef size_t key_len = 0 * cdef int key_type = 0 * with nogil: # <<<<<<<<<<<<<< @@ -9359,7 +9359,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_70hostkey(struct __pyx_obj_4ss } } - /* "ssh2/session.pyx":703 + /* "ssh2/session.pyx":688 * _key = c_ssh2.libssh2_session_hostkey( * self._session, &key_len, &key_type) * if _key is NULL: # <<<<<<<<<<<<<< @@ -9369,14 +9369,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":704 + /* "ssh2/session.pyx":689 * 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(1, 704, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_SessionHostKeyError); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 689, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { @@ -9390,14 +9390,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(1, 704, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 689, __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(1, 704, __pyx_L1_error) + __PYX_ERR(1, 689, __pyx_L1_error) - /* "ssh2/session.pyx":703 + /* "ssh2/session.pyx":688 * _key = c_ssh2.libssh2_session_hostkey( * self._session, &key_len, &key_type) * if _key is NULL: # <<<<<<<<<<<<<< @@ -9406,19 +9406,19 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_70hostkey(struct __pyx_obj_4ss */ } - /* "ssh2/session.pyx":706 + /* "ssh2/session.pyx":691 * 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(1, 706, __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(1, 691, __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":707 + /* "ssh2/session.pyx":692 * "Error retrieving server host key for session") * key = _key[:key_len] * return key, key_type # <<<<<<<<<<<<<< @@ -9426,9 +9426,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(1, 707, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_key_type); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 692, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 707, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 692, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); @@ -9440,7 +9440,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_70hostkey(struct __pyx_obj_4ss __pyx_t_3 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":687 + /* "ssh2/session.pyx":672 * return b_hash * * def hostkey(self): # <<<<<<<<<<<<<< @@ -9462,7 +9462,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_70hostkey(struct __pyx_obj_4ss return __pyx_r; } -/* "ssh2/session.pyx":709 +/* "ssh2/session.pyx":694 * return key, key_type * * def knownhost_init(self): # <<<<<<<<<<<<<< @@ -9495,7 +9495,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_72knownhost_init(struct __pyx_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("knownhost_init", 0); - /* "ssh2/session.pyx":714 + /* "ssh2/session.pyx":699 * :rtype: :py:class:`ssh2.knownhost.KnownHost`""" * cdef c_ssh2.LIBSSH2_KNOWNHOSTS *known_hosts * with nogil: # <<<<<<<<<<<<<< @@ -9510,7 +9510,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_72knownhost_init(struct __pyx_ #endif /*try:*/ { - /* "ssh2/session.pyx":715 + /* "ssh2/session.pyx":700 * cdef c_ssh2.LIBSSH2_KNOWNHOSTS *known_hosts * with nogil: * known_hosts = c_ssh2.libssh2_knownhost_init( # <<<<<<<<<<<<<< @@ -9520,7 +9520,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":714 + /* "ssh2/session.pyx":699 * :rtype: :py:class:`ssh2.knownhost.KnownHost`""" * cdef c_ssh2.LIBSSH2_KNOWNHOSTS *known_hosts * with nogil: # <<<<<<<<<<<<<< @@ -9539,7 +9539,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_72knownhost_init(struct __pyx_ } } - /* "ssh2/session.pyx":717 + /* "ssh2/session.pyx":702 * known_hosts = c_ssh2.libssh2_knownhost_init( * self._session) * if known_hosts is NULL: # <<<<<<<<<<<<<< @@ -9549,20 +9549,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":718 + /* "ssh2/session.pyx":703 * 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(1, 718, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_KnownHostError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 703, __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(1, 718, __pyx_L1_error) + __PYX_ERR(1, 703, __pyx_L1_error) - /* "ssh2/session.pyx":717 + /* "ssh2/session.pyx":702 * known_hosts = c_ssh2.libssh2_knownhost_init( * self._session) * if known_hosts is NULL: # <<<<<<<<<<<<<< @@ -9571,7 +9571,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_72knownhost_init(struct __pyx_ */ } - /* "ssh2/session.pyx":719 + /* "ssh2/session.pyx":704 * if known_hosts is NULL: * raise KnownHostError * return PyKnownHost(self, known_hosts) # <<<<<<<<<<<<<< @@ -9579,13 +9579,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(1, 719, __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(1, 704, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":709 + /* "ssh2/session.pyx":694 * return key, key_type * * def knownhost_init(self): # <<<<<<<<<<<<<< @@ -9604,7 +9604,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_72knownhost_init(struct __pyx_ return __pyx_r; } -/* "ssh2/session.pyx":721 +/* "ssh2/session.pyx":706 * return PyKnownHost(self, known_hosts) * * def keepalive_config(self, bint want_reply, unsigned interval): # <<<<<<<<<<<<<< @@ -9647,11 +9647,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(1, 721, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("keepalive_config", 1, 2, 2, 1); __PYX_ERR(1, 706, __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(1, 721, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "keepalive_config") < 0)) __PYX_ERR(1, 706, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -9659,12 +9659,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(1, 721, __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(1, 721, __pyx_L3_error) + __pyx_v_want_reply = __Pyx_PyObject_IsTrue(values[0]); if (unlikely((__pyx_v_want_reply == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 706, __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(1, 706, __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(1, 721, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("keepalive_config", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 706, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.session.Session.keepalive_config", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -9682,7 +9682,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_74keepalive_config(struct __py __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("keepalive_config", 0); - /* "ssh2/session.pyx":731 + /* "ssh2/session.pyx":716 * keepalives. * :type interval: int""" * with nogil: # <<<<<<<<<<<<<< @@ -9697,7 +9697,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_74keepalive_config(struct __py #endif /*try:*/ { - /* "ssh2/session.pyx":732 + /* "ssh2/session.pyx":717 * :type interval: int""" * with nogil: * c_ssh2.libssh2_keepalive_config(self._session, want_reply, interval) # <<<<<<<<<<<<<< @@ -9707,7 +9707,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":731 + /* "ssh2/session.pyx":716 * keepalives. * :type interval: int""" * with nogil: # <<<<<<<<<<<<<< @@ -9726,7 +9726,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_74keepalive_config(struct __py } } - /* "ssh2/session.pyx":721 + /* "ssh2/session.pyx":706 * return PyKnownHost(self, known_hosts) * * def keepalive_config(self, bint want_reply, unsigned interval): # <<<<<<<<<<<<<< @@ -9741,7 +9741,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_74keepalive_config(struct __py return __pyx_r; } -/* "ssh2/session.pyx":734 +/* "ssh2/session.pyx":719 * c_ssh2.libssh2_keepalive_config(self._session, want_reply, interval) * * def keepalive_send(self): # <<<<<<<<<<<<<< @@ -9776,7 +9776,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_76keepalive_send(struct __pyx_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("keepalive_send", 0); - /* "ssh2/session.pyx":740 + /* "ssh2/session.pyx":725 * * :rtype: int""" * cdef int seconds = 0 # <<<<<<<<<<<<<< @@ -9785,7 +9785,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_76keepalive_send(struct __pyx_ */ __pyx_v_seconds = 0; - /* "ssh2/session.pyx":741 + /* "ssh2/session.pyx":726 * :rtype: int""" * cdef int seconds = 0 * cdef int c_seconds = 0 # <<<<<<<<<<<<<< @@ -9794,7 +9794,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_76keepalive_send(struct __pyx_ */ __pyx_v_c_seconds = 0; - /* "ssh2/session.pyx":743 + /* "ssh2/session.pyx":728 * cdef int c_seconds = 0 * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -9809,7 +9809,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_76keepalive_send(struct __pyx_ #endif /*try:*/ { - /* "ssh2/session.pyx":744 + /* "ssh2/session.pyx":729 * cdef int rc * with nogil: * rc = c_ssh2.libssh2_keepalive_send(self._session, &c_seconds) # <<<<<<<<<<<<<< @@ -9819,7 +9819,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":743 + /* "ssh2/session.pyx":728 * cdef int c_seconds = 0 * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -9838,16 +9838,16 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_76keepalive_send(struct __pyx_ } } - /* "ssh2/session.pyx":745 + /* "ssh2/session.pyx":730 * 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(1, 745, __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(1, 730, __pyx_L1_error) - /* "ssh2/session.pyx":746 + /* "ssh2/session.pyx":731 * rc = c_ssh2.libssh2_keepalive_send(self._session, &c_seconds) * handle_error_codes(rc) * return c_seconds # <<<<<<<<<<<<<< @@ -9855,13 +9855,13 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_76keepalive_send(struct __pyx_ * def supported_algs(self, MethodType method_type): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_c_seconds); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 746, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_c_seconds); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 731, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":734 + /* "ssh2/session.pyx":719 * c_ssh2.libssh2_keepalive_config(self._session, want_reply, interval) * * def keepalive_send(self): # <<<<<<<<<<<<<< @@ -9880,7 +9880,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_76keepalive_send(struct __pyx_ return __pyx_r; } -/* "ssh2/session.pyx":748 +/* "ssh2/session.pyx":733 * return c_seconds * * def supported_algs(self, MethodType method_type): # <<<<<<<<<<<<<< @@ -9898,7 +9898,7 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_79supported_algs(PyObject *__p PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("supported_algs (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_method_type), __pyx_ptype_4ssh2_7session_MethodType, 1, "method_type", 0))) __PYX_ERR(1, 748, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_method_type), __pyx_ptype_4ssh2_7session_MethodType, 1, "method_type", 0))) __PYX_ERR(1, 733, __pyx_L1_error) __pyx_r = __pyx_pf_4ssh2_7session_7Session_78supported_algs(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), ((struct __pyx_obj_4ssh2_7session_MethodType *)__pyx_v_method_type)); /* function exit code */ @@ -9935,7 +9935,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_78supported_algs(struct __pyx_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("supported_algs", 0); - /* "ssh2/session.pyx":759 + /* "ssh2/session.pyx":744 * cdef const char **c_algs * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -9950,7 +9950,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_78supported_algs(struct __pyx_ #endif /*try:*/ { - /* "ssh2/session.pyx":760 + /* "ssh2/session.pyx":745 * cdef int rc * with nogil: * rc = c_ssh2.libssh2_session_supported_algs( # <<<<<<<<<<<<<< @@ -9960,7 +9960,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_78supported_algs(struct __pyx_ __pyx_v_rc = libssh2_session_supported_algs(__pyx_v_self->_session, __pyx_v_method_type->value, (&__pyx_v_c_algs)); } - /* "ssh2/session.pyx":759 + /* "ssh2/session.pyx":744 * cdef const char **c_algs * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -9979,7 +9979,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_78supported_algs(struct __pyx_ } } - /* "ssh2/session.pyx":762 + /* "ssh2/session.pyx":747 * rc = c_ssh2.libssh2_session_supported_algs( * self._session, method_type.value, &c_algs) * if rc < 0: # <<<<<<<<<<<<<< @@ -9989,7 +9989,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_78supported_algs(struct __pyx_ __pyx_t_1 = ((__pyx_v_rc < 0) != 0); if (__pyx_t_1) { - /* "ssh2/session.pyx":763 + /* "ssh2/session.pyx":748 * self._session, method_type.value, &c_algs) * if rc < 0: * return handle_error_codes(rc) # <<<<<<<<<<<<<< @@ -9997,14 +9997,14 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_78supported_algs(struct __pyx_ * return [] */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __pyx_f_4ssh2_5utils_handle_error_codes(__pyx_v_rc, 0); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(1, 763, __pyx_L1_error) - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 763, __pyx_L1_error) + __pyx_t_2 = __pyx_f_4ssh2_5utils_handle_error_codes(__pyx_v_rc, 0); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(1, 748, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 748, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":762 + /* "ssh2/session.pyx":747 * rc = c_ssh2.libssh2_session_supported_algs( * self._session, method_type.value, &c_algs) * if rc < 0: # <<<<<<<<<<<<<< @@ -10013,7 +10013,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_78supported_algs(struct __pyx_ */ } - /* "ssh2/session.pyx":764 + /* "ssh2/session.pyx":749 * if rc < 0: * return handle_error_codes(rc) * elif rc == 0: # <<<<<<<<<<<<<< @@ -10023,7 +10023,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_78supported_algs(struct __pyx_ __pyx_t_1 = ((__pyx_v_rc == 0) != 0); if (__pyx_t_1) { - /* "ssh2/session.pyx":765 + /* "ssh2/session.pyx":750 * return handle_error_codes(rc) * elif rc == 0: * return [] # <<<<<<<<<<<<<< @@ -10031,13 +10031,13 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_78supported_algs(struct __pyx_ * algs = [to_str(c_algs[i]) for i in range(rc)] */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 765, __pyx_L1_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 750, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":764 + /* "ssh2/session.pyx":749 * if rc < 0: * return handle_error_codes(rc) * elif rc == 0: # <<<<<<<<<<<<<< @@ -10046,7 +10046,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_78supported_algs(struct __pyx_ */ } - /* "ssh2/session.pyx":766 + /* "ssh2/session.pyx":751 * elif rc == 0: * return [] * try: # <<<<<<<<<<<<<< @@ -10055,29 +10055,29 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_78supported_algs(struct __pyx_ */ /*try:*/ { - /* "ssh2/session.pyx":767 + /* "ssh2/session.pyx":752 * return [] * try: * algs = [to_str(c_algs[i]) for i in range(rc)] # <<<<<<<<<<<<<< * finally: * with nogil: */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 767, __pyx_L8_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 752, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __pyx_v_rc; __pyx_t_4 = __pyx_t_2; for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { __pyx_v_i = __pyx_t_5; - __pyx_t_6 = __pyx_f_4ssh2_5utils_to_str((__pyx_v_c_algs[__pyx_v_i])); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 767, __pyx_L8_error) + __pyx_t_6 = __pyx_f_4ssh2_5utils_to_str((__pyx_v_c_algs[__pyx_v_i])); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 752, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_6); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 767, __pyx_L8_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 752, __pyx_L8_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_v_algs = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; } - /* "ssh2/session.pyx":769 + /* "ssh2/session.pyx":754 * algs = [to_str(c_algs[i]) for i in range(rc)] * finally: * with nogil: # <<<<<<<<<<<<<< @@ -10094,7 +10094,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_78supported_algs(struct __pyx_ #endif /*try:*/ { - /* "ssh2/session.pyx":770 + /* "ssh2/session.pyx":755 * finally: * with nogil: * c_ssh2.libssh2_free(self._session, c_algs) # <<<<<<<<<<<<<< @@ -10104,7 +10104,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_78supported_algs(struct __pyx_ libssh2_free(__pyx_v_self->_session, __pyx_v_c_algs); } - /* "ssh2/session.pyx":769 + /* "ssh2/session.pyx":754 * algs = [to_str(c_algs[i]) for i in range(rc)] * finally: * with nogil: # <<<<<<<<<<<<<< @@ -10149,7 +10149,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_78supported_algs(struct __pyx_ #endif /*try:*/ { - /* "ssh2/session.pyx":770 + /* "ssh2/session.pyx":755 * finally: * with nogil: * c_ssh2.libssh2_free(self._session, c_algs) # <<<<<<<<<<<<<< @@ -10159,7 +10159,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_78supported_algs(struct __pyx_ libssh2_free(__pyx_v_self->_session, __pyx_v_c_algs); } - /* "ssh2/session.pyx":769 + /* "ssh2/session.pyx":754 * algs = [to_str(c_algs[i]) for i in range(rc)] * finally: * with nogil: # <<<<<<<<<<<<<< @@ -10195,7 +10195,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_78supported_algs(struct __pyx_ __pyx_L9:; } - /* "ssh2/session.pyx":771 + /* "ssh2/session.pyx":756 * with nogil: * c_ssh2.libssh2_free(self._session, c_algs) * return algs # <<<<<<<<<<<<<< @@ -10207,7 +10207,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_78supported_algs(struct __pyx_ __pyx_r = __pyx_v_algs; goto __pyx_L0; - /* "ssh2/session.pyx":748 + /* "ssh2/session.pyx":733 * return c_seconds * * def supported_algs(self, MethodType method_type): # <<<<<<<<<<<<<< @@ -10228,7 +10228,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_78supported_algs(struct __pyx_ return __pyx_r; } -/* "ssh2/session.pyx":773 +/* "ssh2/session.pyx":758 * return algs * * def methods(self, MethodType method_type): # <<<<<<<<<<<<<< @@ -10246,7 +10246,7 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_81methods(PyObject *__pyx_v_se PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("methods (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_method_type), __pyx_ptype_4ssh2_7session_MethodType, 1, "method_type", 0))) __PYX_ERR(1, 773, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_method_type), __pyx_ptype_4ssh2_7session_MethodType, 1, "method_type", 0))) __PYX_ERR(1, 758, __pyx_L1_error) __pyx_r = __pyx_pf_4ssh2_7session_7Session_80methods(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), ((struct __pyx_obj_4ssh2_7session_MethodType *)__pyx_v_method_type)); /* function exit code */ @@ -10268,7 +10268,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_80methods(struct __pyx_obj_4ss int __pyx_clineno = 0; __Pyx_RefNannySetupContext("methods", 0); - /* "ssh2/session.pyx":781 + /* "ssh2/session.pyx":766 * :rtype: str * """ * with nogil: # <<<<<<<<<<<<<< @@ -10283,7 +10283,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_80methods(struct __pyx_obj_4ss #endif /*try:*/ { - /* "ssh2/session.pyx":782 + /* "ssh2/session.pyx":767 * """ * with nogil: * methods = c_ssh2.libssh2_session_methods( # <<<<<<<<<<<<<< @@ -10293,7 +10293,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_80methods(struct __pyx_obj_4ss __pyx_v_methods = libssh2_session_methods(__pyx_v_self->_session, __pyx_v_method_type->value); } - /* "ssh2/session.pyx":781 + /* "ssh2/session.pyx":766 * :rtype: str * """ * with nogil: # <<<<<<<<<<<<<< @@ -10312,7 +10312,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_80methods(struct __pyx_obj_4ss } } - /* "ssh2/session.pyx":784 + /* "ssh2/session.pyx":769 * methods = c_ssh2.libssh2_session_methods( * self._session, method_type.value) * return to_str(methods) # <<<<<<<<<<<<<< @@ -10320,13 +10320,13 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_80methods(struct __pyx_obj_4ss * def method_pref(self, MethodType method_type, prefs not None): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_4ssh2_5utils_to_str(__pyx_v_methods); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 784, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_5utils_to_str(__pyx_v_methods); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 769, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":773 + /* "ssh2/session.pyx":758 * return algs * * def methods(self, MethodType method_type): # <<<<<<<<<<<<<< @@ -10345,7 +10345,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_80methods(struct __pyx_obj_4ss return __pyx_r; } -/* "ssh2/session.pyx":786 +/* "ssh2/session.pyx":771 * return to_str(methods) * * def method_pref(self, MethodType method_type, prefs not None): # <<<<<<<<<<<<<< @@ -10388,11 +10388,11 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_83method_pref(PyObject *__pyx_ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_prefs)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("method_pref", 1, 2, 2, 1); __PYX_ERR(1, 786, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("method_pref", 1, 2, 2, 1); __PYX_ERR(1, 771, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "method_pref") < 0)) __PYX_ERR(1, 786, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "method_pref") < 0)) __PYX_ERR(1, 771, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -10405,15 +10405,15 @@ static PyObject *__pyx_pw_4ssh2_7session_7Session_83method_pref(PyObject *__pyx_ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("method_pref", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 786, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("method_pref", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 771, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.session.Session.method_pref", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_method_type), __pyx_ptype_4ssh2_7session_MethodType, 1, "method_type", 0))) __PYX_ERR(1, 786, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_method_type), __pyx_ptype_4ssh2_7session_MethodType, 1, "method_type", 0))) __PYX_ERR(1, 771, __pyx_L1_error) if (unlikely(((PyObject *)__pyx_v_prefs) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "prefs"); __PYX_ERR(1, 786, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "prefs"); __PYX_ERR(1, 771, __pyx_L1_error) } __pyx_r = __pyx_pf_4ssh2_7session_7Session_82method_pref(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), __pyx_v_method_type, __pyx_v_prefs); @@ -10440,19 +10440,19 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_82method_pref(struct __pyx_obj int __pyx_clineno = 0; __Pyx_RefNannySetupContext("method_pref", 0); - /* "ssh2/session.pyx":801 + /* "ssh2/session.pyx":786 * on unsupported method preference * """ * cdef bytes b_prefs = to_bytes(prefs) # <<<<<<<<<<<<<< * cdef const char *c_prefs = b_prefs * cdef int rc */ - __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_prefs); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 801, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_prefs); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 786, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_b_prefs = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/session.pyx":802 + /* "ssh2/session.pyx":787 * """ * cdef bytes b_prefs = to_bytes(prefs) * cdef const char *c_prefs = b_prefs # <<<<<<<<<<<<<< @@ -10461,12 +10461,12 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_82method_pref(struct __pyx_obj */ if (unlikely(__pyx_v_b_prefs == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(1, 802, __pyx_L1_error) + __PYX_ERR(1, 787, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyBytes_AsString(__pyx_v_b_prefs); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(1, 802, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_AsString(__pyx_v_b_prefs); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(1, 787, __pyx_L1_error) __pyx_v_c_prefs = __pyx_t_2; - /* "ssh2/session.pyx":804 + /* "ssh2/session.pyx":789 * cdef const char *c_prefs = b_prefs * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -10481,7 +10481,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_82method_pref(struct __pyx_obj #endif /*try:*/ { - /* "ssh2/session.pyx":805 + /* "ssh2/session.pyx":790 * cdef int rc * with nogil: * rc = c_ssh2.libssh2_session_method_pref( # <<<<<<<<<<<<<< @@ -10491,7 +10491,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_82method_pref(struct __pyx_obj __pyx_v_rc = libssh2_session_method_pref(__pyx_v_self->_session, __pyx_v_method_type->value, __pyx_v_c_prefs); } - /* "ssh2/session.pyx":804 + /* "ssh2/session.pyx":789 * cdef const char *c_prefs = b_prefs * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -10510,27 +10510,27 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_82method_pref(struct __pyx_obj } } - /* "ssh2/session.pyx":807 + /* "ssh2/session.pyx":792 * rc = c_ssh2.libssh2_session_method_pref( * self._session, method_type.value, c_prefs) * handle_error_codes(rc) # <<<<<<<<<<<<<< * return rc */ - __pyx_t_3 = __pyx_f_4ssh2_5utils_handle_error_codes(__pyx_v_rc, 0); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 807, __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(1, 792, __pyx_L1_error) - /* "ssh2/session.pyx":808 + /* "ssh2/session.pyx":793 * self._session, method_type.value, c_prefs) * handle_error_codes(rc) * return rc # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 808, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 793, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":786 + /* "ssh2/session.pyx":771 * return to_str(methods) * * def method_pref(self, MethodType method_type, prefs not None): # <<<<<<<<<<<<<< @@ -11276,8 +11276,8 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { }; static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 2, __pyx_L1_error) - __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(1, 98, __pyx_L1_error) - __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(1, 112, __pyx_L1_error) + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(1, 88, __pyx_L1_error) + __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(1, 102, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; @@ -11306,14 +11306,14 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); - /* "ssh2/session.pyx":336 + /* "ssh2/session.pyx":325 * cdef const char *_username = b_username * * def passwd(): # <<<<<<<<<<<<<< * return password * */ - __pyx_codeobj__5 = (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, 336, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(1, 336, __pyx_L1_error) + __pyx_codeobj__5 = (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, 325, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(1, 325, __pyx_L1_error) /* "(tree fragment)":2 * def __reduce_cython__(self): @@ -11388,27 +11388,27 @@ 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(1, 104, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_4ssh2_7session_Session) < 0) __PYX_ERR(1, 94, __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(1, 104, __pyx_L1_error) - if (__Pyx_setup_reduce((PyObject*)&__pyx_type_4ssh2_7session_Session) < 0) __PYX_ERR(1, 104, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Session, (PyObject *)&__pyx_type_4ssh2_7session_Session) < 0) __PYX_ERR(1, 94, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_4ssh2_7session_Session) < 0) __PYX_ERR(1, 94, __pyx_L1_error) __pyx_ptype_4ssh2_7session_Session = &__pyx_type_4ssh2_7session_Session; - if (PyType_Ready(&__pyx_type_4ssh2_7session_MethodType) < 0) __PYX_ERR(1, 65, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_4ssh2_7session_MethodType) < 0) __PYX_ERR(1, 56, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_4ssh2_7session_MethodType.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4ssh2_7session_MethodType.tp_dictoffset && __pyx_type_4ssh2_7session_MethodType.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_4ssh2_7session_MethodType.tp_getattro = __Pyx_PyObject_GenericGetAttr; } - if (PyObject_SetAttr(__pyx_m, __pyx_n_s_MethodType, (PyObject *)&__pyx_type_4ssh2_7session_MethodType) < 0) __PYX_ERR(1, 65, __pyx_L1_error) - if (__Pyx_setup_reduce((PyObject*)&__pyx_type_4ssh2_7session_MethodType) < 0) __PYX_ERR(1, 65, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_MethodType, (PyObject *)&__pyx_type_4ssh2_7session_MethodType) < 0) __PYX_ERR(1, 56, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_4ssh2_7session_MethodType) < 0) __PYX_ERR(1, 56, __pyx_L1_error) __pyx_ptype_4ssh2_7session_MethodType = &__pyx_type_4ssh2_7session_MethodType; - if (PyType_Ready(&__pyx_type_4ssh2_7session___pyx_scope_struct__userauth_keyboardinteractive) < 0) __PYX_ERR(1, 323, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_4ssh2_7session___pyx_scope_struct__userauth_keyboardinteractive) < 0) __PYX_ERR(1, 312, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_4ssh2_7session___pyx_scope_struct__userauth_keyboardinteractive.tp_print = 0; #endif @@ -11484,10 +11484,10 @@ static int __Pyx_modinit_type_import_code(void) { __pyx_ptype_4ssh2_9knownhost_KnownHost = __Pyx_ImportType(__pyx_t_1, "ssh2.knownhost", "KnownHost", sizeof(struct __pyx_obj_4ssh2_9knownhost_KnownHost), __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_4ssh2_9knownhost_KnownHost) __PYX_ERR(10, 28, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyImport_ImportModule("ssh2.fileinfo"); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 20, __pyx_L1_error) + __pyx_t_1 = PyImport_ImportModule("ssh2.fileinfo"); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_4ssh2_8fileinfo_FileInfo = __Pyx_ImportType(__pyx_t_1, "ssh2.fileinfo", "FileInfo", sizeof(struct __pyx_obj_4ssh2_8fileinfo_FileInfo), __Pyx_ImportType_CheckSize_Warn); - if (!__pyx_ptype_4ssh2_8fileinfo_FileInfo) __PYX_ERR(11, 20, __pyx_L1_error) + if (!__pyx_ptype_4ssh2_8fileinfo_FileInfo) __PYX_ERR(11, 19, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; @@ -11797,298 +11797,298 @@ if (!__Pyx_RefNanny) { __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "ssh2/session.pyx":41 + /* "ssh2/session.pyx":40 * * * LIBSSH2_SESSION_BLOCK_INBOUND = c_ssh2.LIBSSH2_SESSION_BLOCK_INBOUND # <<<<<<<<<<<<<< * LIBSSH2_SESSION_BLOCK_OUTBOUND = c_ssh2.LIBSSH2_SESSION_BLOCK_OUTBOUND * */ - __pyx_t_2 = __Pyx_PyInt_From_int(LIBSSH2_SESSION_BLOCK_INBOUND); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 41, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(LIBSSH2_SESSION_BLOCK_INBOUND); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_SESSION_BLOCK_INBOUND, __pyx_t_2) < 0) __PYX_ERR(1, 41, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_SESSION_BLOCK_INBOUND, __pyx_t_2) < 0) __PYX_ERR(1, 40, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "ssh2/session.pyx":42 + /* "ssh2/session.pyx":41 * * 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_OUTBOUND); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 42, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(LIBSSH2_SESSION_BLOCK_OUTBOUND); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 41, __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(1, 42, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_SESSION_BLOCK_OUTBOUND, __pyx_t_2) < 0) __PYX_ERR(1, 41, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "ssh2/session.pyx":44 + /* "ssh2/session.pyx":43 * 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 */ - __pyx_t_2 = __Pyx_PyInt_From_int(LIBSSH2_HOSTKEY_HASH_MD5); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 44, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(LIBSSH2_HOSTKEY_HASH_MD5); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 43, __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(1, 44, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_HOSTKEY_HASH_MD5, __pyx_t_2) < 0) __PYX_ERR(1, 43, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "ssh2/session.pyx":45 + /* "ssh2/session.pyx":44 * * 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_HASH_SHA256 = c_ssh2.LIBSSH2_HOSTKEY_HASH_SHA256 + * LIBSSH2_HOSTKEY_TYPE_ECDSA_256 = c_ssh2.LIBSSH2_HOSTKEY_TYPE_ECDSA_256 */ - __pyx_t_2 = __Pyx_PyInt_From_int(LIBSSH2_HOSTKEY_HASH_SHA1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 45, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(LIBSSH2_HOSTKEY_HASH_SHA1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 44, __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(1, 45, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_HOSTKEY_HASH_SHA1, __pyx_t_2) < 0) __PYX_ERR(1, 44, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "ssh2/session.pyx":47 + /* "ssh2/session.pyx":45 + * 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_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(1, 47, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(LIBSSH2_HOSTKEY_HASH_SHA256); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 45, __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(1, 47, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_HOSTKEY_HASH_SHA256, __pyx_t_2) < 0) __PYX_ERR(1, 45, __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 + /* "ssh2/session.pyx":46 + * LIBSSH2_HOSTKEY_HASH_SHA1 = c_ssh2.LIBSSH2_HOSTKEY_HASH_SHA1 + * 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(1, 48, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(LIBSSH2_HOSTKEY_TYPE_ECDSA_256); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 46, __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(1, 48, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_HOSTKEY_TYPE_ECDSA_256, __pyx_t_2) < 0) __PYX_ERR(1, 46, __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 + /* "ssh2/session.pyx":47 + * 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(1, 49, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(LIBSSH2_HOSTKEY_TYPE_ECDSA_384); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 47, __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(1, 49, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_HOSTKEY_TYPE_ECDSA_384, __pyx_t_2) < 0) __PYX_ERR(1, 47, __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: + /* "ssh2/session.pyx":48 + * 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_521); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 50, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(LIBSSH2_HOSTKEY_TYPE_ECDSA_521); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 48, __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(1, 50, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_HOSTKEY_TYPE_ECDSA_521, __pyx_t_2) < 0) __PYX_ERR(1, 48, __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 + /* "ssh2/session.pyx":49 + * 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 # <<<<<<<<<<<<<< + * + * LIBSSH2_HOSTKEY_TYPE_UNKNOWN = c_ssh2.LIBSSH2_HOSTKEY_TYPE_UNKNOWN */ - __pyx_t_2 = __Pyx_PyInt_From_int(LIBSSH2_HOSTKEY_TYPE_ED25519); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 51, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(LIBSSH2_HOSTKEY_TYPE_ED25519); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 49, __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(1, 51, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_HOSTKEY_TYPE_ED25519, __pyx_t_2) < 0) __PYX_ERR(1, 49, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "ssh2/session.pyx":60 - * LIBSSH2_HOSTKEY_TYPE_ED25519 = None + /* "ssh2/session.pyx":51 + * LIBSSH2_HOSTKEY_TYPE_ED25519 = c_ssh2.LIBSSH2_HOSTKEY_TYPE_ED25519 * * 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(1, 60, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(LIBSSH2_HOSTKEY_TYPE_UNKNOWN); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 51, __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(1, 60, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_HOSTKEY_TYPE_UNKNOWN, __pyx_t_2) < 0) __PYX_ERR(1, 51, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "ssh2/session.pyx":61 + /* "ssh2/session.pyx":52 * * 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(1, 61, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(LIBSSH2_HOSTKEY_TYPE_RSA); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 52, __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(1, 61, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_HOSTKEY_TYPE_RSA, __pyx_t_2) < 0) __PYX_ERR(1, 52, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "ssh2/session.pyx":62 + /* "ssh2/session.pyx":53 * 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(1, 62, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(LIBSSH2_HOSTKEY_TYPE_DSS); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 53, __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(1, 62, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_HOSTKEY_TYPE_DSS, __pyx_t_2) < 0) __PYX_ERR(1, 53, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "ssh2/session.pyx":71 + /* "ssh2/session.pyx":61 + * * - * IF EMBEDDED_LIB: - * LIBSSH2_METHOD_KEX = MethodType(c_ssh2.LIBSSH2_METHOD_KEX) # <<<<<<<<<<<<<< - * LIBSSH2_METHOD_HOSTKEY = MethodType(c_ssh2.LIBSSH2_METHOD_HOSTKEY) - * LIBSSH2_METHOD_CRYPT_CS = MethodType(c_ssh2.LIBSSH2_METHOD_CRYPT_CS) + * LIBSSH2_METHOD_KEX = MethodType(c_ssh2.LIBSSH2_METHOD_KEX) # <<<<<<<<<<<<<< + * LIBSSH2_METHOD_HOSTKEY = MethodType(c_ssh2.LIBSSH2_METHOD_HOSTKEY) + * LIBSSH2_METHOD_CRYPT_CS = MethodType(c_ssh2.LIBSSH2_METHOD_CRYPT_CS) */ - __pyx_t_2 = __Pyx_PyInt_From_int(LIBSSH2_METHOD_KEX); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 71, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(LIBSSH2_METHOD_KEX); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_4ssh2_7session_MethodType), __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 71, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_4ssh2_7session_MethodType), __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_METHOD_KEX, __pyx_t_1) < 0) __PYX_ERR(1, 71, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_METHOD_KEX, __pyx_t_1) < 0) __PYX_ERR(1, 61, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/session.pyx":72 - * IF EMBEDDED_LIB: - * LIBSSH2_METHOD_KEX = MethodType(c_ssh2.LIBSSH2_METHOD_KEX) - * LIBSSH2_METHOD_HOSTKEY = MethodType(c_ssh2.LIBSSH2_METHOD_HOSTKEY) # <<<<<<<<<<<<<< - * LIBSSH2_METHOD_CRYPT_CS = MethodType(c_ssh2.LIBSSH2_METHOD_CRYPT_CS) - * LIBSSH2_METHOD_CRYPT_SC = MethodType(c_ssh2.LIBSSH2_METHOD_CRYPT_SC) + /* "ssh2/session.pyx":62 + * + * LIBSSH2_METHOD_KEX = MethodType(c_ssh2.LIBSSH2_METHOD_KEX) + * LIBSSH2_METHOD_HOSTKEY = MethodType(c_ssh2.LIBSSH2_METHOD_HOSTKEY) # <<<<<<<<<<<<<< + * LIBSSH2_METHOD_CRYPT_CS = MethodType(c_ssh2.LIBSSH2_METHOD_CRYPT_CS) + * LIBSSH2_METHOD_CRYPT_SC = MethodType(c_ssh2.LIBSSH2_METHOD_CRYPT_SC) */ - __pyx_t_1 = __Pyx_PyInt_From_int(LIBSSH2_METHOD_HOSTKEY); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 72, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(LIBSSH2_METHOD_HOSTKEY); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 62, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_4ssh2_7session_MethodType), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 72, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_4ssh2_7session_MethodType), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 62, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_METHOD_HOSTKEY, __pyx_t_2) < 0) __PYX_ERR(1, 72, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_METHOD_HOSTKEY, __pyx_t_2) < 0) __PYX_ERR(1, 62, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "ssh2/session.pyx":73 - * LIBSSH2_METHOD_KEX = MethodType(c_ssh2.LIBSSH2_METHOD_KEX) - * LIBSSH2_METHOD_HOSTKEY = MethodType(c_ssh2.LIBSSH2_METHOD_HOSTKEY) - * LIBSSH2_METHOD_CRYPT_CS = MethodType(c_ssh2.LIBSSH2_METHOD_CRYPT_CS) # <<<<<<<<<<<<<< - * LIBSSH2_METHOD_CRYPT_SC = MethodType(c_ssh2.LIBSSH2_METHOD_CRYPT_SC) - * LIBSSH2_METHOD_MAC_CS = MethodType(c_ssh2.LIBSSH2_METHOD_MAC_CS) + /* "ssh2/session.pyx":63 + * LIBSSH2_METHOD_KEX = MethodType(c_ssh2.LIBSSH2_METHOD_KEX) + * LIBSSH2_METHOD_HOSTKEY = MethodType(c_ssh2.LIBSSH2_METHOD_HOSTKEY) + * LIBSSH2_METHOD_CRYPT_CS = MethodType(c_ssh2.LIBSSH2_METHOD_CRYPT_CS) # <<<<<<<<<<<<<< + * LIBSSH2_METHOD_CRYPT_SC = MethodType(c_ssh2.LIBSSH2_METHOD_CRYPT_SC) + * LIBSSH2_METHOD_MAC_CS = MethodType(c_ssh2.LIBSSH2_METHOD_MAC_CS) */ - __pyx_t_2 = __Pyx_PyInt_From_int(LIBSSH2_METHOD_CRYPT_CS); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 73, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(LIBSSH2_METHOD_CRYPT_CS); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_4ssh2_7session_MethodType), __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 73, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_4ssh2_7session_MethodType), __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_METHOD_CRYPT_CS, __pyx_t_1) < 0) __PYX_ERR(1, 73, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_METHOD_CRYPT_CS, __pyx_t_1) < 0) __PYX_ERR(1, 63, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/session.pyx":74 - * LIBSSH2_METHOD_HOSTKEY = MethodType(c_ssh2.LIBSSH2_METHOD_HOSTKEY) - * LIBSSH2_METHOD_CRYPT_CS = MethodType(c_ssh2.LIBSSH2_METHOD_CRYPT_CS) - * LIBSSH2_METHOD_CRYPT_SC = MethodType(c_ssh2.LIBSSH2_METHOD_CRYPT_SC) # <<<<<<<<<<<<<< - * LIBSSH2_METHOD_MAC_CS = MethodType(c_ssh2.LIBSSH2_METHOD_MAC_CS) - * LIBSSH2_METHOD_MAC_SC = MethodType(c_ssh2.LIBSSH2_METHOD_MAC_SC) + /* "ssh2/session.pyx":64 + * LIBSSH2_METHOD_HOSTKEY = MethodType(c_ssh2.LIBSSH2_METHOD_HOSTKEY) + * LIBSSH2_METHOD_CRYPT_CS = MethodType(c_ssh2.LIBSSH2_METHOD_CRYPT_CS) + * LIBSSH2_METHOD_CRYPT_SC = MethodType(c_ssh2.LIBSSH2_METHOD_CRYPT_SC) # <<<<<<<<<<<<<< + * LIBSSH2_METHOD_MAC_CS = MethodType(c_ssh2.LIBSSH2_METHOD_MAC_CS) + * LIBSSH2_METHOD_MAC_SC = MethodType(c_ssh2.LIBSSH2_METHOD_MAC_SC) */ - __pyx_t_1 = __Pyx_PyInt_From_int(LIBSSH2_METHOD_CRYPT_SC); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 74, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(LIBSSH2_METHOD_CRYPT_SC); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_4ssh2_7session_MethodType), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 74, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_4ssh2_7session_MethodType), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_METHOD_CRYPT_SC, __pyx_t_2) < 0) __PYX_ERR(1, 74, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_METHOD_CRYPT_SC, __pyx_t_2) < 0) __PYX_ERR(1, 64, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "ssh2/session.pyx":75 - * LIBSSH2_METHOD_CRYPT_CS = MethodType(c_ssh2.LIBSSH2_METHOD_CRYPT_CS) - * LIBSSH2_METHOD_CRYPT_SC = MethodType(c_ssh2.LIBSSH2_METHOD_CRYPT_SC) - * LIBSSH2_METHOD_MAC_CS = MethodType(c_ssh2.LIBSSH2_METHOD_MAC_CS) # <<<<<<<<<<<<<< - * LIBSSH2_METHOD_MAC_SC = MethodType(c_ssh2.LIBSSH2_METHOD_MAC_SC) - * LIBSSH2_METHOD_COMP_CS = MethodType(c_ssh2.LIBSSH2_METHOD_COMP_CS) + /* "ssh2/session.pyx":65 + * LIBSSH2_METHOD_CRYPT_CS = MethodType(c_ssh2.LIBSSH2_METHOD_CRYPT_CS) + * LIBSSH2_METHOD_CRYPT_SC = MethodType(c_ssh2.LIBSSH2_METHOD_CRYPT_SC) + * LIBSSH2_METHOD_MAC_CS = MethodType(c_ssh2.LIBSSH2_METHOD_MAC_CS) # <<<<<<<<<<<<<< + * LIBSSH2_METHOD_MAC_SC = MethodType(c_ssh2.LIBSSH2_METHOD_MAC_SC) + * LIBSSH2_METHOD_COMP_CS = MethodType(c_ssh2.LIBSSH2_METHOD_COMP_CS) */ - __pyx_t_2 = __Pyx_PyInt_From_int(LIBSSH2_METHOD_MAC_CS); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 75, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(LIBSSH2_METHOD_MAC_CS); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_4ssh2_7session_MethodType), __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 75, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_4ssh2_7session_MethodType), __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_METHOD_MAC_CS, __pyx_t_1) < 0) __PYX_ERR(1, 75, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_METHOD_MAC_CS, __pyx_t_1) < 0) __PYX_ERR(1, 65, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/session.pyx":76 - * LIBSSH2_METHOD_CRYPT_SC = MethodType(c_ssh2.LIBSSH2_METHOD_CRYPT_SC) - * LIBSSH2_METHOD_MAC_CS = MethodType(c_ssh2.LIBSSH2_METHOD_MAC_CS) - * LIBSSH2_METHOD_MAC_SC = MethodType(c_ssh2.LIBSSH2_METHOD_MAC_SC) # <<<<<<<<<<<<<< - * LIBSSH2_METHOD_COMP_CS = MethodType(c_ssh2.LIBSSH2_METHOD_COMP_CS) - * LIBSSH2_METHOD_COMP_SC = MethodType(c_ssh2.LIBSSH2_METHOD_COMP_SC) + /* "ssh2/session.pyx":66 + * LIBSSH2_METHOD_CRYPT_SC = MethodType(c_ssh2.LIBSSH2_METHOD_CRYPT_SC) + * LIBSSH2_METHOD_MAC_CS = MethodType(c_ssh2.LIBSSH2_METHOD_MAC_CS) + * LIBSSH2_METHOD_MAC_SC = MethodType(c_ssh2.LIBSSH2_METHOD_MAC_SC) # <<<<<<<<<<<<<< + * LIBSSH2_METHOD_COMP_CS = MethodType(c_ssh2.LIBSSH2_METHOD_COMP_CS) + * LIBSSH2_METHOD_COMP_SC = MethodType(c_ssh2.LIBSSH2_METHOD_COMP_SC) */ - __pyx_t_1 = __Pyx_PyInt_From_int(LIBSSH2_METHOD_MAC_SC); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 76, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(LIBSSH2_METHOD_MAC_SC); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_4ssh2_7session_MethodType), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 76, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_4ssh2_7session_MethodType), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_METHOD_MAC_SC, __pyx_t_2) < 0) __PYX_ERR(1, 76, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_METHOD_MAC_SC, __pyx_t_2) < 0) __PYX_ERR(1, 66, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "ssh2/session.pyx":77 - * LIBSSH2_METHOD_MAC_CS = MethodType(c_ssh2.LIBSSH2_METHOD_MAC_CS) - * LIBSSH2_METHOD_MAC_SC = MethodType(c_ssh2.LIBSSH2_METHOD_MAC_SC) - * LIBSSH2_METHOD_COMP_CS = MethodType(c_ssh2.LIBSSH2_METHOD_COMP_CS) # <<<<<<<<<<<<<< - * LIBSSH2_METHOD_COMP_SC = MethodType(c_ssh2.LIBSSH2_METHOD_COMP_SC) - * LIBSSH2_METHOD_LANG_CS = MethodType(c_ssh2.LIBSSH2_METHOD_LANG_CS) + /* "ssh2/session.pyx":67 + * LIBSSH2_METHOD_MAC_CS = MethodType(c_ssh2.LIBSSH2_METHOD_MAC_CS) + * LIBSSH2_METHOD_MAC_SC = MethodType(c_ssh2.LIBSSH2_METHOD_MAC_SC) + * LIBSSH2_METHOD_COMP_CS = MethodType(c_ssh2.LIBSSH2_METHOD_COMP_CS) # <<<<<<<<<<<<<< + * LIBSSH2_METHOD_COMP_SC = MethodType(c_ssh2.LIBSSH2_METHOD_COMP_SC) + * LIBSSH2_METHOD_LANG_CS = MethodType(c_ssh2.LIBSSH2_METHOD_LANG_CS) */ - __pyx_t_2 = __Pyx_PyInt_From_int(LIBSSH2_METHOD_COMP_CS); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 77, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(LIBSSH2_METHOD_COMP_CS); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_4ssh2_7session_MethodType), __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 77, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_4ssh2_7session_MethodType), __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_METHOD_COMP_CS, __pyx_t_1) < 0) __PYX_ERR(1, 77, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_METHOD_COMP_CS, __pyx_t_1) < 0) __PYX_ERR(1, 67, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/session.pyx":78 - * LIBSSH2_METHOD_MAC_SC = MethodType(c_ssh2.LIBSSH2_METHOD_MAC_SC) - * LIBSSH2_METHOD_COMP_CS = MethodType(c_ssh2.LIBSSH2_METHOD_COMP_CS) - * LIBSSH2_METHOD_COMP_SC = MethodType(c_ssh2.LIBSSH2_METHOD_COMP_SC) # <<<<<<<<<<<<<< - * LIBSSH2_METHOD_LANG_CS = MethodType(c_ssh2.LIBSSH2_METHOD_LANG_CS) - * LIBSSH2_METHOD_LANG_SC = MethodType(c_ssh2.LIBSSH2_METHOD_LANG_SC) + /* "ssh2/session.pyx":68 + * LIBSSH2_METHOD_MAC_SC = MethodType(c_ssh2.LIBSSH2_METHOD_MAC_SC) + * LIBSSH2_METHOD_COMP_CS = MethodType(c_ssh2.LIBSSH2_METHOD_COMP_CS) + * LIBSSH2_METHOD_COMP_SC = MethodType(c_ssh2.LIBSSH2_METHOD_COMP_SC) # <<<<<<<<<<<<<< + * LIBSSH2_METHOD_LANG_CS = MethodType(c_ssh2.LIBSSH2_METHOD_LANG_CS) + * LIBSSH2_METHOD_LANG_SC = MethodType(c_ssh2.LIBSSH2_METHOD_LANG_SC) */ - __pyx_t_1 = __Pyx_PyInt_From_int(LIBSSH2_METHOD_COMP_SC); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 78, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(LIBSSH2_METHOD_COMP_SC); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_4ssh2_7session_MethodType), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 78, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_4ssh2_7session_MethodType), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_METHOD_COMP_SC, __pyx_t_2) < 0) __PYX_ERR(1, 78, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_METHOD_COMP_SC, __pyx_t_2) < 0) __PYX_ERR(1, 68, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "ssh2/session.pyx":79 - * LIBSSH2_METHOD_COMP_CS = MethodType(c_ssh2.LIBSSH2_METHOD_COMP_CS) - * LIBSSH2_METHOD_COMP_SC = MethodType(c_ssh2.LIBSSH2_METHOD_COMP_SC) - * LIBSSH2_METHOD_LANG_CS = MethodType(c_ssh2.LIBSSH2_METHOD_LANG_CS) # <<<<<<<<<<<<<< - * LIBSSH2_METHOD_LANG_SC = MethodType(c_ssh2.LIBSSH2_METHOD_LANG_SC) + /* "ssh2/session.pyx":69 + * LIBSSH2_METHOD_COMP_CS = MethodType(c_ssh2.LIBSSH2_METHOD_COMP_CS) + * LIBSSH2_METHOD_COMP_SC = MethodType(c_ssh2.LIBSSH2_METHOD_COMP_SC) + * LIBSSH2_METHOD_LANG_CS = MethodType(c_ssh2.LIBSSH2_METHOD_LANG_CS) # <<<<<<<<<<<<<< + * LIBSSH2_METHOD_LANG_SC = MethodType(c_ssh2.LIBSSH2_METHOD_LANG_SC) * */ - __pyx_t_2 = __Pyx_PyInt_From_int(LIBSSH2_METHOD_LANG_CS); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 79, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(LIBSSH2_METHOD_LANG_CS); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_4ssh2_7session_MethodType), __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 79, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_4ssh2_7session_MethodType), __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_METHOD_LANG_CS, __pyx_t_1) < 0) __PYX_ERR(1, 79, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_METHOD_LANG_CS, __pyx_t_1) < 0) __PYX_ERR(1, 69, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/session.pyx":80 - * LIBSSH2_METHOD_COMP_SC = MethodType(c_ssh2.LIBSSH2_METHOD_COMP_SC) - * LIBSSH2_METHOD_LANG_CS = MethodType(c_ssh2.LIBSSH2_METHOD_LANG_CS) - * LIBSSH2_METHOD_LANG_SC = MethodType(c_ssh2.LIBSSH2_METHOD_LANG_SC) # <<<<<<<<<<<<<< + /* "ssh2/session.pyx":70 + * LIBSSH2_METHOD_COMP_SC = MethodType(c_ssh2.LIBSSH2_METHOD_COMP_SC) + * LIBSSH2_METHOD_LANG_CS = MethodType(c_ssh2.LIBSSH2_METHOD_LANG_CS) + * LIBSSH2_METHOD_LANG_SC = MethodType(c_ssh2.LIBSSH2_METHOD_LANG_SC) # <<<<<<<<<<<<<< * * */ - __pyx_t_1 = __Pyx_PyInt_From_int(LIBSSH2_METHOD_LANG_SC); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 80, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(LIBSSH2_METHOD_LANG_SC); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_4ssh2_7session_MethodType), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 80, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_4ssh2_7session_MethodType), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_METHOD_LANG_SC, __pyx_t_2) < 0) __PYX_ERR(1, 80, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBSSH2_METHOD_LANG_SC, __pyx_t_2) < 0) __PYX_ERR(1, 70, __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 c6c3ea04..c88fb275 100644 --- a/ssh2/session.pyx +++ b/ssh2/session.pyx @@ -29,8 +29,7 @@ from publickey cimport PyPublicKeySystem from utils cimport to_bytes, to_str, handle_error_codes from statinfo cimport StatInfo from knownhost cimport PyKnownHost -IF EMBEDDED_LIB: - from fileinfo cimport FileInfo +from fileinfo cimport FileInfo cimport c_ssh2 @@ -43,19 +42,11 @@ 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_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 LIBSSH2_HOSTKEY_TYPE_UNKNOWN = c_ssh2.LIBSSH2_HOSTKEY_TYPE_UNKNOWN LIBSSH2_HOSTKEY_TYPE_RSA = c_ssh2.LIBSSH2_HOSTKEY_TYPE_RSA @@ -67,17 +58,16 @@ cdef class MethodType: self.value = value -IF EMBEDDED_LIB: - LIBSSH2_METHOD_KEX = MethodType(c_ssh2.LIBSSH2_METHOD_KEX) - LIBSSH2_METHOD_HOSTKEY = MethodType(c_ssh2.LIBSSH2_METHOD_HOSTKEY) - LIBSSH2_METHOD_CRYPT_CS = MethodType(c_ssh2.LIBSSH2_METHOD_CRYPT_CS) - LIBSSH2_METHOD_CRYPT_SC = MethodType(c_ssh2.LIBSSH2_METHOD_CRYPT_SC) - LIBSSH2_METHOD_MAC_CS = MethodType(c_ssh2.LIBSSH2_METHOD_MAC_CS) - LIBSSH2_METHOD_MAC_SC = MethodType(c_ssh2.LIBSSH2_METHOD_MAC_SC) - LIBSSH2_METHOD_COMP_CS = MethodType(c_ssh2.LIBSSH2_METHOD_COMP_CS) - LIBSSH2_METHOD_COMP_SC = MethodType(c_ssh2.LIBSSH2_METHOD_COMP_SC) - LIBSSH2_METHOD_LANG_CS = MethodType(c_ssh2.LIBSSH2_METHOD_LANG_CS) - LIBSSH2_METHOD_LANG_SC = MethodType(c_ssh2.LIBSSH2_METHOD_LANG_SC) +LIBSSH2_METHOD_KEX = MethodType(c_ssh2.LIBSSH2_METHOD_KEX) +LIBSSH2_METHOD_HOSTKEY = MethodType(c_ssh2.LIBSSH2_METHOD_HOSTKEY) +LIBSSH2_METHOD_CRYPT_CS = MethodType(c_ssh2.LIBSSH2_METHOD_CRYPT_CS) +LIBSSH2_METHOD_CRYPT_SC = MethodType(c_ssh2.LIBSSH2_METHOD_CRYPT_SC) +LIBSSH2_METHOD_MAC_CS = MethodType(c_ssh2.LIBSSH2_METHOD_MAC_CS) +LIBSSH2_METHOD_MAC_SC = MethodType(c_ssh2.LIBSSH2_METHOD_MAC_SC) +LIBSSH2_METHOD_COMP_CS = MethodType(c_ssh2.LIBSSH2_METHOD_COMP_CS) +LIBSSH2_METHOD_COMP_SC = MethodType(c_ssh2.LIBSSH2_METHOD_COMP_SC) +LIBSSH2_METHOD_LANG_CS = MethodType(c_ssh2.LIBSSH2_METHOD_LANG_CS) +LIBSSH2_METHOD_LANG_SC = MethodType(c_ssh2.LIBSSH2_METHOD_LANG_SC) cdef void kbd_callback(const char *name, int name_len, @@ -278,30 +268,29 @@ cdef class Session: _privatekey, _passphrase, _hostname) return handle_error_codes(rc) - IF EMBEDDED_LIB: - def userauth_publickey_frommemory( - self, username, bytes privatekeyfiledata, - 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 - cdef char *_passphrase = b_passphrase - cdef char *_publickeyfiledata = NULL - cdef char *_privatekeyfiledata = privatekeyfiledata - cdef size_t username_len, privatekeydata_len - cdef size_t pubkeydata_len = 0 - username_len, privatekeydata_len = \ - len(b_username), len(privatekeyfiledata) - if publickeyfiledata is not None: - _publickeyfiledata = publickeyfiledata - pubkeydata_len = len(publickeyfiledata) - with nogil: - rc = c_ssh2.libssh2_userauth_publickey_frommemory( - self._session, _username, username_len, _publickeyfiledata, - pubkeydata_len, _privatekeyfiledata, - privatekeydata_len, _passphrase) - return handle_error_codes(rc) + def userauth_publickey_frommemory( + self, username, bytes privatekeyfiledata, + 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 + cdef char *_passphrase = b_passphrase + cdef char *_publickeyfiledata = NULL + cdef char *_privatekeyfiledata = privatekeyfiledata + cdef size_t username_len, privatekeydata_len + cdef size_t pubkeydata_len = 0 + username_len, privatekeydata_len = \ + len(b_username), len(privatekeyfiledata) + if publickeyfiledata is not None: + _publickeyfiledata = publickeyfiledata + pubkeydata_len = len(publickeyfiledata) + with nogil: + rc = c_ssh2.libssh2_userauth_publickey_frommemory( + self._session, _username, username_len, _publickeyfiledata, + pubkeydata_len, _privatekeyfiledata, + privatekeydata_len, _passphrase) + return handle_error_codes(rc) def userauth_password(self, username not None, password not None): """Perform password authentication @@ -557,15 +546,14 @@ cdef class Session: self._session) return rc - 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 - with nogil: - rc = c_ssh2.libssh2_session_set_last_error( - self._session, errcode, _errmsg) - return rc + 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 + with nogil: + rc = c_ssh2.libssh2_session_set_last_error( + self._session, errcode, _errmsg) + return rc def scp_recv(self, path not None): """Receive file via SCP. @@ -589,28 +577,25 @@ cdef class Session: self._session)) return PyChannel(channel, self), statinfo - IF EMBEDDED_LIB: - def scp_recv2(self, path not None): - """Receive file via SCP. - - Available only on libssh2 >= 1.7. + def scp_recv2(self, path not None): + """Receive file via SCP. - :param path: File path to receive. - :type path: str + :param path: File path to receive. + :type path: str - :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 - cdef c_ssh2.LIBSSH2_CHANNEL *channel - with nogil: - channel = c_ssh2.libssh2_scp_recv2( - 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 + :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 + cdef c_ssh2.LIBSSH2_CHANNEL *channel + with nogil: + channel = c_ssh2.libssh2_scp_recv2( + 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 def scp_send(self, path not None, int mode, size_t size): """Deprecated in favour of scp_send64. Send file via SCP. diff --git a/ssh2/sftp.c b/ssh2/sftp.c index 5c4d9b08..277bcca3 100644 --- a/ssh2/sftp.c +++ b/ssh2/sftp.c @@ -622,7 +622,7 @@ static CYTHON_INLINE float __PYX_NAN() { #include "libssh2_sftp.h" #include #include -#include "find_eol.h" +#include "ext/find_eol.h" #ifdef _OPENMP #include #endif /* _OPENMP */ @@ -1710,8 +1710,8 @@ static int __pyx_pf_4ssh2_4sftp_4SFTP___cinit__(struct __pyx_obj_4ssh2_4sftp_SFT * self._session = session * * def __dealloc__(self): # <<<<<<<<<<<<<< - * with nogil: - * c_sftp.libssh2_sftp_shutdown(self._sftp) + * if self._session is not None and self._session._session is not NULL and self._sftp is not NULL: + * with nogil: */ /* Python wrapper */ @@ -1727,65 +1727,111 @@ static void __pyx_pw_4ssh2_4sftp_4SFTP_3__dealloc__(PyObject *__pyx_v_self) { static void __pyx_pf_4ssh2_4sftp_4SFTP_2__dealloc__(struct __pyx_obj_4ssh2_4sftp_SFTP *__pyx_v_self) { __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; __Pyx_RefNannySetupContext("__dealloc__", 0); /* "ssh2/sftp.pyx":181 * * def __dealloc__(self): - * with nogil: # <<<<<<<<<<<<<< - * c_sftp.libssh2_sftp_shutdown(self._sftp) + * if self._session is not None and self._session._session is not NULL and self._sftp is not NULL: # <<<<<<<<<<<<<< + * with nogil: + * c_sftp.libssh2_sftp_shutdown(self._sftp) + */ + __pyx_t_2 = (((PyObject *)__pyx_v_self->_session) != Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + } else { + __pyx_t_1 = __pyx_t_3; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_3 = ((__pyx_v_self->_session->_session != NULL) != 0); + if (__pyx_t_3) { + } else { + __pyx_t_1 = __pyx_t_3; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_3 = ((__pyx_v_self->_sftp != NULL) != 0); + __pyx_t_1 = __pyx_t_3; + __pyx_L4_bool_binop_done:; + if (__pyx_t_1) { + + /* "ssh2/sftp.pyx":182 + * def __dealloc__(self): + * if self._session is not None and self._session._session is not NULL and self._sftp is not NULL: + * with nogil: # <<<<<<<<<<<<<< + * c_sftp.libssh2_sftp_shutdown(self._sftp) + * self._sftp = NULL + */ + { + #ifdef WITH_THREAD + PyThreadState *_save; + Py_UNBLOCK_THREADS + __Pyx_FastGIL_Remember(); + #endif + /*try:*/ { + + /* "ssh2/sftp.pyx":183 + * if self._session is not None and self._session._session is not NULL and self._sftp is not NULL: + * with nogil: + * c_sftp.libssh2_sftp_shutdown(self._sftp) # <<<<<<<<<<<<<< + * self._sftp = NULL * */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - __Pyx_FastGIL_Remember(); - #endif - /*try:*/ { + (void)(libssh2_sftp_shutdown(__pyx_v_self->_sftp)); + } /* "ssh2/sftp.pyx":182 * def __dealloc__(self): - * with nogil: - * c_sftp.libssh2_sftp_shutdown(self._sftp) # <<<<<<<<<<<<<< - * - * @property + * if self._session is not None and self._session._session is not NULL and self._sftp is not NULL: + * with nogil: # <<<<<<<<<<<<<< + * c_sftp.libssh2_sftp_shutdown(self._sftp) + * self._sftp = NULL */ - (void)(libssh2_sftp_shutdown(__pyx_v_self->_sftp)); - } + /*finally:*/ { + /*normal exit:*/{ + #ifdef WITH_THREAD + __Pyx_FastGIL_Forget(); + Py_BLOCK_THREADS + #endif + goto __pyx_L9; + } + __pyx_L9:; + } + } - /* "ssh2/sftp.pyx":181 + /* "ssh2/sftp.pyx":181 * * def __dealloc__(self): - * with nogil: # <<<<<<<<<<<<<< - * c_sftp.libssh2_sftp_shutdown(self._sftp) - * + * if self._session is not None and self._session._session is not NULL and self._sftp is not NULL: # <<<<<<<<<<<<<< + * with nogil: + * c_sftp.libssh2_sftp_shutdown(self._sftp) */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - __Pyx_FastGIL_Forget(); - Py_BLOCK_THREADS - #endif - goto __pyx_L5; - } - __pyx_L5:; - } } + /* "ssh2/sftp.pyx":184 + * with nogil: + * c_sftp.libssh2_sftp_shutdown(self._sftp) + * self._sftp = NULL # <<<<<<<<<<<<<< + * + * @property + */ + __pyx_v_self->_sftp = NULL; + /* "ssh2/sftp.pyx":180 * self._session = session * * def __dealloc__(self): # <<<<<<<<<<<<<< - * with nogil: - * c_sftp.libssh2_sftp_shutdown(self._sftp) + * if self._session is not None and self._session._session is not NULL and self._sftp is not NULL: + * with nogil: */ /* function exit code */ __Pyx_RefNannyFinishContext(); } -/* "ssh2/sftp.pyx":185 +/* "ssh2/sftp.pyx":187 * * @property * def session(self): # <<<<<<<<<<<<<< @@ -1811,7 +1857,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_7session___get__(struct __pyx_obj_4s __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); - /* "ssh2/sftp.pyx":187 + /* "ssh2/sftp.pyx":189 * def session(self): * """Originating session.""" * return self._session # <<<<<<<<<<<<<< @@ -1823,7 +1869,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_7session___get__(struct __pyx_obj_4s __pyx_r = ((PyObject *)__pyx_v_self->_session); goto __pyx_L0; - /* "ssh2/sftp.pyx":185 + /* "ssh2/sftp.pyx":187 * * @property * def session(self): # <<<<<<<<<<<<<< @@ -1838,7 +1884,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_7session___get__(struct __pyx_obj_4s return __pyx_r; } -/* "ssh2/sftp.pyx":189 +/* "ssh2/sftp.pyx":191 * return self._session * * def get_channel(self): # <<<<<<<<<<<<<< @@ -1873,7 +1919,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_4get_channel(struct __pyx_obj_4ssh2_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_channel", 0); - /* "ssh2/sftp.pyx":192 + /* "ssh2/sftp.pyx":194 * """Get new channel from the SFTP session""" * cdef c_ssh2.LIBSSH2_CHANNEL *_channel * with nogil: # <<<<<<<<<<<<<< @@ -1888,7 +1934,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_4get_channel(struct __pyx_obj_4ssh2_ #endif /*try:*/ { - /* "ssh2/sftp.pyx":193 + /* "ssh2/sftp.pyx":195 * cdef c_ssh2.LIBSSH2_CHANNEL *_channel * with nogil: * _channel = c_sftp.libssh2_sftp_get_channel(self._sftp) # <<<<<<<<<<<<<< @@ -1898,7 +1944,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_4get_channel(struct __pyx_obj_4ssh2_ __pyx_v__channel = libssh2_sftp_get_channel(__pyx_v_self->_sftp); } - /* "ssh2/sftp.pyx":192 + /* "ssh2/sftp.pyx":194 * """Get new channel from the SFTP session""" * cdef c_ssh2.LIBSSH2_CHANNEL *_channel * with nogil: # <<<<<<<<<<<<<< @@ -1917,7 +1963,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_4get_channel(struct __pyx_obj_4ssh2_ } } - /* "ssh2/sftp.pyx":194 + /* "ssh2/sftp.pyx":196 * with nogil: * _channel = c_sftp.libssh2_sftp_get_channel(self._sftp) * if _channel is NULL: # <<<<<<<<<<<<<< @@ -1927,7 +1973,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_4get_channel(struct __pyx_obj_4ssh2_ __pyx_t_1 = ((__pyx_v__channel == NULL) != 0); if (__pyx_t_1) { - /* "ssh2/sftp.pyx":195 + /* "ssh2/sftp.pyx":197 * _channel = c_sftp.libssh2_sftp_get_channel(self._sftp) * if _channel is NULL: * return handle_error_codes(c_ssh2.libssh2_session_last_errno( # <<<<<<<<<<<<<< @@ -1936,29 +1982,29 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_4get_channel(struct __pyx_obj_4ssh2_ */ __Pyx_XDECREF(__pyx_r); - /* "ssh2/sftp.pyx":196 + /* "ssh2/sftp.pyx":198 * if _channel is NULL: * return handle_error_codes(c_ssh2.libssh2_session_last_errno( * self._session._session)) # <<<<<<<<<<<<<< * return PyChannel(_channel, self._session) * */ - __pyx_t_2 = __pyx_f_4ssh2_5utils_handle_error_codes(libssh2_session_last_errno(__pyx_v_self->_session->_session), 0); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 195, __pyx_L1_error) + __pyx_t_2 = __pyx_f_4ssh2_5utils_handle_error_codes(libssh2_session_last_errno(__pyx_v_self->_session->_session), 0); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 197, __pyx_L1_error) - /* "ssh2/sftp.pyx":195 + /* "ssh2/sftp.pyx":197 * _channel = c_sftp.libssh2_sftp_get_channel(self._sftp) * if _channel is NULL: * return handle_error_codes(c_ssh2.libssh2_session_last_errno( # <<<<<<<<<<<<<< * self._session._session)) * return PyChannel(_channel, self._session) */ - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 195, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - /* "ssh2/sftp.pyx":194 + /* "ssh2/sftp.pyx":196 * with nogil: * _channel = c_sftp.libssh2_sftp_get_channel(self._sftp) * if _channel is NULL: # <<<<<<<<<<<<<< @@ -1967,7 +2013,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_4get_channel(struct __pyx_obj_4ssh2_ */ } - /* "ssh2/sftp.pyx":197 + /* "ssh2/sftp.pyx":199 * return handle_error_codes(c_ssh2.libssh2_session_last_errno( * self._session._session)) * return PyChannel(_channel, self._session) # <<<<<<<<<<<<<< @@ -1977,14 +2023,14 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_4get_channel(struct __pyx_obj_4ssh2_ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = ((PyObject *)__pyx_v_self->_session); __Pyx_INCREF(__pyx_t_3); - __pyx_t_4 = __pyx_f_4ssh2_7channel_PyChannel(__pyx_v__channel, ((struct __pyx_obj_4ssh2_7session_Session *)__pyx_t_3)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 197, __pyx_L1_error) + __pyx_t_4 = __pyx_f_4ssh2_7channel_PyChannel(__pyx_v__channel, ((struct __pyx_obj_4ssh2_7session_Session *)__pyx_t_3)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; - /* "ssh2/sftp.pyx":189 + /* "ssh2/sftp.pyx":191 * return self._session * * def get_channel(self): # <<<<<<<<<<<<<< @@ -2004,7 +2050,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_4get_channel(struct __pyx_obj_4ssh2_ return __pyx_r; } -/* "ssh2/sftp.pyx":199 +/* "ssh2/sftp.pyx":201 * return PyChannel(_channel, self._session) * * def open_ex(self, const char *filename, # <<<<<<<<<<<<<< @@ -2056,29 +2102,29 @@ static PyObject *__pyx_pw_4ssh2_4sftp_4SFTP_7open_ex(PyObject *__pyx_v_self, PyO case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_filename_len)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("open_ex", 1, 5, 5, 1); __PYX_ERR(0, 199, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("open_ex", 1, 5, 5, 1); __PYX_ERR(0, 201, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("open_ex", 1, 5, 5, 2); __PYX_ERR(0, 199, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("open_ex", 1, 5, 5, 2); __PYX_ERR(0, 201, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("open_ex", 1, 5, 5, 3); __PYX_ERR(0, 199, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("open_ex", 1, 5, 5, 3); __PYX_ERR(0, 201, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_open_type)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("open_ex", 1, 5, 5, 4); __PYX_ERR(0, 199, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("open_ex", 1, 5, 5, 4); __PYX_ERR(0, 201, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "open_ex") < 0)) __PYX_ERR(0, 199, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "open_ex") < 0)) __PYX_ERR(0, 201, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 5) { goto __pyx_L5_argtuple_error; @@ -2089,15 +2135,15 @@ static PyObject *__pyx_pw_4ssh2_4sftp_4SFTP_7open_ex(PyObject *__pyx_v_self, PyO values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[4] = PyTuple_GET_ITEM(__pyx_args, 4); } - __pyx_v_filename = __Pyx_PyObject_AsString(values[0]); if (unlikely((!__pyx_v_filename) && PyErr_Occurred())) __PYX_ERR(0, 199, __pyx_L3_error) - __pyx_v_filename_len = __Pyx_PyInt_As_unsigned_int(values[1]); if (unlikely((__pyx_v_filename_len == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 200, __pyx_L3_error) - __pyx_v_flags = __Pyx_PyInt_As_unsigned_long(values[2]); if (unlikely((__pyx_v_flags == (unsigned long)-1) && PyErr_Occurred())) __PYX_ERR(0, 201, __pyx_L3_error) - __pyx_v_mode = __Pyx_PyInt_As_long(values[3]); if (unlikely((__pyx_v_mode == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 202, __pyx_L3_error) - __pyx_v_open_type = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_open_type == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 202, __pyx_L3_error) + __pyx_v_filename = __Pyx_PyObject_AsString(values[0]); if (unlikely((!__pyx_v_filename) && PyErr_Occurred())) __PYX_ERR(0, 201, __pyx_L3_error) + __pyx_v_filename_len = __Pyx_PyInt_As_unsigned_int(values[1]); if (unlikely((__pyx_v_filename_len == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 202, __pyx_L3_error) + __pyx_v_flags = __Pyx_PyInt_As_unsigned_long(values[2]); if (unlikely((__pyx_v_flags == (unsigned long)-1) && PyErr_Occurred())) __PYX_ERR(0, 203, __pyx_L3_error) + __pyx_v_mode = __Pyx_PyInt_As_long(values[3]); if (unlikely((__pyx_v_mode == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 204, __pyx_L3_error) + __pyx_v_open_type = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_open_type == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 204, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("open_ex", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 199, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("open_ex", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 201, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.sftp.SFTP.open_ex", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -2123,7 +2169,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_6open_ex(struct __pyx_obj_4ssh2_4sft int __pyx_clineno = 0; __Pyx_RefNannySetupContext("open_ex", 0); - /* "ssh2/sftp.pyx":205 + /* "ssh2/sftp.pyx":207 * cdef c_sftp.LIBSSH2_SFTP_HANDLE *_handle * cdef SFTPHandle handle * with nogil: # <<<<<<<<<<<<<< @@ -2138,7 +2184,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_6open_ex(struct __pyx_obj_4ssh2_4sft #endif /*try:*/ { - /* "ssh2/sftp.pyx":206 + /* "ssh2/sftp.pyx":208 * cdef SFTPHandle handle * with nogil: * _handle = c_sftp.libssh2_sftp_open_ex( # <<<<<<<<<<<<<< @@ -2148,7 +2194,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_6open_ex(struct __pyx_obj_4ssh2_4sft __pyx_v__handle = libssh2_sftp_open_ex(__pyx_v_self->_sftp, __pyx_v_filename, __pyx_v_filename_len, __pyx_v_flags, __pyx_v_mode, __pyx_v_open_type); } - /* "ssh2/sftp.pyx":205 + /* "ssh2/sftp.pyx":207 * cdef c_sftp.LIBSSH2_SFTP_HANDLE *_handle * cdef SFTPHandle handle * with nogil: # <<<<<<<<<<<<<< @@ -2167,7 +2213,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_6open_ex(struct __pyx_obj_4ssh2_4sft } } - /* "ssh2/sftp.pyx":209 + /* "ssh2/sftp.pyx":211 * self._sftp, filename, filename_len, flags, * mode, open_type) * if _handle is NULL: # <<<<<<<<<<<<<< @@ -2177,7 +2223,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_6open_ex(struct __pyx_obj_4ssh2_4sft __pyx_t_1 = ((__pyx_v__handle == NULL) != 0); if (__pyx_t_1) { - /* "ssh2/sftp.pyx":210 + /* "ssh2/sftp.pyx":212 * mode, open_type) * if _handle is NULL: * return handle_error_codes(c_ssh2.libssh2_session_last_errno( # <<<<<<<<<<<<<< @@ -2186,29 +2232,29 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_6open_ex(struct __pyx_obj_4ssh2_4sft */ __Pyx_XDECREF(__pyx_r); - /* "ssh2/sftp.pyx":211 + /* "ssh2/sftp.pyx":213 * if _handle is NULL: * return handle_error_codes(c_ssh2.libssh2_session_last_errno( * self._session._session)) # <<<<<<<<<<<<<< * handle = PySFTPHandle(_handle, self) * return handle */ - __pyx_t_2 = __pyx_f_4ssh2_5utils_handle_error_codes(libssh2_session_last_errno(__pyx_v_self->_session->_session), 0); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 210, __pyx_L1_error) + __pyx_t_2 = __pyx_f_4ssh2_5utils_handle_error_codes(libssh2_session_last_errno(__pyx_v_self->_session->_session), 0); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 212, __pyx_L1_error) - /* "ssh2/sftp.pyx":210 + /* "ssh2/sftp.pyx":212 * mode, open_type) * if _handle is NULL: * return handle_error_codes(c_ssh2.libssh2_session_last_errno( # <<<<<<<<<<<<<< * self._session._session)) * handle = PySFTPHandle(_handle, self) */ - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 210, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - /* "ssh2/sftp.pyx":209 + /* "ssh2/sftp.pyx":211 * self._sftp, filename, filename_len, flags, * mode, open_type) * if _handle is NULL: # <<<<<<<<<<<<<< @@ -2217,20 +2263,20 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_6open_ex(struct __pyx_obj_4ssh2_4sft */ } - /* "ssh2/sftp.pyx":212 + /* "ssh2/sftp.pyx":214 * return handle_error_codes(c_ssh2.libssh2_session_last_errno( * self._session._session)) * handle = PySFTPHandle(_handle, self) # <<<<<<<<<<<<<< * return handle * */ - __pyx_t_3 = __pyx_f_4ssh2_11sftp_handle_PySFTPHandle(__pyx_v__handle, __pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 212, __pyx_L1_error) + __pyx_t_3 = __pyx_f_4ssh2_11sftp_handle_PySFTPHandle(__pyx_v__handle, __pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 214, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_4ssh2_11sftp_handle_SFTPHandle))))) __PYX_ERR(0, 212, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_4ssh2_11sftp_handle_SFTPHandle))))) __PYX_ERR(0, 214, __pyx_L1_error) __pyx_v_handle = ((struct __pyx_obj_4ssh2_11sftp_handle_SFTPHandle *)__pyx_t_3); __pyx_t_3 = 0; - /* "ssh2/sftp.pyx":213 + /* "ssh2/sftp.pyx":215 * self._session._session)) * handle = PySFTPHandle(_handle, self) * return handle # <<<<<<<<<<<<<< @@ -2242,7 +2288,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_6open_ex(struct __pyx_obj_4ssh2_4sft __pyx_r = ((PyObject *)__pyx_v_handle); goto __pyx_L0; - /* "ssh2/sftp.pyx":199 + /* "ssh2/sftp.pyx":201 * return PyChannel(_channel, self._session) * * def open_ex(self, const char *filename, # <<<<<<<<<<<<<< @@ -2262,7 +2308,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_6open_ex(struct __pyx_obj_4ssh2_4sft return __pyx_r; } -/* "ssh2/sftp.pyx":215 +/* "ssh2/sftp.pyx":217 * return handle * * def open(self, filename not None, # <<<<<<<<<<<<<< @@ -2308,17 +2354,17 @@ static PyObject *__pyx_pw_4ssh2_4sftp_4SFTP_9open(PyObject *__pyx_v_self, PyObje case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("open", 1, 3, 3, 1); __PYX_ERR(0, 215, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("open", 1, 3, 3, 1); __PYX_ERR(0, 217, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("open", 1, 3, 3, 2); __PYX_ERR(0, 215, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("open", 1, 3, 3, 2); __PYX_ERR(0, 217, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "open") < 0)) __PYX_ERR(0, 215, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "open") < 0)) __PYX_ERR(0, 217, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -2328,19 +2374,19 @@ static PyObject *__pyx_pw_4ssh2_4sftp_4SFTP_9open(PyObject *__pyx_v_self, PyObje values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_filename = values[0]; - __pyx_v_flags = __Pyx_PyInt_As_unsigned_long(values[1]); if (unlikely((__pyx_v_flags == (unsigned long)-1) && PyErr_Occurred())) __PYX_ERR(0, 216, __pyx_L3_error) - __pyx_v_mode = __Pyx_PyInt_As_long(values[2]); if (unlikely((__pyx_v_mode == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 217, __pyx_L3_error) + __pyx_v_flags = __Pyx_PyInt_As_unsigned_long(values[1]); if (unlikely((__pyx_v_flags == (unsigned long)-1) && PyErr_Occurred())) __PYX_ERR(0, 218, __pyx_L3_error) + __pyx_v_mode = __Pyx_PyInt_As_long(values[2]); if (unlikely((__pyx_v_mode == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 219, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("open", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 215, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("open", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 217, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.sftp.SFTP.open", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(((PyObject *)__pyx_v_filename) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "filename"); __PYX_ERR(0, 215, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "filename"); __PYX_ERR(0, 217, __pyx_L1_error) } __pyx_r = __pyx_pf_4ssh2_4sftp_4SFTP_8open(((struct __pyx_obj_4ssh2_4sftp_SFTP *)__pyx_v_self), __pyx_v_filename, __pyx_v_flags, __pyx_v_mode); @@ -2368,19 +2414,19 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_8open(struct __pyx_obj_4ssh2_4sftp_S int __pyx_clineno = 0; __Pyx_RefNannySetupContext("open", 0); - /* "ssh2/sftp.pyx":248 + /* "ssh2/sftp.pyx":250 * """ # noqa: W605 * cdef c_sftp.LIBSSH2_SFTP_HANDLE *_handle * cdef bytes b_filename = to_bytes(filename) # <<<<<<<<<<<<<< * cdef char *_filename = b_filename * with nogil: */ - __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_filename); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 248, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_filename); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_b_filename = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/sftp.pyx":249 + /* "ssh2/sftp.pyx":251 * cdef c_sftp.LIBSSH2_SFTP_HANDLE *_handle * cdef bytes b_filename = to_bytes(filename) * cdef char *_filename = b_filename # <<<<<<<<<<<<<< @@ -2389,12 +2435,12 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_8open(struct __pyx_obj_4ssh2_4sftp_S */ if (unlikely(__pyx_v_b_filename == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 249, __pyx_L1_error) + __PYX_ERR(0, 251, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_filename); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 249, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_filename); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 251, __pyx_L1_error) __pyx_v__filename = __pyx_t_2; - /* "ssh2/sftp.pyx":250 + /* "ssh2/sftp.pyx":252 * cdef bytes b_filename = to_bytes(filename) * cdef char *_filename = b_filename * with nogil: # <<<<<<<<<<<<<< @@ -2409,7 +2455,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_8open(struct __pyx_obj_4ssh2_4sftp_S #endif /*try:*/ { - /* "ssh2/sftp.pyx":251 + /* "ssh2/sftp.pyx":253 * cdef char *_filename = b_filename * with nogil: * _handle = c_sftp.libssh2_sftp_open( # <<<<<<<<<<<<<< @@ -2419,7 +2465,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_8open(struct __pyx_obj_4ssh2_4sftp_S __pyx_v__handle = libssh2_sftp_open(__pyx_v_self->_sftp, __pyx_v__filename, __pyx_v_flags, __pyx_v_mode); } - /* "ssh2/sftp.pyx":250 + /* "ssh2/sftp.pyx":252 * cdef bytes b_filename = to_bytes(filename) * cdef char *_filename = b_filename * with nogil: # <<<<<<<<<<<<<< @@ -2438,7 +2484,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_8open(struct __pyx_obj_4ssh2_4sftp_S } } - /* "ssh2/sftp.pyx":253 + /* "ssh2/sftp.pyx":255 * _handle = c_sftp.libssh2_sftp_open( * self._sftp, _filename, flags, mode) * if _handle is NULL: # <<<<<<<<<<<<<< @@ -2448,7 +2494,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_8open(struct __pyx_obj_4ssh2_4sftp_S __pyx_t_3 = ((__pyx_v__handle == NULL) != 0); if (__pyx_t_3) { - /* "ssh2/sftp.pyx":254 + /* "ssh2/sftp.pyx":256 * self._sftp, _filename, flags, mode) * if _handle is NULL: * return handle_error_codes(c_ssh2.libssh2_session_last_errno( # <<<<<<<<<<<<<< @@ -2457,29 +2503,29 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_8open(struct __pyx_obj_4ssh2_4sftp_S */ __Pyx_XDECREF(__pyx_r); - /* "ssh2/sftp.pyx":255 + /* "ssh2/sftp.pyx":257 * if _handle is NULL: * return handle_error_codes(c_ssh2.libssh2_session_last_errno( * self._session._session)) # <<<<<<<<<<<<<< * return PySFTPHandle(_handle, self) * */ - __pyx_t_4 = __pyx_f_4ssh2_5utils_handle_error_codes(libssh2_session_last_errno(__pyx_v_self->_session->_session), 0); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 254, __pyx_L1_error) + __pyx_t_4 = __pyx_f_4ssh2_5utils_handle_error_codes(libssh2_session_last_errno(__pyx_v_self->_session->_session), 0); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 256, __pyx_L1_error) - /* "ssh2/sftp.pyx":254 + /* "ssh2/sftp.pyx":256 * self._sftp, _filename, flags, mode) * if _handle is NULL: * return handle_error_codes(c_ssh2.libssh2_session_last_errno( # <<<<<<<<<<<<<< * self._session._session)) * return PySFTPHandle(_handle, self) */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 254, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/sftp.pyx":253 + /* "ssh2/sftp.pyx":255 * _handle = c_sftp.libssh2_sftp_open( * self._sftp, _filename, flags, mode) * if _handle is NULL: # <<<<<<<<<<<<<< @@ -2488,7 +2534,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_8open(struct __pyx_obj_4ssh2_4sftp_S */ } - /* "ssh2/sftp.pyx":256 + /* "ssh2/sftp.pyx":258 * return handle_error_codes(c_ssh2.libssh2_session_last_errno( * self._session._session)) * return PySFTPHandle(_handle, self) # <<<<<<<<<<<<<< @@ -2496,13 +2542,13 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_8open(struct __pyx_obj_4ssh2_4sftp_S * def opendir(self, path not None): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_4ssh2_11sftp_handle_PySFTPHandle(__pyx_v__handle, __pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 256, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_11sftp_handle_PySFTPHandle(__pyx_v__handle, __pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/sftp.pyx":215 + /* "ssh2/sftp.pyx":217 * return handle * * def open(self, filename not None, # <<<<<<<<<<<<<< @@ -2522,7 +2568,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_8open(struct __pyx_obj_4ssh2_4sftp_S return __pyx_r; } -/* "ssh2/sftp.pyx":258 +/* "ssh2/sftp.pyx":260 * return PySFTPHandle(_handle, self) * * def opendir(self, path not None): # <<<<<<<<<<<<<< @@ -2541,7 +2587,7 @@ static PyObject *__pyx_pw_4ssh2_4sftp_4SFTP_11opendir(PyObject *__pyx_v_self, Py __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("opendir (wrapper)", 0); if (unlikely(((PyObject *)__pyx_v_path) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "path"); __PYX_ERR(0, 258, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "path"); __PYX_ERR(0, 260, __pyx_L1_error) } __pyx_r = __pyx_pf_4ssh2_4sftp_4SFTP_10opendir(((struct __pyx_obj_4ssh2_4sftp_SFTP *)__pyx_v_self), ((PyObject *)__pyx_v_path)); @@ -2569,19 +2615,19 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_10opendir(struct __pyx_obj_4ssh2_4sf int __pyx_clineno = 0; __Pyx_RefNannySetupContext("opendir", 0); - /* "ssh2/sftp.pyx":270 + /* "ssh2/sftp.pyx":272 * """ * cdef c_sftp.LIBSSH2_SFTP_HANDLE *_handle * cdef bytes b_path = to_bytes(path) # <<<<<<<<<<<<<< * cdef char *_path = b_path * with nogil: */ - __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 270, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_b_path = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/sftp.pyx":271 + /* "ssh2/sftp.pyx":273 * cdef c_sftp.LIBSSH2_SFTP_HANDLE *_handle * cdef bytes b_path = to_bytes(path) * cdef char *_path = b_path # <<<<<<<<<<<<<< @@ -2590,12 +2636,12 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_10opendir(struct __pyx_obj_4ssh2_4sf */ if (unlikely(__pyx_v_b_path == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 271, __pyx_L1_error) + __PYX_ERR(0, 273, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_path); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 271, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_path); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 273, __pyx_L1_error) __pyx_v__path = __pyx_t_2; - /* "ssh2/sftp.pyx":272 + /* "ssh2/sftp.pyx":274 * cdef bytes b_path = to_bytes(path) * cdef char *_path = b_path * with nogil: # <<<<<<<<<<<<<< @@ -2610,7 +2656,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_10opendir(struct __pyx_obj_4ssh2_4sf #endif /*try:*/ { - /* "ssh2/sftp.pyx":273 + /* "ssh2/sftp.pyx":275 * cdef char *_path = b_path * with nogil: * _handle = c_sftp.libssh2_sftp_opendir(self._sftp, _path) # <<<<<<<<<<<<<< @@ -2620,7 +2666,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_10opendir(struct __pyx_obj_4ssh2_4sf __pyx_v__handle = libssh2_sftp_opendir(__pyx_v_self->_sftp, __pyx_v__path); } - /* "ssh2/sftp.pyx":272 + /* "ssh2/sftp.pyx":274 * cdef bytes b_path = to_bytes(path) * cdef char *_path = b_path * with nogil: # <<<<<<<<<<<<<< @@ -2639,7 +2685,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_10opendir(struct __pyx_obj_4ssh2_4sf } } - /* "ssh2/sftp.pyx":274 + /* "ssh2/sftp.pyx":276 * with nogil: * _handle = c_sftp.libssh2_sftp_opendir(self._sftp, _path) * if _handle is NULL: # <<<<<<<<<<<<<< @@ -2649,7 +2695,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_10opendir(struct __pyx_obj_4ssh2_4sf __pyx_t_3 = ((__pyx_v__handle == NULL) != 0); if (__pyx_t_3) { - /* "ssh2/sftp.pyx":275 + /* "ssh2/sftp.pyx":277 * _handle = c_sftp.libssh2_sftp_opendir(self._sftp, _path) * if _handle is NULL: * return handle_error_codes(c_ssh2.libssh2_session_last_errno( # <<<<<<<<<<<<<< @@ -2658,29 +2704,29 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_10opendir(struct __pyx_obj_4ssh2_4sf */ __Pyx_XDECREF(__pyx_r); - /* "ssh2/sftp.pyx":276 + /* "ssh2/sftp.pyx":278 * if _handle is NULL: * return handle_error_codes(c_ssh2.libssh2_session_last_errno( * self._session._session)) # <<<<<<<<<<<<<< * return PySFTPHandle(_handle, self) * */ - __pyx_t_4 = __pyx_f_4ssh2_5utils_handle_error_codes(libssh2_session_last_errno(__pyx_v_self->_session->_session), 0); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 275, __pyx_L1_error) + __pyx_t_4 = __pyx_f_4ssh2_5utils_handle_error_codes(libssh2_session_last_errno(__pyx_v_self->_session->_session), 0); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 277, __pyx_L1_error) - /* "ssh2/sftp.pyx":275 + /* "ssh2/sftp.pyx":277 * _handle = c_sftp.libssh2_sftp_opendir(self._sftp, _path) * if _handle is NULL: * return handle_error_codes(c_ssh2.libssh2_session_last_errno( # <<<<<<<<<<<<<< * self._session._session)) * return PySFTPHandle(_handle, self) */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 275, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/sftp.pyx":274 + /* "ssh2/sftp.pyx":276 * with nogil: * _handle = c_sftp.libssh2_sftp_opendir(self._sftp, _path) * if _handle is NULL: # <<<<<<<<<<<<<< @@ -2689,7 +2735,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_10opendir(struct __pyx_obj_4ssh2_4sf */ } - /* "ssh2/sftp.pyx":277 + /* "ssh2/sftp.pyx":279 * return handle_error_codes(c_ssh2.libssh2_session_last_errno( * self._session._session)) * return PySFTPHandle(_handle, self) # <<<<<<<<<<<<<< @@ -2697,13 +2743,13 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_10opendir(struct __pyx_obj_4ssh2_4sf * def rename_ex(self, const char *source_filename, */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_4ssh2_11sftp_handle_PySFTPHandle(__pyx_v__handle, __pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 277, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_11sftp_handle_PySFTPHandle(__pyx_v__handle, __pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 279, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/sftp.pyx":258 + /* "ssh2/sftp.pyx":260 * return PySFTPHandle(_handle, self) * * def opendir(self, path not None): # <<<<<<<<<<<<<< @@ -2723,7 +2769,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_10opendir(struct __pyx_obj_4ssh2_4sf return __pyx_r; } -/* "ssh2/sftp.pyx":279 +/* "ssh2/sftp.pyx":281 * return PySFTPHandle(_handle, self) * * def rename_ex(self, const char *source_filename, # <<<<<<<<<<<<<< @@ -2775,29 +2821,29 @@ static PyObject *__pyx_pw_4ssh2_4sftp_4SFTP_13rename_ex(PyObject *__pyx_v_self, case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_source_filename_len)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("rename_ex", 1, 5, 5, 1); __PYX_ERR(0, 279, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("rename_ex", 1, 5, 5, 1); __PYX_ERR(0, 281, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dest_filename)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("rename_ex", 1, 5, 5, 2); __PYX_ERR(0, 279, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("rename_ex", 1, 5, 5, 2); __PYX_ERR(0, 281, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dest_filename_len)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("rename_ex", 1, 5, 5, 3); __PYX_ERR(0, 279, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("rename_ex", 1, 5, 5, 3); __PYX_ERR(0, 281, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("rename_ex", 1, 5, 5, 4); __PYX_ERR(0, 279, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("rename_ex", 1, 5, 5, 4); __PYX_ERR(0, 281, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "rename_ex") < 0)) __PYX_ERR(0, 279, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "rename_ex") < 0)) __PYX_ERR(0, 281, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 5) { goto __pyx_L5_argtuple_error; @@ -2808,15 +2854,15 @@ static PyObject *__pyx_pw_4ssh2_4sftp_4SFTP_13rename_ex(PyObject *__pyx_v_self, values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[4] = PyTuple_GET_ITEM(__pyx_args, 4); } - __pyx_v_source_filename = __Pyx_PyObject_AsString(values[0]); if (unlikely((!__pyx_v_source_filename) && PyErr_Occurred())) __PYX_ERR(0, 279, __pyx_L3_error) - __pyx_v_source_filename_len = __Pyx_PyInt_As_unsigned_int(values[1]); if (unlikely((__pyx_v_source_filename_len == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 280, __pyx_L3_error) - __pyx_v_dest_filename = __Pyx_PyObject_AsString(values[2]); if (unlikely((!__pyx_v_dest_filename) && PyErr_Occurred())) __PYX_ERR(0, 281, __pyx_L3_error) - __pyx_v_dest_filename_len = __Pyx_PyInt_As_unsigned_int(values[3]); if (unlikely((__pyx_v_dest_filename_len == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 282, __pyx_L3_error) - __pyx_v_flags = __Pyx_PyInt_As_long(values[4]); if (unlikely((__pyx_v_flags == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 283, __pyx_L3_error) + __pyx_v_source_filename = __Pyx_PyObject_AsString(values[0]); if (unlikely((!__pyx_v_source_filename) && PyErr_Occurred())) __PYX_ERR(0, 281, __pyx_L3_error) + __pyx_v_source_filename_len = __Pyx_PyInt_As_unsigned_int(values[1]); if (unlikely((__pyx_v_source_filename_len == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 282, __pyx_L3_error) + __pyx_v_dest_filename = __Pyx_PyObject_AsString(values[2]); if (unlikely((!__pyx_v_dest_filename) && PyErr_Occurred())) __PYX_ERR(0, 283, __pyx_L3_error) + __pyx_v_dest_filename_len = __Pyx_PyInt_As_unsigned_int(values[3]); if (unlikely((__pyx_v_dest_filename_len == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 284, __pyx_L3_error) + __pyx_v_flags = __Pyx_PyInt_As_long(values[4]); if (unlikely((__pyx_v_flags == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 285, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("rename_ex", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 279, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("rename_ex", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 281, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.sftp.SFTP.rename_ex", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -2840,7 +2886,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_12rename_ex(struct __pyx_obj_4ssh2_4 int __pyx_clineno = 0; __Pyx_RefNannySetupContext("rename_ex", 0); - /* "ssh2/sftp.pyx":285 + /* "ssh2/sftp.pyx":287 * long flags): * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -2855,7 +2901,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_12rename_ex(struct __pyx_obj_4ssh2_4 #endif /*try:*/ { - /* "ssh2/sftp.pyx":286 + /* "ssh2/sftp.pyx":288 * cdef int rc * with nogil: * rc = c_sftp.libssh2_sftp_rename_ex( # <<<<<<<<<<<<<< @@ -2865,7 +2911,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_12rename_ex(struct __pyx_obj_4ssh2_4 __pyx_v_rc = libssh2_sftp_rename_ex(__pyx_v_self->_sftp, __pyx_v_source_filename, __pyx_v_source_filename_len, __pyx_v_dest_filename, __pyx_v_dest_filename_len, __pyx_v_flags); } - /* "ssh2/sftp.pyx":285 + /* "ssh2/sftp.pyx":287 * long flags): * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -2884,7 +2930,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_12rename_ex(struct __pyx_obj_4ssh2_4 } } - /* "ssh2/sftp.pyx":289 + /* "ssh2/sftp.pyx":291 * self._sftp, source_filename, source_filename_len, * dest_filename, dest_filename_len, flags) * return handle_error_codes(rc) # <<<<<<<<<<<<<< @@ -2892,14 +2938,14 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_12rename_ex(struct __pyx_obj_4ssh2_4 * def rename(self, source_filename not None, dest_filename not None): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_4ssh2_5utils_handle_error_codes(__pyx_v_rc, 0); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 289, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 289, __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, 291, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 291, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "ssh2/sftp.pyx":279 + /* "ssh2/sftp.pyx":281 * return PySFTPHandle(_handle, self) * * def rename_ex(self, const char *source_filename, # <<<<<<<<<<<<<< @@ -2918,7 +2964,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_12rename_ex(struct __pyx_obj_4ssh2_4 return __pyx_r; } -/* "ssh2/sftp.pyx":291 +/* "ssh2/sftp.pyx":293 * return handle_error_codes(rc) * * def rename(self, source_filename not None, dest_filename not None): # <<<<<<<<<<<<<< @@ -2961,11 +3007,11 @@ static PyObject *__pyx_pw_4ssh2_4sftp_4SFTP_15rename(PyObject *__pyx_v_self, PyO case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dest_filename)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("rename", 1, 2, 2, 1); __PYX_ERR(0, 291, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("rename", 1, 2, 2, 1); __PYX_ERR(0, 293, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "rename") < 0)) __PYX_ERR(0, 291, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "rename") < 0)) __PYX_ERR(0, 293, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -2978,17 +3024,17 @@ static PyObject *__pyx_pw_4ssh2_4sftp_4SFTP_15rename(PyObject *__pyx_v_self, PyO } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("rename", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 291, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("rename", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 293, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.sftp.SFTP.rename", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(((PyObject *)__pyx_v_source_filename) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "source_filename"); __PYX_ERR(0, 291, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "source_filename"); __PYX_ERR(0, 293, __pyx_L1_error) } if (unlikely(((PyObject *)__pyx_v_dest_filename) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "dest_filename"); __PYX_ERR(0, 291, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "dest_filename"); __PYX_ERR(0, 293, __pyx_L1_error) } __pyx_r = __pyx_pf_4ssh2_4sftp_4SFTP_14rename(((struct __pyx_obj_4ssh2_4sftp_SFTP *)__pyx_v_self), __pyx_v_source_filename, __pyx_v_dest_filename); @@ -3017,31 +3063,31 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_14rename(struct __pyx_obj_4ssh2_4sft int __pyx_clineno = 0; __Pyx_RefNannySetupContext("rename", 0); - /* "ssh2/sftp.pyx":299 + /* "ssh2/sftp.pyx":301 * :type dest_filename: str""" * cdef int rc * cdef bytes b_source_filename = to_bytes(source_filename) # <<<<<<<<<<<<<< * cdef bytes b_dest_filename = to_bytes(dest_filename) * cdef char *_source_filename = b_source_filename */ - __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_source_filename); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 299, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_source_filename); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_b_source_filename = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/sftp.pyx":300 + /* "ssh2/sftp.pyx":302 * cdef int rc * cdef bytes b_source_filename = to_bytes(source_filename) * cdef bytes b_dest_filename = to_bytes(dest_filename) # <<<<<<<<<<<<<< * cdef char *_source_filename = b_source_filename * cdef char *_dest_filename = b_dest_filename */ - __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_dest_filename); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 300, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_dest_filename); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 302, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_b_dest_filename = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/sftp.pyx":301 + /* "ssh2/sftp.pyx":303 * cdef bytes b_source_filename = to_bytes(source_filename) * cdef bytes b_dest_filename = to_bytes(dest_filename) * cdef char *_source_filename = b_source_filename # <<<<<<<<<<<<<< @@ -3050,12 +3096,12 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_14rename(struct __pyx_obj_4ssh2_4sft */ if (unlikely(__pyx_v_b_source_filename == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 301, __pyx_L1_error) + __PYX_ERR(0, 303, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_source_filename); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 301, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_source_filename); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 303, __pyx_L1_error) __pyx_v__source_filename = __pyx_t_2; - /* "ssh2/sftp.pyx":302 + /* "ssh2/sftp.pyx":304 * cdef bytes b_dest_filename = to_bytes(dest_filename) * cdef char *_source_filename = b_source_filename * cdef char *_dest_filename = b_dest_filename # <<<<<<<<<<<<<< @@ -3064,12 +3110,12 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_14rename(struct __pyx_obj_4ssh2_4sft */ if (unlikely(__pyx_v_b_dest_filename == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 302, __pyx_L1_error) + __PYX_ERR(0, 304, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_dest_filename); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 302, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_dest_filename); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 304, __pyx_L1_error) __pyx_v__dest_filename = __pyx_t_2; - /* "ssh2/sftp.pyx":303 + /* "ssh2/sftp.pyx":305 * cdef char *_source_filename = b_source_filename * cdef char *_dest_filename = b_dest_filename * with nogil: # <<<<<<<<<<<<<< @@ -3084,7 +3130,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_14rename(struct __pyx_obj_4ssh2_4sft #endif /*try:*/ { - /* "ssh2/sftp.pyx":304 + /* "ssh2/sftp.pyx":306 * cdef char *_dest_filename = b_dest_filename * with nogil: * rc = c_sftp.libssh2_sftp_rename( # <<<<<<<<<<<<<< @@ -3094,7 +3140,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_14rename(struct __pyx_obj_4ssh2_4sft __pyx_v_rc = libssh2_sftp_rename(__pyx_v_self->_sftp, __pyx_v__source_filename, __pyx_v__dest_filename); } - /* "ssh2/sftp.pyx":303 + /* "ssh2/sftp.pyx":305 * cdef char *_source_filename = b_source_filename * cdef char *_dest_filename = b_dest_filename * with nogil: # <<<<<<<<<<<<<< @@ -3113,7 +3159,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_14rename(struct __pyx_obj_4ssh2_4sft } } - /* "ssh2/sftp.pyx":306 + /* "ssh2/sftp.pyx":308 * rc = c_sftp.libssh2_sftp_rename( * self._sftp, _source_filename, _dest_filename) * return handle_error_codes(rc) # <<<<<<<<<<<<<< @@ -3121,14 +3167,14 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_14rename(struct __pyx_obj_4ssh2_4sft * def unlink(self, filename not None): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __pyx_f_4ssh2_5utils_handle_error_codes(__pyx_v_rc, 0); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 306, __pyx_L1_error) - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 306, __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, 308, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 308, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/sftp.pyx":291 + /* "ssh2/sftp.pyx":293 * return handle_error_codes(rc) * * def rename(self, source_filename not None, dest_filename not None): # <<<<<<<<<<<<<< @@ -3149,7 +3195,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_14rename(struct __pyx_obj_4ssh2_4sft return __pyx_r; } -/* "ssh2/sftp.pyx":308 +/* "ssh2/sftp.pyx":310 * return handle_error_codes(rc) * * def unlink(self, filename not None): # <<<<<<<<<<<<<< @@ -3168,7 +3214,7 @@ static PyObject *__pyx_pw_4ssh2_4sftp_4SFTP_17unlink(PyObject *__pyx_v_self, PyO __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("unlink (wrapper)", 0); if (unlikely(((PyObject *)__pyx_v_filename) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "filename"); __PYX_ERR(0, 308, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "filename"); __PYX_ERR(0, 310, __pyx_L1_error) } __pyx_r = __pyx_pf_4ssh2_4sftp_4SFTP_16unlink(((struct __pyx_obj_4ssh2_4sftp_SFTP *)__pyx_v_self), ((PyObject *)__pyx_v_filename)); @@ -3195,19 +3241,19 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_16unlink(struct __pyx_obj_4ssh2_4sft int __pyx_clineno = 0; __Pyx_RefNannySetupContext("unlink", 0); - /* "ssh2/sftp.pyx":314 + /* "ssh2/sftp.pyx":316 * :type filename: str""" * cdef int rc * cdef bytes b_filename = to_bytes(filename) # <<<<<<<<<<<<<< * cdef char *_filename = b_filename * with nogil: */ - __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_filename); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 314, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_filename); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 316, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_b_filename = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/sftp.pyx":315 + /* "ssh2/sftp.pyx":317 * cdef int rc * cdef bytes b_filename = to_bytes(filename) * cdef char *_filename = b_filename # <<<<<<<<<<<<<< @@ -3216,12 +3262,12 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_16unlink(struct __pyx_obj_4ssh2_4sft */ if (unlikely(__pyx_v_b_filename == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 315, __pyx_L1_error) + __PYX_ERR(0, 317, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_filename); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 315, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_filename); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 317, __pyx_L1_error) __pyx_v__filename = __pyx_t_2; - /* "ssh2/sftp.pyx":316 + /* "ssh2/sftp.pyx":318 * cdef bytes b_filename = to_bytes(filename) * cdef char *_filename = b_filename * with nogil: # <<<<<<<<<<<<<< @@ -3236,7 +3282,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_16unlink(struct __pyx_obj_4ssh2_4sft #endif /*try:*/ { - /* "ssh2/sftp.pyx":317 + /* "ssh2/sftp.pyx":319 * cdef char *_filename = b_filename * with nogil: * rc = c_sftp.libssh2_sftp_unlink(self._sftp, _filename) # <<<<<<<<<<<<<< @@ -3246,7 +3292,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_16unlink(struct __pyx_obj_4ssh2_4sft __pyx_v_rc = libssh2_sftp_unlink(__pyx_v_self->_sftp, __pyx_v__filename); } - /* "ssh2/sftp.pyx":316 + /* "ssh2/sftp.pyx":318 * cdef bytes b_filename = to_bytes(filename) * cdef char *_filename = b_filename * with nogil: # <<<<<<<<<<<<<< @@ -3265,7 +3311,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_16unlink(struct __pyx_obj_4ssh2_4sft } } - /* "ssh2/sftp.pyx":318 + /* "ssh2/sftp.pyx":320 * with nogil: * rc = c_sftp.libssh2_sftp_unlink(self._sftp, _filename) * return handle_error_codes(rc) # <<<<<<<<<<<<<< @@ -3273,14 +3319,14 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_16unlink(struct __pyx_obj_4ssh2_4sft * def statvfs(self, path): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __pyx_f_4ssh2_5utils_handle_error_codes(__pyx_v_rc, 0); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 318, __pyx_L1_error) - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 318, __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, 320, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 320, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/sftp.pyx":308 + /* "ssh2/sftp.pyx":310 * return handle_error_codes(rc) * * def unlink(self, filename not None): # <<<<<<<<<<<<<< @@ -3300,7 +3346,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_16unlink(struct __pyx_obj_4ssh2_4sft return __pyx_r; } -/* "ssh2/sftp.pyx":320 +/* "ssh2/sftp.pyx":322 * return handle_error_codes(rc) * * def statvfs(self, path): # <<<<<<<<<<<<<< @@ -3340,31 +3386,31 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_18statvfs(struct __pyx_obj_4ssh2_4sf int __pyx_clineno = 0; __Pyx_RefNannySetupContext("statvfs", 0); - /* "ssh2/sftp.pyx":324 + /* "ssh2/sftp.pyx":326 * * :rtype: `ssh2.sftp.SFTPStatVFS` or int of error code""" * cdef SFTPStatVFS vfs = SFTPStatVFS(self) # <<<<<<<<<<<<<< * cdef bytes b_path = to_bytes(path) * cdef char *_path = b_path */ - __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_4ssh2_11sftp_handle_SFTPStatVFS), ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 324, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_4ssh2_11sftp_handle_SFTPStatVFS), ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 326, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_vfs = ((struct __pyx_obj_4ssh2_11sftp_handle_SFTPStatVFS *)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/sftp.pyx":325 + /* "ssh2/sftp.pyx":327 * :rtype: `ssh2.sftp.SFTPStatVFS` or int of error code""" * cdef SFTPStatVFS vfs = SFTPStatVFS(self) * cdef bytes b_path = to_bytes(path) # <<<<<<<<<<<<<< * cdef char *_path = b_path * cdef size_t path_len = len(b_path) */ - __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 325, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 327, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_b_path = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/sftp.pyx":326 + /* "ssh2/sftp.pyx":328 * cdef SFTPStatVFS vfs = SFTPStatVFS(self) * cdef bytes b_path = to_bytes(path) * cdef char *_path = b_path # <<<<<<<<<<<<<< @@ -3373,12 +3419,12 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_18statvfs(struct __pyx_obj_4ssh2_4sf */ if (unlikely(__pyx_v_b_path == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 326, __pyx_L1_error) + __PYX_ERR(0, 328, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_path); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 326, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_path); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 328, __pyx_L1_error) __pyx_v__path = __pyx_t_2; - /* "ssh2/sftp.pyx":327 + /* "ssh2/sftp.pyx":329 * cdef bytes b_path = to_bytes(path) * cdef char *_path = b_path * cdef size_t path_len = len(b_path) # <<<<<<<<<<<<<< @@ -3387,12 +3433,12 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_18statvfs(struct __pyx_obj_4ssh2_4sf */ if (unlikely(__pyx_v_b_path == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 327, __pyx_L1_error) + __PYX_ERR(0, 329, __pyx_L1_error) } - __pyx_t_3 = PyBytes_GET_SIZE(__pyx_v_b_path); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 327, __pyx_L1_error) + __pyx_t_3 = PyBytes_GET_SIZE(__pyx_v_b_path); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 329, __pyx_L1_error) __pyx_v_path_len = __pyx_t_3; - /* "ssh2/sftp.pyx":328 + /* "ssh2/sftp.pyx":330 * cdef char *_path = b_path * cdef size_t path_len = len(b_path) * with nogil: # <<<<<<<<<<<<<< @@ -3407,7 +3453,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_18statvfs(struct __pyx_obj_4ssh2_4sf #endif /*try:*/ { - /* "ssh2/sftp.pyx":329 + /* "ssh2/sftp.pyx":331 * cdef size_t path_len = len(b_path) * with nogil: * rc = c_sftp.libssh2_sftp_statvfs( # <<<<<<<<<<<<<< @@ -3417,7 +3463,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_18statvfs(struct __pyx_obj_4ssh2_4sf __pyx_v_rc = libssh2_sftp_statvfs(__pyx_v_self->_sftp, __pyx_v__path, __pyx_v_path_len, __pyx_v_vfs->_ptr); } - /* "ssh2/sftp.pyx":328 + /* "ssh2/sftp.pyx":330 * cdef char *_path = b_path * cdef size_t path_len = len(b_path) * with nogil: # <<<<<<<<<<<<<< @@ -3436,7 +3482,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_18statvfs(struct __pyx_obj_4ssh2_4sf } } - /* "ssh2/sftp.pyx":331 + /* "ssh2/sftp.pyx":333 * rc = c_sftp.libssh2_sftp_statvfs( * self._sftp, _path, path_len, vfs._ptr) * return handle_error_codes(rc) if rc != 0 else vfs # <<<<<<<<<<<<<< @@ -3445,8 +3491,8 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_18statvfs(struct __pyx_obj_4ssh2_4sf */ __Pyx_XDECREF(__pyx_r); if (((__pyx_v_rc != 0) != 0)) { - __pyx_t_4 = __pyx_f_4ssh2_5utils_handle_error_codes(__pyx_v_rc, 0); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 331, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 331, __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, 333, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 333, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __pyx_t_5 = 0; @@ -3458,7 +3504,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_18statvfs(struct __pyx_obj_4ssh2_4sf __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/sftp.pyx":320 + /* "ssh2/sftp.pyx":322 * return handle_error_codes(rc) * * def statvfs(self, path): # <<<<<<<<<<<<<< @@ -3480,7 +3526,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_18statvfs(struct __pyx_obj_4ssh2_4sf return __pyx_r; } -/* "ssh2/sftp.pyx":333 +/* "ssh2/sftp.pyx":335 * return handle_error_codes(rc) if rc != 0 else vfs * * def mkdir(self, path not None, long mode): # <<<<<<<<<<<<<< @@ -3523,11 +3569,11 @@ static PyObject *__pyx_pw_4ssh2_4sftp_4SFTP_21mkdir(PyObject *__pyx_v_self, PyOb case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("mkdir", 1, 2, 2, 1); __PYX_ERR(0, 333, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("mkdir", 1, 2, 2, 1); __PYX_ERR(0, 335, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "mkdir") < 0)) __PYX_ERR(0, 333, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "mkdir") < 0)) __PYX_ERR(0, 335, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -3536,18 +3582,18 @@ static PyObject *__pyx_pw_4ssh2_4sftp_4SFTP_21mkdir(PyObject *__pyx_v_self, PyOb values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_path = values[0]; - __pyx_v_mode = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v_mode == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 333, __pyx_L3_error) + __pyx_v_mode = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v_mode == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 335, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("mkdir", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 333, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("mkdir", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 335, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.sftp.SFTP.mkdir", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(((PyObject *)__pyx_v_path) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "path"); __PYX_ERR(0, 333, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "path"); __PYX_ERR(0, 335, __pyx_L1_error) } __pyx_r = __pyx_pf_4ssh2_4sftp_4SFTP_20mkdir(((struct __pyx_obj_4ssh2_4sftp_SFTP *)__pyx_v_self), __pyx_v_path, __pyx_v_mode); @@ -3574,19 +3620,19 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_20mkdir(struct __pyx_obj_4ssh2_4sftp int __pyx_clineno = 0; __Pyx_RefNannySetupContext("mkdir", 0); - /* "ssh2/sftp.pyx":346 + /* "ssh2/sftp.pyx":348 * """ * cdef int rc * cdef bytes b_path = to_bytes(path) # <<<<<<<<<<<<<< * cdef char *_path = b_path * with nogil: */ - __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 346, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 348, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_b_path = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/sftp.pyx":347 + /* "ssh2/sftp.pyx":349 * cdef int rc * cdef bytes b_path = to_bytes(path) * cdef char *_path = b_path # <<<<<<<<<<<<<< @@ -3595,12 +3641,12 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_20mkdir(struct __pyx_obj_4ssh2_4sftp */ if (unlikely(__pyx_v_b_path == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 347, __pyx_L1_error) + __PYX_ERR(0, 349, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_path); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 347, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_path); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 349, __pyx_L1_error) __pyx_v__path = __pyx_t_2; - /* "ssh2/sftp.pyx":348 + /* "ssh2/sftp.pyx":350 * cdef bytes b_path = to_bytes(path) * cdef char *_path = b_path * with nogil: # <<<<<<<<<<<<<< @@ -3615,7 +3661,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_20mkdir(struct __pyx_obj_4ssh2_4sftp #endif /*try:*/ { - /* "ssh2/sftp.pyx":349 + /* "ssh2/sftp.pyx":351 * cdef char *_path = b_path * with nogil: * rc = c_sftp.libssh2_sftp_mkdir(self._sftp, _path, mode) # <<<<<<<<<<<<<< @@ -3625,7 +3671,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_20mkdir(struct __pyx_obj_4ssh2_4sftp __pyx_v_rc = libssh2_sftp_mkdir(__pyx_v_self->_sftp, __pyx_v__path, __pyx_v_mode); } - /* "ssh2/sftp.pyx":348 + /* "ssh2/sftp.pyx":350 * cdef bytes b_path = to_bytes(path) * cdef char *_path = b_path * with nogil: # <<<<<<<<<<<<<< @@ -3644,7 +3690,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_20mkdir(struct __pyx_obj_4ssh2_4sftp } } - /* "ssh2/sftp.pyx":350 + /* "ssh2/sftp.pyx":352 * with nogil: * rc = c_sftp.libssh2_sftp_mkdir(self._sftp, _path, mode) * return handle_error_codes(rc) # <<<<<<<<<<<<<< @@ -3652,14 +3698,14 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_20mkdir(struct __pyx_obj_4ssh2_4sftp * def rmdir(self, path not None): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __pyx_f_4ssh2_5utils_handle_error_codes(__pyx_v_rc, 0); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 350, __pyx_L1_error) - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 350, __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, 352, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 352, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/sftp.pyx":333 + /* "ssh2/sftp.pyx":335 * return handle_error_codes(rc) if rc != 0 else vfs * * def mkdir(self, path not None, long mode): # <<<<<<<<<<<<<< @@ -3679,7 +3725,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_20mkdir(struct __pyx_obj_4ssh2_4sftp return __pyx_r; } -/* "ssh2/sftp.pyx":352 +/* "ssh2/sftp.pyx":354 * return handle_error_codes(rc) * * def rmdir(self, path not None): # <<<<<<<<<<<<<< @@ -3698,7 +3744,7 @@ static PyObject *__pyx_pw_4ssh2_4sftp_4SFTP_23rmdir(PyObject *__pyx_v_self, PyOb __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("rmdir (wrapper)", 0); if (unlikely(((PyObject *)__pyx_v_path) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "path"); __PYX_ERR(0, 352, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "path"); __PYX_ERR(0, 354, __pyx_L1_error) } __pyx_r = __pyx_pf_4ssh2_4sftp_4SFTP_22rmdir(((struct __pyx_obj_4ssh2_4sftp_SFTP *)__pyx_v_self), ((PyObject *)__pyx_v_path)); @@ -3725,19 +3771,19 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_22rmdir(struct __pyx_obj_4ssh2_4sftp int __pyx_clineno = 0; __Pyx_RefNannySetupContext("rmdir", 0); - /* "ssh2/sftp.pyx":360 + /* "ssh2/sftp.pyx":362 * :rtype: int""" * cdef int rc * cdef bytes b_path = to_bytes(path) # <<<<<<<<<<<<<< * cdef char *_path = b_path * with nogil: */ - __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 360, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 362, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_b_path = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/sftp.pyx":361 + /* "ssh2/sftp.pyx":363 * cdef int rc * cdef bytes b_path = to_bytes(path) * cdef char *_path = b_path # <<<<<<<<<<<<<< @@ -3746,12 +3792,12 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_22rmdir(struct __pyx_obj_4ssh2_4sftp */ if (unlikely(__pyx_v_b_path == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 361, __pyx_L1_error) + __PYX_ERR(0, 363, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_path); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 361, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_path); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 363, __pyx_L1_error) __pyx_v__path = __pyx_t_2; - /* "ssh2/sftp.pyx":362 + /* "ssh2/sftp.pyx":364 * cdef bytes b_path = to_bytes(path) * cdef char *_path = b_path * with nogil: # <<<<<<<<<<<<<< @@ -3766,7 +3812,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_22rmdir(struct __pyx_obj_4ssh2_4sftp #endif /*try:*/ { - /* "ssh2/sftp.pyx":363 + /* "ssh2/sftp.pyx":365 * cdef char *_path = b_path * with nogil: * rc = c_sftp.libssh2_sftp_rmdir(self._sftp, _path) # <<<<<<<<<<<<<< @@ -3776,7 +3822,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_22rmdir(struct __pyx_obj_4ssh2_4sftp __pyx_v_rc = libssh2_sftp_rmdir(__pyx_v_self->_sftp, __pyx_v__path); } - /* "ssh2/sftp.pyx":362 + /* "ssh2/sftp.pyx":364 * cdef bytes b_path = to_bytes(path) * cdef char *_path = b_path * with nogil: # <<<<<<<<<<<<<< @@ -3795,7 +3841,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_22rmdir(struct __pyx_obj_4ssh2_4sftp } } - /* "ssh2/sftp.pyx":364 + /* "ssh2/sftp.pyx":366 * with nogil: * rc = c_sftp.libssh2_sftp_rmdir(self._sftp, _path) * return handle_error_codes(rc) # <<<<<<<<<<<<<< @@ -3803,14 +3849,14 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_22rmdir(struct __pyx_obj_4ssh2_4sftp * def stat(self, path not None): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __pyx_f_4ssh2_5utils_handle_error_codes(__pyx_v_rc, 0); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 364, __pyx_L1_error) - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 364, __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, 366, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 366, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/sftp.pyx":352 + /* "ssh2/sftp.pyx":354 * return handle_error_codes(rc) * * def rmdir(self, path not None): # <<<<<<<<<<<<<< @@ -3830,7 +3876,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_22rmdir(struct __pyx_obj_4ssh2_4sftp return __pyx_r; } -/* "ssh2/sftp.pyx":366 +/* "ssh2/sftp.pyx":368 * return handle_error_codes(rc) * * def stat(self, path not None): # <<<<<<<<<<<<<< @@ -3849,7 +3895,7 @@ static PyObject *__pyx_pw_4ssh2_4sftp_4SFTP_25stat(PyObject *__pyx_v_self, PyObj __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("stat (wrapper)", 0); if (unlikely(((PyObject *)__pyx_v_path) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "path"); __PYX_ERR(0, 366, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "path"); __PYX_ERR(0, 368, __pyx_L1_error) } __pyx_r = __pyx_pf_4ssh2_4sftp_4SFTP_24stat(((struct __pyx_obj_4ssh2_4sftp_SFTP *)__pyx_v_self), ((PyObject *)__pyx_v_path)); @@ -3878,19 +3924,19 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_24stat(struct __pyx_obj_4ssh2_4sftp_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("stat", 0); - /* "ssh2/sftp.pyx":375 + /* "ssh2/sftp.pyx":377 * LIBSSH2_ERROR_EAGAIN""" * cdef int rc * cdef bytes b_path = to_bytes(path) # <<<<<<<<<<<<<< * cdef char *_path = b_path * cdef SFTPAttributes attrs = SFTPAttributes() */ - __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 375, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 377, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_b_path = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/sftp.pyx":376 + /* "ssh2/sftp.pyx":378 * cdef int rc * cdef bytes b_path = to_bytes(path) * cdef char *_path = b_path # <<<<<<<<<<<<<< @@ -3899,24 +3945,24 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_24stat(struct __pyx_obj_4ssh2_4sftp_ */ if (unlikely(__pyx_v_b_path == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 376, __pyx_L1_error) + __PYX_ERR(0, 378, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_path); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 376, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_path); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 378, __pyx_L1_error) __pyx_v__path = __pyx_t_2; - /* "ssh2/sftp.pyx":377 + /* "ssh2/sftp.pyx":379 * cdef bytes b_path = to_bytes(path) * cdef char *_path = b_path * cdef SFTPAttributes attrs = SFTPAttributes() # <<<<<<<<<<<<<< * with nogil: * rc = c_sftp.libssh2_sftp_stat( */ - __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_4ssh2_11sftp_handle_SFTPAttributes)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 377, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_4ssh2_11sftp_handle_SFTPAttributes)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_attrs = ((struct __pyx_obj_4ssh2_11sftp_handle_SFTPAttributes *)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/sftp.pyx":378 + /* "ssh2/sftp.pyx":380 * cdef char *_path = b_path * cdef SFTPAttributes attrs = SFTPAttributes() * with nogil: # <<<<<<<<<<<<<< @@ -3931,7 +3977,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_24stat(struct __pyx_obj_4ssh2_4sftp_ #endif /*try:*/ { - /* "ssh2/sftp.pyx":379 + /* "ssh2/sftp.pyx":381 * cdef SFTPAttributes attrs = SFTPAttributes() * with nogil: * rc = c_sftp.libssh2_sftp_stat( # <<<<<<<<<<<<<< @@ -3941,7 +3987,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_24stat(struct __pyx_obj_4ssh2_4sftp_ __pyx_v_rc = libssh2_sftp_stat(__pyx_v_self->_sftp, __pyx_v__path, __pyx_v_attrs->_attrs); } - /* "ssh2/sftp.pyx":378 + /* "ssh2/sftp.pyx":380 * cdef char *_path = b_path * cdef SFTPAttributes attrs = SFTPAttributes() * with nogil: # <<<<<<<<<<<<<< @@ -3960,7 +4006,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_24stat(struct __pyx_obj_4ssh2_4sftp_ } } - /* "ssh2/sftp.pyx":381 + /* "ssh2/sftp.pyx":383 * rc = c_sftp.libssh2_sftp_stat( * self._sftp, _path, attrs._attrs) * return handle_error_codes(rc) if rc != 0 else attrs # <<<<<<<<<<<<<< @@ -3969,8 +4015,8 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_24stat(struct __pyx_obj_4ssh2_4sftp_ */ __Pyx_XDECREF(__pyx_r); if (((__pyx_v_rc != 0) != 0)) { - __pyx_t_3 = __pyx_f_4ssh2_5utils_handle_error_codes(__pyx_v_rc, 0); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 381, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 381, __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, 383, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 383, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = __pyx_t_4; __pyx_t_4 = 0; @@ -3982,7 +4028,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_24stat(struct __pyx_obj_4ssh2_4sftp_ __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/sftp.pyx":366 + /* "ssh2/sftp.pyx":368 * return handle_error_codes(rc) * * def stat(self, path not None): # <<<<<<<<<<<<<< @@ -4004,7 +4050,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_24stat(struct __pyx_obj_4ssh2_4sftp_ return __pyx_r; } -/* "ssh2/sftp.pyx":383 +/* "ssh2/sftp.pyx":385 * return handle_error_codes(rc) if rc != 0 else attrs * * def lstat(self, path not None): # <<<<<<<<<<<<<< @@ -4023,7 +4069,7 @@ static PyObject *__pyx_pw_4ssh2_4sftp_4SFTP_27lstat(PyObject *__pyx_v_self, PyOb __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("lstat (wrapper)", 0); if (unlikely(((PyObject *)__pyx_v_path) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "path"); __PYX_ERR(0, 383, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "path"); __PYX_ERR(0, 385, __pyx_L1_error) } __pyx_r = __pyx_pf_4ssh2_4sftp_4SFTP_26lstat(((struct __pyx_obj_4ssh2_4sftp_SFTP *)__pyx_v_self), ((PyObject *)__pyx_v_path)); @@ -4052,19 +4098,19 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_26lstat(struct __pyx_obj_4ssh2_4sftp int __pyx_clineno = 0; __Pyx_RefNannySetupContext("lstat", 0); - /* "ssh2/sftp.pyx":386 + /* "ssh2/sftp.pyx":388 * """Link stat a file.""" * cdef int rc * cdef bytes b_path = to_bytes(path) # <<<<<<<<<<<<<< * cdef char *_path = b_path * cdef SFTPAttributes attrs = SFTPAttributes() */ - __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 386, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 388, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_b_path = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/sftp.pyx":387 + /* "ssh2/sftp.pyx":389 * cdef int rc * cdef bytes b_path = to_bytes(path) * cdef char *_path = b_path # <<<<<<<<<<<<<< @@ -4073,24 +4119,24 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_26lstat(struct __pyx_obj_4ssh2_4sftp */ if (unlikely(__pyx_v_b_path == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 387, __pyx_L1_error) + __PYX_ERR(0, 389, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_path); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 387, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_path); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 389, __pyx_L1_error) __pyx_v__path = __pyx_t_2; - /* "ssh2/sftp.pyx":388 + /* "ssh2/sftp.pyx":390 * cdef bytes b_path = to_bytes(path) * cdef char *_path = b_path * cdef SFTPAttributes attrs = SFTPAttributes() # <<<<<<<<<<<<<< * with nogil: * rc = c_sftp.libssh2_sftp_lstat( */ - __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_4ssh2_11sftp_handle_SFTPAttributes)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 388, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_4ssh2_11sftp_handle_SFTPAttributes)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 390, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_attrs = ((struct __pyx_obj_4ssh2_11sftp_handle_SFTPAttributes *)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/sftp.pyx":389 + /* "ssh2/sftp.pyx":391 * cdef char *_path = b_path * cdef SFTPAttributes attrs = SFTPAttributes() * with nogil: # <<<<<<<<<<<<<< @@ -4105,7 +4151,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_26lstat(struct __pyx_obj_4ssh2_4sftp #endif /*try:*/ { - /* "ssh2/sftp.pyx":390 + /* "ssh2/sftp.pyx":392 * cdef SFTPAttributes attrs = SFTPAttributes() * with nogil: * rc = c_sftp.libssh2_sftp_lstat( # <<<<<<<<<<<<<< @@ -4115,7 +4161,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_26lstat(struct __pyx_obj_4ssh2_4sftp __pyx_v_rc = libssh2_sftp_lstat(__pyx_v_self->_sftp, __pyx_v__path, __pyx_v_attrs->_attrs); } - /* "ssh2/sftp.pyx":389 + /* "ssh2/sftp.pyx":391 * cdef char *_path = b_path * cdef SFTPAttributes attrs = SFTPAttributes() * with nogil: # <<<<<<<<<<<<<< @@ -4134,7 +4180,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_26lstat(struct __pyx_obj_4ssh2_4sftp } } - /* "ssh2/sftp.pyx":392 + /* "ssh2/sftp.pyx":394 * rc = c_sftp.libssh2_sftp_lstat( * self._sftp, _path, attrs._attrs) * return handle_error_codes(rc) if rc != 0 else attrs # <<<<<<<<<<<<<< @@ -4143,8 +4189,8 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_26lstat(struct __pyx_obj_4ssh2_4sftp */ __Pyx_XDECREF(__pyx_r); if (((__pyx_v_rc != 0) != 0)) { - __pyx_t_3 = __pyx_f_4ssh2_5utils_handle_error_codes(__pyx_v_rc, 0); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 392, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 392, __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, 394, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 394, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = __pyx_t_4; __pyx_t_4 = 0; @@ -4156,7 +4202,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_26lstat(struct __pyx_obj_4ssh2_4sftp __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/sftp.pyx":383 + /* "ssh2/sftp.pyx":385 * return handle_error_codes(rc) if rc != 0 else attrs * * def lstat(self, path not None): # <<<<<<<<<<<<<< @@ -4178,7 +4224,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_26lstat(struct __pyx_obj_4ssh2_4sftp return __pyx_r; } -/* "ssh2/sftp.pyx":394 +/* "ssh2/sftp.pyx":396 * return handle_error_codes(rc) if rc != 0 else attrs * * def setstat(self, path not None, SFTPAttributes attrs): # <<<<<<<<<<<<<< @@ -4221,11 +4267,11 @@ static PyObject *__pyx_pw_4ssh2_4sftp_4SFTP_29setstat(PyObject *__pyx_v_self, Py case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_attrs)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("setstat", 1, 2, 2, 1); __PYX_ERR(0, 394, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("setstat", 1, 2, 2, 1); __PYX_ERR(0, 396, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setstat") < 0)) __PYX_ERR(0, 394, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setstat") < 0)) __PYX_ERR(0, 396, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -4238,16 +4284,16 @@ static PyObject *__pyx_pw_4ssh2_4sftp_4SFTP_29setstat(PyObject *__pyx_v_self, Py } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("setstat", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 394, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("setstat", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 396, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.sftp.SFTP.setstat", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(((PyObject *)__pyx_v_path) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "path"); __PYX_ERR(0, 394, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "path"); __PYX_ERR(0, 396, __pyx_L1_error) } - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_attrs), __pyx_ptype_4ssh2_11sftp_handle_SFTPAttributes, 1, "attrs", 0))) __PYX_ERR(0, 394, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_attrs), __pyx_ptype_4ssh2_11sftp_handle_SFTPAttributes, 1, "attrs", 0))) __PYX_ERR(0, 396, __pyx_L1_error) __pyx_r = __pyx_pf_4ssh2_4sftp_4SFTP_28setstat(((struct __pyx_obj_4ssh2_4sftp_SFTP *)__pyx_v_self), __pyx_v_path, __pyx_v_attrs); /* function exit code */ @@ -4273,19 +4319,19 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_28setstat(struct __pyx_obj_4ssh2_4sf int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setstat", 0); - /* "ssh2/sftp.pyx":404 + /* "ssh2/sftp.pyx":406 * :rtype: int""" * cdef int rc * cdef bytes b_path = to_bytes(path) # <<<<<<<<<<<<<< * cdef char *_path = b_path * with nogil: */ - __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 404, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 406, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_b_path = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/sftp.pyx":405 + /* "ssh2/sftp.pyx":407 * cdef int rc * cdef bytes b_path = to_bytes(path) * cdef char *_path = b_path # <<<<<<<<<<<<<< @@ -4294,12 +4340,12 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_28setstat(struct __pyx_obj_4ssh2_4sf */ if (unlikely(__pyx_v_b_path == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 405, __pyx_L1_error) + __PYX_ERR(0, 407, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_path); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 405, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_path); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 407, __pyx_L1_error) __pyx_v__path = __pyx_t_2; - /* "ssh2/sftp.pyx":406 + /* "ssh2/sftp.pyx":408 * cdef bytes b_path = to_bytes(path) * cdef char *_path = b_path * with nogil: # <<<<<<<<<<<<<< @@ -4314,7 +4360,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_28setstat(struct __pyx_obj_4ssh2_4sf #endif /*try:*/ { - /* "ssh2/sftp.pyx":407 + /* "ssh2/sftp.pyx":409 * cdef char *_path = b_path * with nogil: * rc = c_sftp.libssh2_sftp_setstat( # <<<<<<<<<<<<<< @@ -4324,7 +4370,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_28setstat(struct __pyx_obj_4ssh2_4sf __pyx_v_rc = libssh2_sftp_setstat(__pyx_v_self->_sftp, __pyx_v__path, __pyx_v_attrs->_attrs); } - /* "ssh2/sftp.pyx":406 + /* "ssh2/sftp.pyx":408 * cdef bytes b_path = to_bytes(path) * cdef char *_path = b_path * with nogil: # <<<<<<<<<<<<<< @@ -4343,7 +4389,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_28setstat(struct __pyx_obj_4ssh2_4sf } } - /* "ssh2/sftp.pyx":409 + /* "ssh2/sftp.pyx":411 * rc = c_sftp.libssh2_sftp_setstat( * self._sftp, _path, attrs._attrs) * return handle_error_codes(rc) # <<<<<<<<<<<<<< @@ -4351,14 +4397,14 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_28setstat(struct __pyx_obj_4ssh2_4sf * def symlink(self, path not None, target not None): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __pyx_f_4ssh2_5utils_handle_error_codes(__pyx_v_rc, 0); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 409, __pyx_L1_error) - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 409, __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, 411, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 411, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/sftp.pyx":394 + /* "ssh2/sftp.pyx":396 * return handle_error_codes(rc) if rc != 0 else attrs * * def setstat(self, path not None, SFTPAttributes attrs): # <<<<<<<<<<<<<< @@ -4378,7 +4424,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_28setstat(struct __pyx_obj_4ssh2_4sf return __pyx_r; } -/* "ssh2/sftp.pyx":411 +/* "ssh2/sftp.pyx":413 * return handle_error_codes(rc) * * def symlink(self, path not None, target not None): # <<<<<<<<<<<<<< @@ -4421,11 +4467,11 @@ static PyObject *__pyx_pw_4ssh2_4sftp_4SFTP_31symlink(PyObject *__pyx_v_self, Py case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_target)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("symlink", 1, 2, 2, 1); __PYX_ERR(0, 411, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("symlink", 1, 2, 2, 1); __PYX_ERR(0, 413, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "symlink") < 0)) __PYX_ERR(0, 411, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "symlink") < 0)) __PYX_ERR(0, 413, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -4438,17 +4484,17 @@ static PyObject *__pyx_pw_4ssh2_4sftp_4SFTP_31symlink(PyObject *__pyx_v_self, Py } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("symlink", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 411, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("symlink", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 413, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.sftp.SFTP.symlink", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(((PyObject *)__pyx_v_path) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "path"); __PYX_ERR(0, 411, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "path"); __PYX_ERR(0, 413, __pyx_L1_error) } if (unlikely(((PyObject *)__pyx_v_target) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "target"); __PYX_ERR(0, 411, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "target"); __PYX_ERR(0, 413, __pyx_L1_error) } __pyx_r = __pyx_pf_4ssh2_4sftp_4SFTP_30symlink(((struct __pyx_obj_4ssh2_4sftp_SFTP *)__pyx_v_self), __pyx_v_path, __pyx_v_target); @@ -4477,19 +4523,19 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_30symlink(struct __pyx_obj_4ssh2_4sf int __pyx_clineno = 0; __Pyx_RefNannySetupContext("symlink", 0); - /* "ssh2/sftp.pyx":421 + /* "ssh2/sftp.pyx":423 * :rtype: int""" * cdef int rc * cdef bytes b_path = to_bytes(path) # <<<<<<<<<<<<<< * cdef char *_path = b_path * cdef bytes b_target = to_bytes(target) */ - __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 421, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 423, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_b_path = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/sftp.pyx":422 + /* "ssh2/sftp.pyx":424 * cdef int rc * cdef bytes b_path = to_bytes(path) * cdef char *_path = b_path # <<<<<<<<<<<<<< @@ -4498,24 +4544,24 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_30symlink(struct __pyx_obj_4ssh2_4sf */ if (unlikely(__pyx_v_b_path == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 422, __pyx_L1_error) + __PYX_ERR(0, 424, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_path); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 422, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_path); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 424, __pyx_L1_error) __pyx_v__path = __pyx_t_2; - /* "ssh2/sftp.pyx":423 + /* "ssh2/sftp.pyx":425 * cdef bytes b_path = to_bytes(path) * cdef char *_path = b_path * cdef bytes b_target = to_bytes(target) # <<<<<<<<<<<<<< * cdef char *_target = b_target * with nogil: */ - __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_target); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 423, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_target); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 425, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_b_target = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/sftp.pyx":424 + /* "ssh2/sftp.pyx":426 * cdef char *_path = b_path * cdef bytes b_target = to_bytes(target) * cdef char *_target = b_target # <<<<<<<<<<<<<< @@ -4524,12 +4570,12 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_30symlink(struct __pyx_obj_4ssh2_4sf */ if (unlikely(__pyx_v_b_target == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 424, __pyx_L1_error) + __PYX_ERR(0, 426, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_target); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 424, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_target); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 426, __pyx_L1_error) __pyx_v__target = __pyx_t_2; - /* "ssh2/sftp.pyx":425 + /* "ssh2/sftp.pyx":427 * cdef bytes b_target = to_bytes(target) * cdef char *_target = b_target * with nogil: # <<<<<<<<<<<<<< @@ -4544,7 +4590,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_30symlink(struct __pyx_obj_4ssh2_4sf #endif /*try:*/ { - /* "ssh2/sftp.pyx":426 + /* "ssh2/sftp.pyx":428 * cdef char *_target = b_target * with nogil: * rc = c_sftp.libssh2_sftp_symlink(self._sftp, _path, _target) # <<<<<<<<<<<<<< @@ -4554,7 +4600,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_30symlink(struct __pyx_obj_4ssh2_4sf __pyx_v_rc = libssh2_sftp_symlink(__pyx_v_self->_sftp, __pyx_v__path, __pyx_v__target); } - /* "ssh2/sftp.pyx":425 + /* "ssh2/sftp.pyx":427 * cdef bytes b_target = to_bytes(target) * cdef char *_target = b_target * with nogil: # <<<<<<<<<<<<<< @@ -4573,7 +4619,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_30symlink(struct __pyx_obj_4ssh2_4sf } } - /* "ssh2/sftp.pyx":427 + /* "ssh2/sftp.pyx":429 * with nogil: * rc = c_sftp.libssh2_sftp_symlink(self._sftp, _path, _target) * return handle_error_codes(rc) # <<<<<<<<<<<<<< @@ -4581,14 +4627,14 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_30symlink(struct __pyx_obj_4ssh2_4sf * def realpath(self, path not None, size_t max_len=256): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __pyx_f_4ssh2_5utils_handle_error_codes(__pyx_v_rc, 0); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 427, __pyx_L1_error) - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 427, __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, 429, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 429, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/sftp.pyx":411 + /* "ssh2/sftp.pyx":413 * return handle_error_codes(rc) * * def symlink(self, path not None, target not None): # <<<<<<<<<<<<<< @@ -4609,7 +4655,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_30symlink(struct __pyx_obj_4ssh2_4sf return __pyx_r; } -/* "ssh2/sftp.pyx":429 +/* "ssh2/sftp.pyx":431 * return handle_error_codes(rc) * * def realpath(self, path not None, size_t max_len=256): # <<<<<<<<<<<<<< @@ -4656,7 +4702,7 @@ static PyObject *__pyx_pw_4ssh2_4sftp_4SFTP_33realpath(PyObject *__pyx_v_self, P } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "realpath") < 0)) __PYX_ERR(0, 429, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "realpath") < 0)) __PYX_ERR(0, 431, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -4669,21 +4715,21 @@ static PyObject *__pyx_pw_4ssh2_4sftp_4SFTP_33realpath(PyObject *__pyx_v_self, P } __pyx_v_path = values[0]; if (values[1]) { - __pyx_v_max_len = __Pyx_PyInt_As_size_t(values[1]); if (unlikely((__pyx_v_max_len == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 429, __pyx_L3_error) + __pyx_v_max_len = __Pyx_PyInt_As_size_t(values[1]); if (unlikely((__pyx_v_max_len == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 431, __pyx_L3_error) } else { __pyx_v_max_len = ((size_t)0x100); } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("realpath", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 429, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("realpath", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 431, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.sftp.SFTP.realpath", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(((PyObject *)__pyx_v_path) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "path"); __PYX_ERR(0, 429, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "path"); __PYX_ERR(0, 431, __pyx_L1_error) } __pyx_r = __pyx_pf_4ssh2_4sftp_4SFTP_32realpath(((struct __pyx_obj_4ssh2_4sftp_SFTP *)__pyx_v_self), __pyx_v_path, __pyx_v_max_len); @@ -4720,7 +4766,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_32realpath(struct __pyx_obj_4ssh2_4s int __pyx_clineno = 0; __Pyx_RefNannySetupContext("realpath", 0); - /* "ssh2/sftp.pyx":441 + /* "ssh2/sftp.pyx":443 * :raises: :py:class:`ssh2.exceptions.SFTPBufferTooSmall` on max_len less * than real path length.""" * cdef char *_target = malloc(sizeof(char)*max_len) # <<<<<<<<<<<<<< @@ -4729,7 +4775,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_32realpath(struct __pyx_obj_4ssh2_4s */ __pyx_v__target = ((char *)malloc(((sizeof(char)) * __pyx_v_max_len))); - /* "ssh2/sftp.pyx":442 + /* "ssh2/sftp.pyx":444 * than real path length.""" * cdef char *_target = malloc(sizeof(char)*max_len) * if _target is NULL: # <<<<<<<<<<<<<< @@ -4739,16 +4785,16 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_32realpath(struct __pyx_obj_4ssh2_4s __pyx_t_1 = ((__pyx_v__target == NULL) != 0); if (unlikely(__pyx_t_1)) { - /* "ssh2/sftp.pyx":443 + /* "ssh2/sftp.pyx":445 * cdef char *_target = malloc(sizeof(char)*max_len) * if _target is NULL: * raise MemoryError # <<<<<<<<<<<<<< * cdef int rc * cdef bytes b_path = to_bytes(path) */ - PyErr_NoMemory(); __PYX_ERR(0, 443, __pyx_L1_error) + PyErr_NoMemory(); __PYX_ERR(0, 445, __pyx_L1_error) - /* "ssh2/sftp.pyx":442 + /* "ssh2/sftp.pyx":444 * than real path length.""" * cdef char *_target = malloc(sizeof(char)*max_len) * if _target is NULL: # <<<<<<<<<<<<<< @@ -4757,19 +4803,19 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_32realpath(struct __pyx_obj_4ssh2_4s */ } - /* "ssh2/sftp.pyx":445 + /* "ssh2/sftp.pyx":447 * raise MemoryError * cdef int rc * cdef bytes b_path = to_bytes(path) # <<<<<<<<<<<<<< * cdef char *_path = b_path * try: */ - __pyx_t_2 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 445, __pyx_L1_error) + __pyx_t_2 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 447, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_b_path = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "ssh2/sftp.pyx":446 + /* "ssh2/sftp.pyx":448 * cdef int rc * cdef bytes b_path = to_bytes(path) * cdef char *_path = b_path # <<<<<<<<<<<<<< @@ -4778,12 +4824,12 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_32realpath(struct __pyx_obj_4ssh2_4s */ if (unlikely(__pyx_v_b_path == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 446, __pyx_L1_error) + __PYX_ERR(0, 448, __pyx_L1_error) } - __pyx_t_3 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_path); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) __PYX_ERR(0, 446, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_path); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) __PYX_ERR(0, 448, __pyx_L1_error) __pyx_v__path = __pyx_t_3; - /* "ssh2/sftp.pyx":447 + /* "ssh2/sftp.pyx":449 * cdef bytes b_path = to_bytes(path) * cdef char *_path = b_path * try: # <<<<<<<<<<<<<< @@ -4792,7 +4838,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_32realpath(struct __pyx_obj_4ssh2_4s */ /*try:*/ { - /* "ssh2/sftp.pyx":448 + /* "ssh2/sftp.pyx":450 * cdef char *_path = b_path * try: * with nogil: # <<<<<<<<<<<<<< @@ -4807,7 +4853,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_32realpath(struct __pyx_obj_4ssh2_4s #endif /*try:*/ { - /* "ssh2/sftp.pyx":449 + /* "ssh2/sftp.pyx":451 * try: * with nogil: * rc = c_sftp.libssh2_sftp_realpath( # <<<<<<<<<<<<<< @@ -4816,7 +4862,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_32realpath(struct __pyx_obj_4ssh2_4s */ __pyx_v_rc = libssh2_sftp_realpath(__pyx_v_self->_sftp, __pyx_v__path, __pyx_v__target, __pyx_v_max_len); - /* "ssh2/sftp.pyx":451 + /* "ssh2/sftp.pyx":453 * rc = c_sftp.libssh2_sftp_realpath( * self._sftp, _path, _target, max_len) * if rc < 0: # <<<<<<<<<<<<<< @@ -4826,7 +4872,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_32realpath(struct __pyx_obj_4ssh2_4s __pyx_t_1 = ((__pyx_v_rc < 0) != 0); if (__pyx_t_1) { - /* "ssh2/sftp.pyx":452 + /* "ssh2/sftp.pyx":454 * self._sftp, _path, _target, max_len) * if rc < 0: * with gil: # <<<<<<<<<<<<<< @@ -4839,7 +4885,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_32realpath(struct __pyx_obj_4ssh2_4s #endif /*try:*/ { - /* "ssh2/sftp.pyx":453 + /* "ssh2/sftp.pyx":455 * if rc < 0: * with gil: * return handle_error_codes(rc) # <<<<<<<<<<<<<< @@ -4847,15 +4893,15 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_32realpath(struct __pyx_obj_4ssh2_4s * finally: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = __pyx_f_4ssh2_5utils_handle_error_codes(__pyx_v_rc, 0); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 453, __pyx_L12_error) - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 453, __pyx_L12_error) + __pyx_t_4 = __pyx_f_4ssh2_5utils_handle_error_codes(__pyx_v_rc, 0); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 455, __pyx_L12_error) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 455, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L11_return; } - /* "ssh2/sftp.pyx":452 + /* "ssh2/sftp.pyx":454 * self._sftp, _path, _target, max_len) * if rc < 0: * with gil: # <<<<<<<<<<<<<< @@ -4878,7 +4924,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_32realpath(struct __pyx_obj_4ssh2_4s } } - /* "ssh2/sftp.pyx":451 + /* "ssh2/sftp.pyx":453 * rc = c_sftp.libssh2_sftp_realpath( * self._sftp, _path, _target, max_len) * if rc < 0: # <<<<<<<<<<<<<< @@ -4888,7 +4934,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_32realpath(struct __pyx_obj_4ssh2_4s } } - /* "ssh2/sftp.pyx":448 + /* "ssh2/sftp.pyx":450 * cdef char *_path = b_path * try: * with nogil: # <<<<<<<<<<<<<< @@ -4921,7 +4967,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_32realpath(struct __pyx_obj_4ssh2_4s } } - /* "ssh2/sftp.pyx":454 + /* "ssh2/sftp.pyx":456 * with gil: * return handle_error_codes(rc) * return to_str_len(_target, rc) # <<<<<<<<<<<<<< @@ -4929,14 +4975,14 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_32realpath(struct __pyx_obj_4ssh2_4s * free(_target) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __pyx_f_4ssh2_5utils_to_str_len(__pyx_v__target, __pyx_v_rc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 454, __pyx_L5_error) + __pyx_t_2 = __pyx_f_4ssh2_5utils_to_str_len(__pyx_v__target, __pyx_v_rc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 456, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L4_return; } - /* "ssh2/sftp.pyx":456 + /* "ssh2/sftp.pyx":458 * return to_str_len(_target, rc) * finally: * free(_target) # <<<<<<<<<<<<<< @@ -4986,7 +5032,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_32realpath(struct __pyx_obj_4ssh2_4s } } - /* "ssh2/sftp.pyx":429 + /* "ssh2/sftp.pyx":431 * return handle_error_codes(rc) * * def realpath(self, path not None, size_t max_len=256): # <<<<<<<<<<<<<< @@ -5006,7 +5052,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_32realpath(struct __pyx_obj_4ssh2_4s return __pyx_r; } -/* "ssh2/sftp.pyx":458 +/* "ssh2/sftp.pyx":460 * free(_target) * * def last_error(self): # <<<<<<<<<<<<<< @@ -5038,7 +5084,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_34last_error(struct __pyx_obj_4ssh2_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("last_error", 0); - /* "ssh2/sftp.pyx":463 + /* "ssh2/sftp.pyx":465 * :rtype: int""" * cdef unsigned long rc * with nogil: # <<<<<<<<<<<<<< @@ -5053,7 +5099,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_34last_error(struct __pyx_obj_4ssh2_ #endif /*try:*/ { - /* "ssh2/sftp.pyx":464 + /* "ssh2/sftp.pyx":466 * cdef unsigned long rc * with nogil: * rc = c_sftp.libssh2_sftp_last_error(self._sftp) # <<<<<<<<<<<<<< @@ -5062,7 +5108,7 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_34last_error(struct __pyx_obj_4ssh2_ __pyx_v_rc = libssh2_sftp_last_error(__pyx_v_self->_sftp); } - /* "ssh2/sftp.pyx":463 + /* "ssh2/sftp.pyx":465 * :rtype: int""" * cdef unsigned long rc * with nogil: # <<<<<<<<<<<<<< @@ -5081,19 +5127,19 @@ static PyObject *__pyx_pf_4ssh2_4sftp_4SFTP_34last_error(struct __pyx_obj_4ssh2_ } } - /* "ssh2/sftp.pyx":465 + /* "ssh2/sftp.pyx":467 * with nogil: * rc = c_sftp.libssh2_sftp_last_error(self._sftp) * return rc # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_unsigned_long(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 465, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_unsigned_long(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 467, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/sftp.pyx":458 + /* "ssh2/sftp.pyx":460 * free(_target) * * def last_error(self): # <<<<<<<<<<<<<< @@ -5493,7 +5539,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {0, 0, 0, 0, 0, 0, 0} }; static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(0, 443, __pyx_L1_error) + __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(0, 445, __pyx_L1_error) __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error) return 0; __pyx_L1_error:; diff --git a/ssh2/sftp.pyx b/ssh2/sftp.pyx index e2cd2168..e46cb847 100644 --- a/ssh2/sftp.pyx +++ b/ssh2/sftp.pyx @@ -178,8 +178,10 @@ cdef class SFTP: self._session = session def __dealloc__(self): - with nogil: - c_sftp.libssh2_sftp_shutdown(self._sftp) + if self._session is not None and self._session._session is not NULL and self._sftp is not NULL: + with nogil: + c_sftp.libssh2_sftp_shutdown(self._sftp) + self._sftp = NULL @property def session(self): diff --git a/ssh2/sftp_handle.c b/ssh2/sftp_handle.c index e75c25f6..1d21e9c1 100644 --- a/ssh2/sftp_handle.c +++ b/ssh2/sftp_handle.c @@ -622,7 +622,7 @@ static CYTHON_INLINE float __PYX_NAN() { #include "libssh2_sftp.h" #include #include -#include "find_eol.h" +#include "ext/find_eol.h" #ifdef _OPENMP #include #endif /* _OPENMP */ @@ -6178,7 +6178,7 @@ static PyObject *__pyx_pf_4ssh2_11sftp_handle_10SFTPHandle_26write(struct __pyx_ * bytes_written = tot_size - _size * return rc, bytes_written # <<<<<<<<<<<<<< * - * IF EMBEDDED_LIB: + * def fsync(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_rc); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 298, __pyx_L1_error) @@ -6218,17 +6218,17 @@ static PyObject *__pyx_pf_4ssh2_11sftp_handle_10SFTPHandle_26write(struct __pyx_ return __pyx_r; } -/* "ssh2/sftp_handle.pyx":301 +/* "ssh2/sftp_handle.pyx":300 + * return rc, bytes_written * - * IF EMBEDDED_LIB: - * def fsync(self): # <<<<<<<<<<<<<< - * """Sync file handle data. + * def fsync(self): # <<<<<<<<<<<<<< + * """Sync file handle data. * */ /* Python wrapper */ static PyObject *__pyx_pw_4ssh2_11sftp_handle_10SFTPHandle_29fsync(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static char __pyx_doc_4ssh2_11sftp_handle_10SFTPHandle_28fsync[] = "SFTPHandle.fsync(self)\nSync file handle data.\n\n Available from libssh2 >= ``1.4.4``\n\n :rtype: int"; +static char __pyx_doc_4ssh2_11sftp_handle_10SFTPHandle_28fsync[] = "SFTPHandle.fsync(self)\nSync file handle data.\n\n :rtype: int"; static PyObject *__pyx_pw_4ssh2_11sftp_handle_10SFTPHandle_29fsync(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations @@ -6251,12 +6251,12 @@ static PyObject *__pyx_pf_4ssh2_11sftp_handle_10SFTPHandle_28fsync(struct __pyx_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("fsync", 0); - /* "ssh2/sftp_handle.pyx":308 - * :rtype: int""" - * cdef int rc - * with nogil: # <<<<<<<<<<<<<< - * rc = c_sftp.libssh2_sftp_fsync(self._handle) - * return handle_error_codes(rc) + /* "ssh2/sftp_handle.pyx":305 + * :rtype: int""" + * cdef int rc + * with nogil: # <<<<<<<<<<<<<< + * rc = c_sftp.libssh2_sftp_fsync(self._handle) + * return handle_error_codes(rc) */ { #ifdef WITH_THREAD @@ -6266,22 +6266,22 @@ static PyObject *__pyx_pf_4ssh2_11sftp_handle_10SFTPHandle_28fsync(struct __pyx_ #endif /*try:*/ { - /* "ssh2/sftp_handle.pyx":309 - * cdef int rc - * with nogil: - * rc = c_sftp.libssh2_sftp_fsync(self._handle) # <<<<<<<<<<<<<< - * return handle_error_codes(rc) + /* "ssh2/sftp_handle.pyx":306 + * cdef int rc + * with nogil: + * rc = c_sftp.libssh2_sftp_fsync(self._handle) # <<<<<<<<<<<<<< + * return handle_error_codes(rc) * */ __pyx_v_rc = libssh2_sftp_fsync(__pyx_v_self->_handle); } - /* "ssh2/sftp_handle.pyx":308 - * :rtype: int""" - * cdef int rc - * with nogil: # <<<<<<<<<<<<<< - * rc = c_sftp.libssh2_sftp_fsync(self._handle) - * return handle_error_codes(rc) + /* "ssh2/sftp_handle.pyx":305 + * :rtype: int""" + * cdef int rc + * with nogil: # <<<<<<<<<<<<<< + * rc = c_sftp.libssh2_sftp_fsync(self._handle) + * return handle_error_codes(rc) */ /*finally:*/ { /*normal exit:*/{ @@ -6295,26 +6295,26 @@ static PyObject *__pyx_pf_4ssh2_11sftp_handle_10SFTPHandle_28fsync(struct __pyx_ } } - /* "ssh2/sftp_handle.pyx":310 - * with nogil: - * rc = c_sftp.libssh2_sftp_fsync(self._handle) - * return handle_error_codes(rc) # <<<<<<<<<<<<<< + /* "ssh2/sftp_handle.pyx":307 + * with nogil: + * rc = c_sftp.libssh2_sftp_fsync(self._handle) + * return handle_error_codes(rc) # <<<<<<<<<<<<<< * * def seek(self, size_t offset): */ __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, 310, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 310, __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, 307, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "ssh2/sftp_handle.pyx":301 + /* "ssh2/sftp_handle.pyx":300 + * return rc, bytes_written * - * IF EMBEDDED_LIB: - * def fsync(self): # <<<<<<<<<<<<<< - * """Sync file handle data. + * def fsync(self): # <<<<<<<<<<<<<< + * """Sync file handle data. * */ @@ -6329,8 +6329,8 @@ static PyObject *__pyx_pf_4ssh2_11sftp_handle_10SFTPHandle_28fsync(struct __pyx_ return __pyx_r; } -/* "ssh2/sftp_handle.pyx":312 - * return handle_error_codes(rc) +/* "ssh2/sftp_handle.pyx":309 + * return handle_error_codes(rc) * * def seek(self, size_t offset): # <<<<<<<<<<<<<< * """Deprecated, use seek64. @@ -6349,7 +6349,7 @@ static PyObject *__pyx_pw_4ssh2_11sftp_handle_10SFTPHandle_31seek(PyObject *__py __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("seek (wrapper)", 0); assert(__pyx_arg_offset); { - __pyx_v_offset = __Pyx_PyInt_As_size_t(__pyx_arg_offset); if (unlikely((__pyx_v_offset == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 312, __pyx_L3_error) + __pyx_v_offset = __Pyx_PyInt_As_size_t(__pyx_arg_offset); if (unlikely((__pyx_v_offset == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 309, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -6369,7 +6369,7 @@ static PyObject *__pyx_pf_4ssh2_11sftp_handle_10SFTPHandle_30seek(struct __pyx_o __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("seek", 0); - /* "ssh2/sftp_handle.pyx":321 + /* "ssh2/sftp_handle.pyx":318 * * :rtype: None""" * with nogil: # <<<<<<<<<<<<<< @@ -6384,7 +6384,7 @@ static PyObject *__pyx_pf_4ssh2_11sftp_handle_10SFTPHandle_30seek(struct __pyx_o #endif /*try:*/ { - /* "ssh2/sftp_handle.pyx":322 + /* "ssh2/sftp_handle.pyx":319 * :rtype: None""" * with nogil: * c_sftp.libssh2_sftp_seek(self._handle, offset) # <<<<<<<<<<<<<< @@ -6394,7 +6394,7 @@ static PyObject *__pyx_pf_4ssh2_11sftp_handle_10SFTPHandle_30seek(struct __pyx_o libssh2_sftp_seek(__pyx_v_self->_handle, __pyx_v_offset); } - /* "ssh2/sftp_handle.pyx":321 + /* "ssh2/sftp_handle.pyx":318 * * :rtype: None""" * with nogil: # <<<<<<<<<<<<<< @@ -6413,8 +6413,8 @@ static PyObject *__pyx_pf_4ssh2_11sftp_handle_10SFTPHandle_30seek(struct __pyx_o } } - /* "ssh2/sftp_handle.pyx":312 - * return handle_error_codes(rc) + /* "ssh2/sftp_handle.pyx":309 + * return handle_error_codes(rc) * * def seek(self, size_t offset): # <<<<<<<<<<<<<< * """Deprecated, use seek64. @@ -6428,7 +6428,7 @@ static PyObject *__pyx_pf_4ssh2_11sftp_handle_10SFTPHandle_30seek(struct __pyx_o return __pyx_r; } -/* "ssh2/sftp_handle.pyx":324 +/* "ssh2/sftp_handle.pyx":321 * c_sftp.libssh2_sftp_seek(self._handle, offset) * * def seek64(self, c_ssh2.libssh2_uint64_t offset): # <<<<<<<<<<<<<< @@ -6448,7 +6448,7 @@ static PyObject *__pyx_pw_4ssh2_11sftp_handle_10SFTPHandle_33seek64(PyObject *__ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("seek64 (wrapper)", 0); assert(__pyx_arg_offset); { - __pyx_v_offset = __Pyx_PyInt_As_libssh2_uint64_t(__pyx_arg_offset); if (unlikely((__pyx_v_offset == ((libssh2_uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 324, __pyx_L3_error) + __pyx_v_offset = __Pyx_PyInt_As_libssh2_uint64_t(__pyx_arg_offset); if (unlikely((__pyx_v_offset == ((libssh2_uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 321, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -6468,7 +6468,7 @@ static PyObject *__pyx_pf_4ssh2_11sftp_handle_10SFTPHandle_32seek64(struct __pyx __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("seek64", 0); - /* "ssh2/sftp_handle.pyx":331 + /* "ssh2/sftp_handle.pyx":328 * * :rtype: None""" * with nogil: # <<<<<<<<<<<<<< @@ -6483,7 +6483,7 @@ static PyObject *__pyx_pf_4ssh2_11sftp_handle_10SFTPHandle_32seek64(struct __pyx #endif /*try:*/ { - /* "ssh2/sftp_handle.pyx":332 + /* "ssh2/sftp_handle.pyx":329 * :rtype: None""" * with nogil: * c_sftp.libssh2_sftp_seek64(self._handle, offset) # <<<<<<<<<<<<<< @@ -6493,7 +6493,7 @@ static PyObject *__pyx_pf_4ssh2_11sftp_handle_10SFTPHandle_32seek64(struct __pyx libssh2_sftp_seek64(__pyx_v_self->_handle, __pyx_v_offset); } - /* "ssh2/sftp_handle.pyx":331 + /* "ssh2/sftp_handle.pyx":328 * * :rtype: None""" * with nogil: # <<<<<<<<<<<<<< @@ -6512,7 +6512,7 @@ static PyObject *__pyx_pf_4ssh2_11sftp_handle_10SFTPHandle_32seek64(struct __pyx } } - /* "ssh2/sftp_handle.pyx":324 + /* "ssh2/sftp_handle.pyx":321 * c_sftp.libssh2_sftp_seek(self._handle, offset) * * def seek64(self, c_ssh2.libssh2_uint64_t offset): # <<<<<<<<<<<<<< @@ -6527,7 +6527,7 @@ static PyObject *__pyx_pf_4ssh2_11sftp_handle_10SFTPHandle_32seek64(struct __pyx return __pyx_r; } -/* "ssh2/sftp_handle.pyx":334 +/* "ssh2/sftp_handle.pyx":331 * c_sftp.libssh2_sftp_seek64(self._handle, offset) * * def rewind(self): # <<<<<<<<<<<<<< @@ -6554,7 +6554,7 @@ static PyObject *__pyx_pf_4ssh2_11sftp_handle_10SFTPHandle_34rewind(struct __pyx __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("rewind", 0); - /* "ssh2/sftp_handle.pyx":338 + /* "ssh2/sftp_handle.pyx":335 * * :rtype: None""" * with nogil: # <<<<<<<<<<<<<< @@ -6569,7 +6569,7 @@ static PyObject *__pyx_pf_4ssh2_11sftp_handle_10SFTPHandle_34rewind(struct __pyx #endif /*try:*/ { - /* "ssh2/sftp_handle.pyx":339 + /* "ssh2/sftp_handle.pyx":336 * :rtype: None""" * with nogil: * c_sftp.libssh2_sftp_rewind(self._handle) # <<<<<<<<<<<<<< @@ -6579,7 +6579,7 @@ static PyObject *__pyx_pf_4ssh2_11sftp_handle_10SFTPHandle_34rewind(struct __pyx libssh2_sftp_rewind(__pyx_v_self->_handle); } - /* "ssh2/sftp_handle.pyx":338 + /* "ssh2/sftp_handle.pyx":335 * * :rtype: None""" * with nogil: # <<<<<<<<<<<<<< @@ -6598,7 +6598,7 @@ static PyObject *__pyx_pf_4ssh2_11sftp_handle_10SFTPHandle_34rewind(struct __pyx } } - /* "ssh2/sftp_handle.pyx":334 + /* "ssh2/sftp_handle.pyx":331 * c_sftp.libssh2_sftp_seek64(self._handle, offset) * * def rewind(self): # <<<<<<<<<<<<<< @@ -6613,7 +6613,7 @@ static PyObject *__pyx_pf_4ssh2_11sftp_handle_10SFTPHandle_34rewind(struct __pyx return __pyx_r; } -/* "ssh2/sftp_handle.pyx":341 +/* "ssh2/sftp_handle.pyx":338 * c_sftp.libssh2_sftp_rewind(self._handle) * * def tell(self): # <<<<<<<<<<<<<< @@ -6646,7 +6646,7 @@ static PyObject *__pyx_pf_4ssh2_11sftp_handle_10SFTPHandle_36tell(struct __pyx_o int __pyx_clineno = 0; __Pyx_RefNannySetupContext("tell", 0); - /* "ssh2/sftp_handle.pyx":348 + /* "ssh2/sftp_handle.pyx":345 * :rtype: int""" * cdef size_t rc * with nogil: # <<<<<<<<<<<<<< @@ -6661,7 +6661,7 @@ static PyObject *__pyx_pf_4ssh2_11sftp_handle_10SFTPHandle_36tell(struct __pyx_o #endif /*try:*/ { - /* "ssh2/sftp_handle.pyx":349 + /* "ssh2/sftp_handle.pyx":346 * cdef size_t rc * with nogil: * rc = c_sftp.libssh2_sftp_tell(self._handle) # <<<<<<<<<<<<<< @@ -6671,7 +6671,7 @@ static PyObject *__pyx_pf_4ssh2_11sftp_handle_10SFTPHandle_36tell(struct __pyx_o __pyx_v_rc = libssh2_sftp_tell(__pyx_v_self->_handle); } - /* "ssh2/sftp_handle.pyx":348 + /* "ssh2/sftp_handle.pyx":345 * :rtype: int""" * cdef size_t rc * with nogil: # <<<<<<<<<<<<<< @@ -6690,7 +6690,7 @@ static PyObject *__pyx_pf_4ssh2_11sftp_handle_10SFTPHandle_36tell(struct __pyx_o } } - /* "ssh2/sftp_handle.pyx":350 + /* "ssh2/sftp_handle.pyx":347 * with nogil: * rc = c_sftp.libssh2_sftp_tell(self._handle) * return handle_error_codes(rc) # <<<<<<<<<<<<<< @@ -6698,14 +6698,14 @@ static PyObject *__pyx_pf_4ssh2_11sftp_handle_10SFTPHandle_36tell(struct __pyx_o * def tell64(self): */ __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, 350, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 350, __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, 347, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 347, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "ssh2/sftp_handle.pyx":341 + /* "ssh2/sftp_handle.pyx":338 * c_sftp.libssh2_sftp_rewind(self._handle) * * def tell(self): # <<<<<<<<<<<<<< @@ -6724,7 +6724,7 @@ static PyObject *__pyx_pf_4ssh2_11sftp_handle_10SFTPHandle_36tell(struct __pyx_o return __pyx_r; } -/* "ssh2/sftp_handle.pyx":352 +/* "ssh2/sftp_handle.pyx":349 * return handle_error_codes(rc) * * def tell64(self): # <<<<<<<<<<<<<< @@ -6757,7 +6757,7 @@ static PyObject *__pyx_pf_4ssh2_11sftp_handle_10SFTPHandle_38tell64(struct __pyx int __pyx_clineno = 0; __Pyx_RefNannySetupContext("tell64", 0); - /* "ssh2/sftp_handle.pyx":357 + /* "ssh2/sftp_handle.pyx":354 * :rtype: int""" * cdef c_ssh2.libssh2_uint64_t rc * with nogil: # <<<<<<<<<<<<<< @@ -6772,7 +6772,7 @@ static PyObject *__pyx_pf_4ssh2_11sftp_handle_10SFTPHandle_38tell64(struct __pyx #endif /*try:*/ { - /* "ssh2/sftp_handle.pyx":358 + /* "ssh2/sftp_handle.pyx":355 * cdef c_ssh2.libssh2_uint64_t rc * with nogil: * rc = c_sftp.libssh2_sftp_tell(self._handle) # <<<<<<<<<<<<<< @@ -6782,7 +6782,7 @@ static PyObject *__pyx_pf_4ssh2_11sftp_handle_10SFTPHandle_38tell64(struct __pyx __pyx_v_rc = libssh2_sftp_tell(__pyx_v_self->_handle); } - /* "ssh2/sftp_handle.pyx":357 + /* "ssh2/sftp_handle.pyx":354 * :rtype: int""" * cdef c_ssh2.libssh2_uint64_t rc * with nogil: # <<<<<<<<<<<<<< @@ -6801,7 +6801,7 @@ static PyObject *__pyx_pf_4ssh2_11sftp_handle_10SFTPHandle_38tell64(struct __pyx } } - /* "ssh2/sftp_handle.pyx":359 + /* "ssh2/sftp_handle.pyx":356 * with nogil: * rc = c_sftp.libssh2_sftp_tell(self._handle) * return handle_error_codes(rc) # <<<<<<<<<<<<<< @@ -6809,14 +6809,14 @@ static PyObject *__pyx_pf_4ssh2_11sftp_handle_10SFTPHandle_38tell64(struct __pyx * def fstat_ex(self, SFTPAttributes attrs, int setstat): */ __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, 359, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 359, __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, 356, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "ssh2/sftp_handle.pyx":352 + /* "ssh2/sftp_handle.pyx":349 * return handle_error_codes(rc) * * def tell64(self): # <<<<<<<<<<<<<< @@ -6835,7 +6835,7 @@ static PyObject *__pyx_pf_4ssh2_11sftp_handle_10SFTPHandle_38tell64(struct __pyx return __pyx_r; } -/* "ssh2/sftp_handle.pyx":361 +/* "ssh2/sftp_handle.pyx":358 * return handle_error_codes(rc) * * def fstat_ex(self, SFTPAttributes attrs, int setstat): # <<<<<<<<<<<<<< @@ -6878,11 +6878,11 @@ static PyObject *__pyx_pw_4ssh2_11sftp_handle_10SFTPHandle_41fstat_ex(PyObject * case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_setstat)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("fstat_ex", 1, 2, 2, 1); __PYX_ERR(0, 361, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("fstat_ex", 1, 2, 2, 1); __PYX_ERR(0, 358, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fstat_ex") < 0)) __PYX_ERR(0, 361, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fstat_ex") < 0)) __PYX_ERR(0, 358, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -6891,17 +6891,17 @@ static PyObject *__pyx_pw_4ssh2_11sftp_handle_10SFTPHandle_41fstat_ex(PyObject * values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_attrs = ((struct __pyx_obj_4ssh2_11sftp_handle_SFTPAttributes *)values[0]); - __pyx_v_setstat = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_setstat == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 361, __pyx_L3_error) + __pyx_v_setstat = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_setstat == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 358, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("fstat_ex", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 361, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("fstat_ex", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 358, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.sftp_handle.SFTPHandle.fstat_ex", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_attrs), __pyx_ptype_4ssh2_11sftp_handle_SFTPAttributes, 1, "attrs", 0))) __PYX_ERR(0, 361, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_attrs), __pyx_ptype_4ssh2_11sftp_handle_SFTPAttributes, 1, "attrs", 0))) __PYX_ERR(0, 358, __pyx_L1_error) __pyx_r = __pyx_pf_4ssh2_11sftp_handle_10SFTPHandle_40fstat_ex(((struct __pyx_obj_4ssh2_11sftp_handle_SFTPHandle *)__pyx_v_self), __pyx_v_attrs, __pyx_v_setstat); /* function exit code */ @@ -6924,7 +6924,7 @@ static PyObject *__pyx_pf_4ssh2_11sftp_handle_10SFTPHandle_40fstat_ex(struct __p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("fstat_ex", 0); - /* "ssh2/sftp_handle.pyx":365 + /* "ssh2/sftp_handle.pyx":362 * fstat or fsetstat functions instead""" * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -6939,7 +6939,7 @@ static PyObject *__pyx_pf_4ssh2_11sftp_handle_10SFTPHandle_40fstat_ex(struct __p #endif /*try:*/ { - /* "ssh2/sftp_handle.pyx":366 + /* "ssh2/sftp_handle.pyx":363 * cdef int rc * with nogil: * rc = c_sftp.libssh2_sftp_fstat_ex( # <<<<<<<<<<<<<< @@ -6949,7 +6949,7 @@ static PyObject *__pyx_pf_4ssh2_11sftp_handle_10SFTPHandle_40fstat_ex(struct __p __pyx_v_rc = libssh2_sftp_fstat_ex(__pyx_v_self->_handle, __pyx_v_attrs->_attrs, __pyx_v_setstat); } - /* "ssh2/sftp_handle.pyx":365 + /* "ssh2/sftp_handle.pyx":362 * fstat or fsetstat functions instead""" * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -6968,7 +6968,7 @@ static PyObject *__pyx_pf_4ssh2_11sftp_handle_10SFTPHandle_40fstat_ex(struct __p } } - /* "ssh2/sftp_handle.pyx":368 + /* "ssh2/sftp_handle.pyx":365 * rc = c_sftp.libssh2_sftp_fstat_ex( * self._handle, attrs._attrs, setstat) * return handle_error_codes(rc) # <<<<<<<<<<<<<< @@ -6976,14 +6976,14 @@ static PyObject *__pyx_pf_4ssh2_11sftp_handle_10SFTPHandle_40fstat_ex(struct __p * def fstat(self): */ __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, 368, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 368, __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, 365, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 365, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "ssh2/sftp_handle.pyx":361 + /* "ssh2/sftp_handle.pyx":358 * return handle_error_codes(rc) * * def fstat_ex(self, SFTPAttributes attrs, int setstat): # <<<<<<<<<<<<<< @@ -7002,7 +7002,7 @@ static PyObject *__pyx_pf_4ssh2_11sftp_handle_10SFTPHandle_40fstat_ex(struct __p return __pyx_r; } -/* "ssh2/sftp_handle.pyx":370 +/* "ssh2/sftp_handle.pyx":367 * return handle_error_codes(rc) * * def fstat(self): # <<<<<<<<<<<<<< @@ -7037,19 +7037,19 @@ static PyObject *__pyx_pf_4ssh2_11sftp_handle_10SFTPHandle_42fstat(struct __pyx_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("fstat", 0); - /* "ssh2/sftp_handle.pyx":375 + /* "ssh2/sftp_handle.pyx":372 * :rtype: :py:class:`ssh2.sftp.SFTPAttributes` or LIBSSH2_ERROR_EAGAIN""" * cdef int rc * cdef SFTPAttributes attrs = SFTPAttributes() # <<<<<<<<<<<<<< * with nogil: * rc = c_sftp.libssh2_sftp_fstat(self._handle, attrs._attrs) */ - __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_4ssh2_11sftp_handle_SFTPAttributes)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 375, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_4ssh2_11sftp_handle_SFTPAttributes)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 372, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_attrs = ((struct __pyx_obj_4ssh2_11sftp_handle_SFTPAttributes *)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/sftp_handle.pyx":376 + /* "ssh2/sftp_handle.pyx":373 * cdef int rc * cdef SFTPAttributes attrs = SFTPAttributes() * with nogil: # <<<<<<<<<<<<<< @@ -7064,7 +7064,7 @@ static PyObject *__pyx_pf_4ssh2_11sftp_handle_10SFTPHandle_42fstat(struct __pyx_ #endif /*try:*/ { - /* "ssh2/sftp_handle.pyx":377 + /* "ssh2/sftp_handle.pyx":374 * cdef SFTPAttributes attrs = SFTPAttributes() * with nogil: * rc = c_sftp.libssh2_sftp_fstat(self._handle, attrs._attrs) # <<<<<<<<<<<<<< @@ -7074,7 +7074,7 @@ static PyObject *__pyx_pf_4ssh2_11sftp_handle_10SFTPHandle_42fstat(struct __pyx_ __pyx_v_rc = libssh2_sftp_fstat(__pyx_v_self->_handle, __pyx_v_attrs->_attrs); } - /* "ssh2/sftp_handle.pyx":376 + /* "ssh2/sftp_handle.pyx":373 * cdef int rc * cdef SFTPAttributes attrs = SFTPAttributes() * with nogil: # <<<<<<<<<<<<<< @@ -7093,7 +7093,7 @@ static PyObject *__pyx_pf_4ssh2_11sftp_handle_10SFTPHandle_42fstat(struct __pyx_ } } - /* "ssh2/sftp_handle.pyx":378 + /* "ssh2/sftp_handle.pyx":375 * with nogil: * rc = c_sftp.libssh2_sftp_fstat(self._handle, attrs._attrs) * if rc != 0: # <<<<<<<<<<<<<< @@ -7103,7 +7103,7 @@ static PyObject *__pyx_pf_4ssh2_11sftp_handle_10SFTPHandle_42fstat(struct __pyx_ __pyx_t_2 = ((__pyx_v_rc != 0) != 0); if (__pyx_t_2) { - /* "ssh2/sftp_handle.pyx":379 + /* "ssh2/sftp_handle.pyx":376 * rc = c_sftp.libssh2_sftp_fstat(self._handle, attrs._attrs) * if rc != 0: * return handle_error_codes(rc) # <<<<<<<<<<<<<< @@ -7111,14 +7111,14 @@ static PyObject *__pyx_pf_4ssh2_11sftp_handle_10SFTPHandle_42fstat(struct __pyx_ * */ __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, 379, __pyx_L1_error) - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 379, __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, 376, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/sftp_handle.pyx":378 + /* "ssh2/sftp_handle.pyx":375 * with nogil: * rc = c_sftp.libssh2_sftp_fstat(self._handle, attrs._attrs) * if rc != 0: # <<<<<<<<<<<<<< @@ -7127,7 +7127,7 @@ static PyObject *__pyx_pf_4ssh2_11sftp_handle_10SFTPHandle_42fstat(struct __pyx_ */ } - /* "ssh2/sftp_handle.pyx":380 + /* "ssh2/sftp_handle.pyx":377 * if rc != 0: * return handle_error_codes(rc) * return attrs # <<<<<<<<<<<<<< @@ -7139,7 +7139,7 @@ static PyObject *__pyx_pf_4ssh2_11sftp_handle_10SFTPHandle_42fstat(struct __pyx_ __pyx_r = ((PyObject *)__pyx_v_attrs); goto __pyx_L0; - /* "ssh2/sftp_handle.pyx":370 + /* "ssh2/sftp_handle.pyx":367 * return handle_error_codes(rc) * * def fstat(self): # <<<<<<<<<<<<<< @@ -7159,7 +7159,7 @@ static PyObject *__pyx_pf_4ssh2_11sftp_handle_10SFTPHandle_42fstat(struct __pyx_ return __pyx_r; } -/* "ssh2/sftp_handle.pyx":382 +/* "ssh2/sftp_handle.pyx":379 * return attrs * * def fsetstat(self, SFTPAttributes attrs): # <<<<<<<<<<<<<< @@ -7177,7 +7177,7 @@ static PyObject *__pyx_pw_4ssh2_11sftp_handle_10SFTPHandle_45fsetstat(PyObject * PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("fsetstat (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_attrs), __pyx_ptype_4ssh2_11sftp_handle_SFTPAttributes, 1, "attrs", 0))) __PYX_ERR(0, 382, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_attrs), __pyx_ptype_4ssh2_11sftp_handle_SFTPAttributes, 1, "attrs", 0))) __PYX_ERR(0, 379, __pyx_L1_error) __pyx_r = __pyx_pf_4ssh2_11sftp_handle_10SFTPHandle_44fsetstat(((struct __pyx_obj_4ssh2_11sftp_handle_SFTPHandle *)__pyx_v_self), ((struct __pyx_obj_4ssh2_11sftp_handle_SFTPAttributes *)__pyx_v_attrs)); /* function exit code */ @@ -7200,7 +7200,7 @@ static PyObject *__pyx_pf_4ssh2_11sftp_handle_10SFTPHandle_44fsetstat(struct __p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("fsetstat", 0); - /* "ssh2/sftp_handle.pyx":388 + /* "ssh2/sftp_handle.pyx":385 * :type attrs: :py:class:`ssh2.sftp.SFTPAttributes`""" * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -7215,7 +7215,7 @@ static PyObject *__pyx_pf_4ssh2_11sftp_handle_10SFTPHandle_44fsetstat(struct __p #endif /*try:*/ { - /* "ssh2/sftp_handle.pyx":389 + /* "ssh2/sftp_handle.pyx":386 * cdef int rc * with nogil: * rc = c_sftp.libssh2_sftp_fsetstat(self._handle, attrs._attrs) # <<<<<<<<<<<<<< @@ -7225,7 +7225,7 @@ static PyObject *__pyx_pf_4ssh2_11sftp_handle_10SFTPHandle_44fsetstat(struct __p __pyx_v_rc = libssh2_sftp_fsetstat(__pyx_v_self->_handle, __pyx_v_attrs->_attrs); } - /* "ssh2/sftp_handle.pyx":388 + /* "ssh2/sftp_handle.pyx":385 * :type attrs: :py:class:`ssh2.sftp.SFTPAttributes`""" * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -7244,7 +7244,7 @@ static PyObject *__pyx_pf_4ssh2_11sftp_handle_10SFTPHandle_44fsetstat(struct __p } } - /* "ssh2/sftp_handle.pyx":390 + /* "ssh2/sftp_handle.pyx":387 * with nogil: * rc = c_sftp.libssh2_sftp_fsetstat(self._handle, attrs._attrs) * return handle_error_codes(rc) # <<<<<<<<<<<<<< @@ -7252,14 +7252,14 @@ static PyObject *__pyx_pf_4ssh2_11sftp_handle_10SFTPHandle_44fsetstat(struct __p * def fstatvfs(self): */ __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, 390, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 390, __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, 387, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 387, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "ssh2/sftp_handle.pyx":382 + /* "ssh2/sftp_handle.pyx":379 * return attrs * * def fsetstat(self, SFTPAttributes attrs): # <<<<<<<<<<<<<< @@ -7278,7 +7278,7 @@ static PyObject *__pyx_pf_4ssh2_11sftp_handle_10SFTPHandle_44fsetstat(struct __p return __pyx_r; } -/* "ssh2/sftp_handle.pyx":392 +/* "ssh2/sftp_handle.pyx":389 * return handle_error_codes(rc) * * def fstatvfs(self): # <<<<<<<<<<<<<< @@ -7313,19 +7313,19 @@ static PyObject *__pyx_pf_4ssh2_11sftp_handle_10SFTPHandle_46fstatvfs(struct __p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("fstatvfs", 0); - /* "ssh2/sftp_handle.pyx":396 + /* "ssh2/sftp_handle.pyx":393 * * :rtype: `ssh2.sftp.SFTPStatVFS`""" * cdef SFTPStatVFS vfs = SFTPStatVFS(self) # <<<<<<<<<<<<<< * cdef int rc * with nogil: */ - __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_4ssh2_11sftp_handle_SFTPStatVFS), ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 396, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_4ssh2_11sftp_handle_SFTPStatVFS), ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 393, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_vfs = ((struct __pyx_obj_4ssh2_11sftp_handle_SFTPStatVFS *)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/sftp_handle.pyx":398 + /* "ssh2/sftp_handle.pyx":395 * cdef SFTPStatVFS vfs = SFTPStatVFS(self) * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -7340,7 +7340,7 @@ static PyObject *__pyx_pf_4ssh2_11sftp_handle_10SFTPHandle_46fstatvfs(struct __p #endif /*try:*/ { - /* "ssh2/sftp_handle.pyx":399 + /* "ssh2/sftp_handle.pyx":396 * cdef int rc * with nogil: * rc = c_sftp.libssh2_sftp_fstatvfs(self._handle, vfs._ptr) # <<<<<<<<<<<<<< @@ -7350,7 +7350,7 @@ static PyObject *__pyx_pf_4ssh2_11sftp_handle_10SFTPHandle_46fstatvfs(struct __p __pyx_v_rc = libssh2_sftp_fstatvfs(__pyx_v_self->_handle, __pyx_v_vfs->_ptr); } - /* "ssh2/sftp_handle.pyx":398 + /* "ssh2/sftp_handle.pyx":395 * cdef SFTPStatVFS vfs = SFTPStatVFS(self) * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -7369,7 +7369,7 @@ static PyObject *__pyx_pf_4ssh2_11sftp_handle_10SFTPHandle_46fstatvfs(struct __p } } - /* "ssh2/sftp_handle.pyx":400 + /* "ssh2/sftp_handle.pyx":397 * with nogil: * rc = c_sftp.libssh2_sftp_fstatvfs(self._handle, vfs._ptr) * if rc != 0: # <<<<<<<<<<<<<< @@ -7379,7 +7379,7 @@ static PyObject *__pyx_pf_4ssh2_11sftp_handle_10SFTPHandle_46fstatvfs(struct __p __pyx_t_2 = ((__pyx_v_rc != 0) != 0); if (__pyx_t_2) { - /* "ssh2/sftp_handle.pyx":401 + /* "ssh2/sftp_handle.pyx":398 * rc = c_sftp.libssh2_sftp_fstatvfs(self._handle, vfs._ptr) * if rc != 0: * return handle_error_codes(rc) # <<<<<<<<<<<<<< @@ -7387,14 +7387,14 @@ static PyObject *__pyx_pf_4ssh2_11sftp_handle_10SFTPHandle_46fstatvfs(struct __p * */ __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, 401, __pyx_L1_error) - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 401, __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, 398, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 398, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/sftp_handle.pyx":400 + /* "ssh2/sftp_handle.pyx":397 * with nogil: * rc = c_sftp.libssh2_sftp_fstatvfs(self._handle, vfs._ptr) * if rc != 0: # <<<<<<<<<<<<<< @@ -7403,7 +7403,7 @@ static PyObject *__pyx_pf_4ssh2_11sftp_handle_10SFTPHandle_46fstatvfs(struct __p */ } - /* "ssh2/sftp_handle.pyx":402 + /* "ssh2/sftp_handle.pyx":399 * if rc != 0: * return handle_error_codes(rc) * return vfs # <<<<<<<<<<<<<< @@ -7415,7 +7415,7 @@ static PyObject *__pyx_pf_4ssh2_11sftp_handle_10SFTPHandle_46fstatvfs(struct __p __pyx_r = ((PyObject *)__pyx_v_vfs); goto __pyx_L0; - /* "ssh2/sftp_handle.pyx":392 + /* "ssh2/sftp_handle.pyx":389 * return handle_error_codes(rc) * * def fstatvfs(self): # <<<<<<<<<<<<<< @@ -7550,7 +7550,7 @@ static PyObject *__pyx_pf_4ssh2_11sftp_handle_10SFTPHandle_50__setstate_cython__ return __pyx_r; } -/* "ssh2/sftp_handle.pyx":408 +/* "ssh2/sftp_handle.pyx":405 * """File system statistics""" * * def __cinit__(self, _sftp_ref): # <<<<<<<<<<<<<< @@ -7587,7 +7587,7 @@ static int __pyx_pw_4ssh2_11sftp_handle_11SFTPStatVFS_1__cinit__(PyObject *__pyx 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, 408, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 405, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; @@ -7598,7 +7598,7 @@ static int __pyx_pw_4ssh2_11sftp_handle_11SFTPStatVFS_1__cinit__(PyObject *__pyx } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 408, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 405, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh2.sftp_handle.SFTPStatVFS.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -7620,7 +7620,7 @@ static int __pyx_pf_4ssh2_11sftp_handle_11SFTPStatVFS___cinit__(struct __pyx_obj int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "ssh2/sftp_handle.pyx":409 + /* "ssh2/sftp_handle.pyx":406 * * def __cinit__(self, _sftp_ref): * self._sftp_ref = _sftp_ref # <<<<<<<<<<<<<< @@ -7633,7 +7633,7 @@ static int __pyx_pf_4ssh2_11sftp_handle_11SFTPStatVFS___cinit__(struct __pyx_obj __Pyx_DECREF(__pyx_v_self->_sftp_ref); __pyx_v_self->_sftp_ref = __pyx_v__sftp_ref; - /* "ssh2/sftp_handle.pyx":410 + /* "ssh2/sftp_handle.pyx":407 * def __cinit__(self, _sftp_ref): * self._sftp_ref = _sftp_ref * with nogil: # <<<<<<<<<<<<<< @@ -7648,7 +7648,7 @@ static int __pyx_pf_4ssh2_11sftp_handle_11SFTPStatVFS___cinit__(struct __pyx_obj #endif /*try:*/ { - /* "ssh2/sftp_handle.pyx":411 + /* "ssh2/sftp_handle.pyx":408 * self._sftp_ref = _sftp_ref * with nogil: * self._ptr = malloc( # <<<<<<<<<<<<<< @@ -7657,7 +7657,7 @@ static int __pyx_pf_4ssh2_11sftp_handle_11SFTPStatVFS___cinit__(struct __pyx_obj */ __pyx_v_self->_ptr = ((LIBSSH2_SFTP_STATVFS *)malloc((sizeof(LIBSSH2_SFTP_STATVFS)))); - /* "ssh2/sftp_handle.pyx":413 + /* "ssh2/sftp_handle.pyx":410 * self._ptr = malloc( * sizeof(c_sftp.LIBSSH2_SFTP_STATVFS)) * if self._ptr is NULL: # <<<<<<<<<<<<<< @@ -7667,7 +7667,7 @@ static int __pyx_pf_4ssh2_11sftp_handle_11SFTPStatVFS___cinit__(struct __pyx_obj __pyx_t_1 = ((__pyx_v_self->_ptr == NULL) != 0); if (__pyx_t_1) { - /* "ssh2/sftp_handle.pyx":414 + /* "ssh2/sftp_handle.pyx":411 * sizeof(c_sftp.LIBSSH2_SFTP_STATVFS)) * if self._ptr is NULL: * with gil: # <<<<<<<<<<<<<< @@ -7680,17 +7680,17 @@ static int __pyx_pf_4ssh2_11sftp_handle_11SFTPStatVFS___cinit__(struct __pyx_obj #endif /*try:*/ { - /* "ssh2/sftp_handle.pyx":415 + /* "ssh2/sftp_handle.pyx":412 * if self._ptr is NULL: * with gil: * raise MemoryError # <<<<<<<<<<<<<< * self._ptr.f_bsize = 0 * self._ptr.f_frsize = 0 */ - PyErr_NoMemory(); __PYX_ERR(0, 415, __pyx_L8_error) + PyErr_NoMemory(); __PYX_ERR(0, 412, __pyx_L8_error) } - /* "ssh2/sftp_handle.pyx":414 + /* "ssh2/sftp_handle.pyx":411 * sizeof(c_sftp.LIBSSH2_SFTP_STATVFS)) * if self._ptr is NULL: * with gil: # <<<<<<<<<<<<<< @@ -7707,7 +7707,7 @@ static int __pyx_pf_4ssh2_11sftp_handle_11SFTPStatVFS___cinit__(struct __pyx_obj } } - /* "ssh2/sftp_handle.pyx":413 + /* "ssh2/sftp_handle.pyx":410 * self._ptr = malloc( * sizeof(c_sftp.LIBSSH2_SFTP_STATVFS)) * if self._ptr is NULL: # <<<<<<<<<<<<<< @@ -7716,7 +7716,7 @@ static int __pyx_pf_4ssh2_11sftp_handle_11SFTPStatVFS___cinit__(struct __pyx_obj */ } - /* "ssh2/sftp_handle.pyx":416 + /* "ssh2/sftp_handle.pyx":413 * with gil: * raise MemoryError * self._ptr.f_bsize = 0 # <<<<<<<<<<<<<< @@ -7725,7 +7725,7 @@ static int __pyx_pf_4ssh2_11sftp_handle_11SFTPStatVFS___cinit__(struct __pyx_obj */ __pyx_v_self->_ptr->f_bsize = 0; - /* "ssh2/sftp_handle.pyx":417 + /* "ssh2/sftp_handle.pyx":414 * raise MemoryError * self._ptr.f_bsize = 0 * self._ptr.f_frsize = 0 # <<<<<<<<<<<<<< @@ -7734,7 +7734,7 @@ static int __pyx_pf_4ssh2_11sftp_handle_11SFTPStatVFS___cinit__(struct __pyx_obj */ __pyx_v_self->_ptr->f_frsize = 0; - /* "ssh2/sftp_handle.pyx":418 + /* "ssh2/sftp_handle.pyx":415 * self._ptr.f_bsize = 0 * self._ptr.f_frsize = 0 * self._ptr.f_blocks = 0 # <<<<<<<<<<<<<< @@ -7743,7 +7743,7 @@ static int __pyx_pf_4ssh2_11sftp_handle_11SFTPStatVFS___cinit__(struct __pyx_obj */ __pyx_v_self->_ptr->f_blocks = 0; - /* "ssh2/sftp_handle.pyx":419 + /* "ssh2/sftp_handle.pyx":416 * self._ptr.f_frsize = 0 * self._ptr.f_blocks = 0 * self._ptr.f_bfree = 0 # <<<<<<<<<<<<<< @@ -7752,7 +7752,7 @@ static int __pyx_pf_4ssh2_11sftp_handle_11SFTPStatVFS___cinit__(struct __pyx_obj */ __pyx_v_self->_ptr->f_bfree = 0; - /* "ssh2/sftp_handle.pyx":420 + /* "ssh2/sftp_handle.pyx":417 * self._ptr.f_blocks = 0 * self._ptr.f_bfree = 0 * self._ptr.f_bavail = 0 # <<<<<<<<<<<<<< @@ -7761,7 +7761,7 @@ static int __pyx_pf_4ssh2_11sftp_handle_11SFTPStatVFS___cinit__(struct __pyx_obj */ __pyx_v_self->_ptr->f_bavail = 0; - /* "ssh2/sftp_handle.pyx":421 + /* "ssh2/sftp_handle.pyx":418 * self._ptr.f_bfree = 0 * self._ptr.f_bavail = 0 * self._ptr.f_files = 0 # <<<<<<<<<<<<<< @@ -7770,7 +7770,7 @@ static int __pyx_pf_4ssh2_11sftp_handle_11SFTPStatVFS___cinit__(struct __pyx_obj */ __pyx_v_self->_ptr->f_files = 0; - /* "ssh2/sftp_handle.pyx":422 + /* "ssh2/sftp_handle.pyx":419 * self._ptr.f_bavail = 0 * self._ptr.f_files = 0 * self._ptr.f_ffree = 0 # <<<<<<<<<<<<<< @@ -7779,7 +7779,7 @@ static int __pyx_pf_4ssh2_11sftp_handle_11SFTPStatVFS___cinit__(struct __pyx_obj */ __pyx_v_self->_ptr->f_ffree = 0; - /* "ssh2/sftp_handle.pyx":423 + /* "ssh2/sftp_handle.pyx":420 * self._ptr.f_files = 0 * self._ptr.f_ffree = 0 * self._ptr.f_favail = 0 # <<<<<<<<<<<<<< @@ -7788,7 +7788,7 @@ static int __pyx_pf_4ssh2_11sftp_handle_11SFTPStatVFS___cinit__(struct __pyx_obj */ __pyx_v_self->_ptr->f_favail = 0; - /* "ssh2/sftp_handle.pyx":424 + /* "ssh2/sftp_handle.pyx":421 * self._ptr.f_ffree = 0 * self._ptr.f_favail = 0 * self._ptr.f_fsid = 0 # <<<<<<<<<<<<<< @@ -7797,7 +7797,7 @@ static int __pyx_pf_4ssh2_11sftp_handle_11SFTPStatVFS___cinit__(struct __pyx_obj */ __pyx_v_self->_ptr->f_fsid = 0; - /* "ssh2/sftp_handle.pyx":425 + /* "ssh2/sftp_handle.pyx":422 * self._ptr.f_favail = 0 * self._ptr.f_fsid = 0 * self._ptr.f_flag = 0 # <<<<<<<<<<<<<< @@ -7806,7 +7806,7 @@ static int __pyx_pf_4ssh2_11sftp_handle_11SFTPStatVFS___cinit__(struct __pyx_obj */ __pyx_v_self->_ptr->f_flag = 0; - /* "ssh2/sftp_handle.pyx":426 + /* "ssh2/sftp_handle.pyx":423 * self._ptr.f_fsid = 0 * self._ptr.f_flag = 0 * self._ptr.f_namemax = 0 # <<<<<<<<<<<<<< @@ -7816,7 +7816,7 @@ static int __pyx_pf_4ssh2_11sftp_handle_11SFTPStatVFS___cinit__(struct __pyx_obj __pyx_v_self->_ptr->f_namemax = 0; } - /* "ssh2/sftp_handle.pyx":410 + /* "ssh2/sftp_handle.pyx":407 * def __cinit__(self, _sftp_ref): * self._sftp_ref = _sftp_ref * with nogil: # <<<<<<<<<<<<<< @@ -7842,7 +7842,7 @@ static int __pyx_pf_4ssh2_11sftp_handle_11SFTPStatVFS___cinit__(struct __pyx_obj } } - /* "ssh2/sftp_handle.pyx":408 + /* "ssh2/sftp_handle.pyx":405 * """File system statistics""" * * def __cinit__(self, _sftp_ref): # <<<<<<<<<<<<<< @@ -7861,7 +7861,7 @@ static int __pyx_pf_4ssh2_11sftp_handle_11SFTPStatVFS___cinit__(struct __pyx_obj return __pyx_r; } -/* "ssh2/sftp_handle.pyx":428 +/* "ssh2/sftp_handle.pyx":425 * self._ptr.f_namemax = 0 * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -7885,7 +7885,7 @@ static void __pyx_pf_4ssh2_11sftp_handle_11SFTPStatVFS_2__dealloc__(struct __pyx int __pyx_t_1; __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "ssh2/sftp_handle.pyx":429 + /* "ssh2/sftp_handle.pyx":426 * * def __dealloc__(self): * with nogil: # <<<<<<<<<<<<<< @@ -7900,7 +7900,7 @@ static void __pyx_pf_4ssh2_11sftp_handle_11SFTPStatVFS_2__dealloc__(struct __pyx #endif /*try:*/ { - /* "ssh2/sftp_handle.pyx":430 + /* "ssh2/sftp_handle.pyx":427 * def __dealloc__(self): * with nogil: * if self._ptr is not NULL: # <<<<<<<<<<<<<< @@ -7910,7 +7910,7 @@ static void __pyx_pf_4ssh2_11sftp_handle_11SFTPStatVFS_2__dealloc__(struct __pyx __pyx_t_1 = ((__pyx_v_self->_ptr != NULL) != 0); if (__pyx_t_1) { - /* "ssh2/sftp_handle.pyx":431 + /* "ssh2/sftp_handle.pyx":428 * with nogil: * if self._ptr is not NULL: * free(self._ptr) # <<<<<<<<<<<<<< @@ -7919,7 +7919,7 @@ static void __pyx_pf_4ssh2_11sftp_handle_11SFTPStatVFS_2__dealloc__(struct __pyx */ free(__pyx_v_self->_ptr); - /* "ssh2/sftp_handle.pyx":430 + /* "ssh2/sftp_handle.pyx":427 * def __dealloc__(self): * with nogil: * if self._ptr is not NULL: # <<<<<<<<<<<<<< @@ -7929,7 +7929,7 @@ static void __pyx_pf_4ssh2_11sftp_handle_11SFTPStatVFS_2__dealloc__(struct __pyx } } - /* "ssh2/sftp_handle.pyx":429 + /* "ssh2/sftp_handle.pyx":426 * * def __dealloc__(self): * with nogil: # <<<<<<<<<<<<<< @@ -7948,7 +7948,7 @@ static void __pyx_pf_4ssh2_11sftp_handle_11SFTPStatVFS_2__dealloc__(struct __pyx } } - /* "ssh2/sftp_handle.pyx":428 + /* "ssh2/sftp_handle.pyx":425 * self._ptr.f_namemax = 0 * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -7960,7 +7960,7 @@ static void __pyx_pf_4ssh2_11sftp_handle_11SFTPStatVFS_2__dealloc__(struct __pyx __Pyx_RefNannyFinishContext(); } -/* "ssh2/sftp_handle.pyx":434 +/* "ssh2/sftp_handle.pyx":431 * * @property * def f_bsize(self): # <<<<<<<<<<<<<< @@ -7990,7 +7990,7 @@ static PyObject *__pyx_pf_4ssh2_11sftp_handle_11SFTPStatVFS_7f_bsize___get__(str int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "ssh2/sftp_handle.pyx":436 + /* "ssh2/sftp_handle.pyx":433 * def f_bsize(self): * """File system block size""" * return self._ptr.f_bsize # <<<<<<<<<<<<<< @@ -7998,13 +7998,13 @@ static PyObject *__pyx_pf_4ssh2_11sftp_handle_11SFTPStatVFS_7f_bsize___get__(str * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_libssh2_uint64_t(__pyx_v_self->_ptr->f_bsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 436, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_libssh2_uint64_t(__pyx_v_self->_ptr->f_bsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 433, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/sftp_handle.pyx":434 + /* "ssh2/sftp_handle.pyx":431 * * @property * def f_bsize(self): # <<<<<<<<<<<<<< @@ -8023,7 +8023,7 @@ static PyObject *__pyx_pf_4ssh2_11sftp_handle_11SFTPStatVFS_7f_bsize___get__(str return __pyx_r; } -/* "ssh2/sftp_handle.pyx":439 +/* "ssh2/sftp_handle.pyx":436 * * @property * def f_frsize(self): # <<<<<<<<<<<<<< @@ -8053,7 +8053,7 @@ static PyObject *__pyx_pf_4ssh2_11sftp_handle_11SFTPStatVFS_8f_frsize___get__(st int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "ssh2/sftp_handle.pyx":441 + /* "ssh2/sftp_handle.pyx":438 * def f_frsize(self): * """Fragment size""" * return self._ptr.f_frsize # <<<<<<<<<<<<<< @@ -8061,13 +8061,13 @@ static PyObject *__pyx_pf_4ssh2_11sftp_handle_11SFTPStatVFS_8f_frsize___get__(st * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_libssh2_uint64_t(__pyx_v_self->_ptr->f_frsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 441, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_libssh2_uint64_t(__pyx_v_self->_ptr->f_frsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 438, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/sftp_handle.pyx":439 + /* "ssh2/sftp_handle.pyx":436 * * @property * def f_frsize(self): # <<<<<<<<<<<<<< @@ -8086,7 +8086,7 @@ static PyObject *__pyx_pf_4ssh2_11sftp_handle_11SFTPStatVFS_8f_frsize___get__(st return __pyx_r; } -/* "ssh2/sftp_handle.pyx":444 +/* "ssh2/sftp_handle.pyx":441 * * @property * def f_blocks(self): # <<<<<<<<<<<<<< @@ -8116,7 +8116,7 @@ static PyObject *__pyx_pf_4ssh2_11sftp_handle_11SFTPStatVFS_8f_blocks___get__(st int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "ssh2/sftp_handle.pyx":446 + /* "ssh2/sftp_handle.pyx":443 * def f_blocks(self): * """Size of fs in f_frsize units""" * return self._ptr.f_blocks # <<<<<<<<<<<<<< @@ -8124,13 +8124,13 @@ static PyObject *__pyx_pf_4ssh2_11sftp_handle_11SFTPStatVFS_8f_blocks___get__(st * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_libssh2_uint64_t(__pyx_v_self->_ptr->f_blocks); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 446, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_libssh2_uint64_t(__pyx_v_self->_ptr->f_blocks); 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/sftp_handle.pyx":444 + /* "ssh2/sftp_handle.pyx":441 * * @property * def f_blocks(self): # <<<<<<<<<<<<<< @@ -8149,7 +8149,7 @@ static PyObject *__pyx_pf_4ssh2_11sftp_handle_11SFTPStatVFS_8f_blocks___get__(st return __pyx_r; } -/* "ssh2/sftp_handle.pyx":449 +/* "ssh2/sftp_handle.pyx":446 * * @property * def f_bfree(self): # <<<<<<<<<<<<<< @@ -8179,7 +8179,7 @@ static PyObject *__pyx_pf_4ssh2_11sftp_handle_11SFTPStatVFS_7f_bfree___get__(str int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "ssh2/sftp_handle.pyx":451 + /* "ssh2/sftp_handle.pyx":448 * def f_bfree(self): * """Free blocks""" * return self._ptr.f_bfree # <<<<<<<<<<<<<< @@ -8187,13 +8187,13 @@ static PyObject *__pyx_pf_4ssh2_11sftp_handle_11SFTPStatVFS_7f_bfree___get__(str * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_libssh2_uint64_t(__pyx_v_self->_ptr->f_bfree); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 451, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_libssh2_uint64_t(__pyx_v_self->_ptr->f_bfree); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 448, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/sftp_handle.pyx":449 + /* "ssh2/sftp_handle.pyx":446 * * @property * def f_bfree(self): # <<<<<<<<<<<<<< @@ -8212,7 +8212,7 @@ static PyObject *__pyx_pf_4ssh2_11sftp_handle_11SFTPStatVFS_7f_bfree___get__(str return __pyx_r; } -/* "ssh2/sftp_handle.pyx":454 +/* "ssh2/sftp_handle.pyx":451 * * @property * def f_bavail(self): # <<<<<<<<<<<<<< @@ -8242,7 +8242,7 @@ static PyObject *__pyx_pf_4ssh2_11sftp_handle_11SFTPStatVFS_8f_bavail___get__(st int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "ssh2/sftp_handle.pyx":456 + /* "ssh2/sftp_handle.pyx":453 * def f_bavail(self): * """Free blocks for non-root""" * return self._ptr.f_bavail # <<<<<<<<<<<<<< @@ -8250,13 +8250,13 @@ static PyObject *__pyx_pf_4ssh2_11sftp_handle_11SFTPStatVFS_8f_bavail___get__(st * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_libssh2_uint64_t(__pyx_v_self->_ptr->f_bavail); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_libssh2_uint64_t(__pyx_v_self->_ptr->f_bavail); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 453, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/sftp_handle.pyx":454 + /* "ssh2/sftp_handle.pyx":451 * * @property * def f_bavail(self): # <<<<<<<<<<<<<< @@ -8275,7 +8275,7 @@ static PyObject *__pyx_pf_4ssh2_11sftp_handle_11SFTPStatVFS_8f_bavail___get__(st return __pyx_r; } -/* "ssh2/sftp_handle.pyx":459 +/* "ssh2/sftp_handle.pyx":456 * * @property * def f_files(self): # <<<<<<<<<<<<<< @@ -8305,7 +8305,7 @@ static PyObject *__pyx_pf_4ssh2_11sftp_handle_11SFTPStatVFS_7f_files___get__(str int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "ssh2/sftp_handle.pyx":461 + /* "ssh2/sftp_handle.pyx":458 * def f_files(self): * """Inodes""" * return self._ptr.f_files # <<<<<<<<<<<<<< @@ -8313,13 +8313,13 @@ static PyObject *__pyx_pf_4ssh2_11sftp_handle_11SFTPStatVFS_7f_files___get__(str * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_libssh2_uint64_t(__pyx_v_self->_ptr->f_files); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 461, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_libssh2_uint64_t(__pyx_v_self->_ptr->f_files); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/sftp_handle.pyx":459 + /* "ssh2/sftp_handle.pyx":456 * * @property * def f_files(self): # <<<<<<<<<<<<<< @@ -8338,7 +8338,7 @@ static PyObject *__pyx_pf_4ssh2_11sftp_handle_11SFTPStatVFS_7f_files___get__(str return __pyx_r; } -/* "ssh2/sftp_handle.pyx":464 +/* "ssh2/sftp_handle.pyx":461 * * @property * def f_ffree(self): # <<<<<<<<<<<<<< @@ -8368,7 +8368,7 @@ static PyObject *__pyx_pf_4ssh2_11sftp_handle_11SFTPStatVFS_7f_ffree___get__(str int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "ssh2/sftp_handle.pyx":466 + /* "ssh2/sftp_handle.pyx":463 * def f_ffree(self): * """Free inodes""" * return self._ptr.f_ffree # <<<<<<<<<<<<<< @@ -8376,13 +8376,13 @@ static PyObject *__pyx_pf_4ssh2_11sftp_handle_11SFTPStatVFS_7f_ffree___get__(str * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_libssh2_uint64_t(__pyx_v_self->_ptr->f_ffree); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 466, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_libssh2_uint64_t(__pyx_v_self->_ptr->f_ffree); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 463, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/sftp_handle.pyx":464 + /* "ssh2/sftp_handle.pyx":461 * * @property * def f_ffree(self): # <<<<<<<<<<<<<< @@ -8401,7 +8401,7 @@ static PyObject *__pyx_pf_4ssh2_11sftp_handle_11SFTPStatVFS_7f_ffree___get__(str return __pyx_r; } -/* "ssh2/sftp_handle.pyx":469 +/* "ssh2/sftp_handle.pyx":466 * * @property * def f_favail(self): # <<<<<<<<<<<<<< @@ -8431,7 +8431,7 @@ static PyObject *__pyx_pf_4ssh2_11sftp_handle_11SFTPStatVFS_8f_favail___get__(st int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "ssh2/sftp_handle.pyx":471 + /* "ssh2/sftp_handle.pyx":468 * def f_favail(self): * """Free inodes for non-root""" * return self._ptr.f_favail # <<<<<<<<<<<<<< @@ -8439,13 +8439,13 @@ static PyObject *__pyx_pf_4ssh2_11sftp_handle_11SFTPStatVFS_8f_favail___get__(st * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_libssh2_uint64_t(__pyx_v_self->_ptr->f_favail); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 471, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_libssh2_uint64_t(__pyx_v_self->_ptr->f_favail); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/sftp_handle.pyx":469 + /* "ssh2/sftp_handle.pyx":466 * * @property * def f_favail(self): # <<<<<<<<<<<<<< @@ -8464,7 +8464,7 @@ static PyObject *__pyx_pf_4ssh2_11sftp_handle_11SFTPStatVFS_8f_favail___get__(st return __pyx_r; } -/* "ssh2/sftp_handle.pyx":474 +/* "ssh2/sftp_handle.pyx":471 * * @property * def f_fsid(self): # <<<<<<<<<<<<<< @@ -8494,7 +8494,7 @@ static PyObject *__pyx_pf_4ssh2_11sftp_handle_11SFTPStatVFS_6f_fsid___get__(stru int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "ssh2/sftp_handle.pyx":476 + /* "ssh2/sftp_handle.pyx":473 * def f_fsid(self): * """File system ID""" * return self._ptr.f_fsid # <<<<<<<<<<<<<< @@ -8502,13 +8502,13 @@ static PyObject *__pyx_pf_4ssh2_11sftp_handle_11SFTPStatVFS_6f_fsid___get__(stru * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_libssh2_uint64_t(__pyx_v_self->_ptr->f_fsid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 476, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_libssh2_uint64_t(__pyx_v_self->_ptr->f_fsid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 473, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/sftp_handle.pyx":474 + /* "ssh2/sftp_handle.pyx":471 * * @property * def f_fsid(self): # <<<<<<<<<<<<<< @@ -8527,7 +8527,7 @@ static PyObject *__pyx_pf_4ssh2_11sftp_handle_11SFTPStatVFS_6f_fsid___get__(stru return __pyx_r; } -/* "ssh2/sftp_handle.pyx":479 +/* "ssh2/sftp_handle.pyx":476 * * @property * def f_flag(self): # <<<<<<<<<<<<<< @@ -8557,7 +8557,7 @@ static PyObject *__pyx_pf_4ssh2_11sftp_handle_11SFTPStatVFS_6f_flag___get__(stru int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "ssh2/sftp_handle.pyx":484 + /* "ssh2/sftp_handle.pyx":481 * This property is a bit mask with defined bits * ``LIBSSH2_SFTP_ST_RDONLY`` and ``LIBSSH2_SFTP_ST_NOSUID``""" * return self._ptr.f_flag # <<<<<<<<<<<<<< @@ -8565,13 +8565,13 @@ static PyObject *__pyx_pf_4ssh2_11sftp_handle_11SFTPStatVFS_6f_flag___get__(stru * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_libssh2_uint64_t(__pyx_v_self->_ptr->f_flag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 484, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_libssh2_uint64_t(__pyx_v_self->_ptr->f_flag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 481, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/sftp_handle.pyx":479 + /* "ssh2/sftp_handle.pyx":476 * * @property * def f_flag(self): # <<<<<<<<<<<<<< @@ -8590,7 +8590,7 @@ static PyObject *__pyx_pf_4ssh2_11sftp_handle_11SFTPStatVFS_6f_flag___get__(stru return __pyx_r; } -/* "ssh2/sftp_handle.pyx":487 +/* "ssh2/sftp_handle.pyx":484 * * @property * def f_namemax(self): # <<<<<<<<<<<<<< @@ -8620,19 +8620,19 @@ static PyObject *__pyx_pf_4ssh2_11sftp_handle_11SFTPStatVFS_9f_namemax___get__(s int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "ssh2/sftp_handle.pyx":489 + /* "ssh2/sftp_handle.pyx":486 * def f_namemax(self): * """Maximum filename length""" * return self._ptr.f_namemax # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_libssh2_uint64_t(__pyx_v_self->_ptr->f_namemax); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 489, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_libssh2_uint64_t(__pyx_v_self->_ptr->f_namemax); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 486, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/sftp_handle.pyx":487 + /* "ssh2/sftp_handle.pyx":484 * * @property * def f_namemax(self): # <<<<<<<<<<<<<< @@ -9803,15 +9803,15 @@ static int __Pyx_modinit_type_init_code(void) { if (PyObject_SetAttr(__pyx_m, __pyx_n_s_SFTPAttributes, (PyObject *)&__pyx_type_4ssh2_11sftp_handle_SFTPAttributes) < 0) __PYX_ERR(0, 33, __pyx_L1_error) if (__Pyx_setup_reduce((PyObject*)&__pyx_type_4ssh2_11sftp_handle_SFTPAttributes) < 0) __PYX_ERR(0, 33, __pyx_L1_error) __pyx_ptype_4ssh2_11sftp_handle_SFTPAttributes = &__pyx_type_4ssh2_11sftp_handle_SFTPAttributes; - if (PyType_Ready(&__pyx_type_4ssh2_11sftp_handle_SFTPStatVFS) < 0) __PYX_ERR(0, 405, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_4ssh2_11sftp_handle_SFTPStatVFS) < 0) __PYX_ERR(0, 402, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_4ssh2_11sftp_handle_SFTPStatVFS.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4ssh2_11sftp_handle_SFTPStatVFS.tp_dictoffset && __pyx_type_4ssh2_11sftp_handle_SFTPStatVFS.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_4ssh2_11sftp_handle_SFTPStatVFS.tp_getattro = __Pyx_PyObject_GenericGetAttr; } - if (PyObject_SetAttr(__pyx_m, __pyx_n_s_SFTPStatVFS, (PyObject *)&__pyx_type_4ssh2_11sftp_handle_SFTPStatVFS) < 0) __PYX_ERR(0, 405, __pyx_L1_error) - if (__Pyx_setup_reduce((PyObject*)&__pyx_type_4ssh2_11sftp_handle_SFTPStatVFS) < 0) __PYX_ERR(0, 405, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_SFTPStatVFS, (PyObject *)&__pyx_type_4ssh2_11sftp_handle_SFTPStatVFS) < 0) __PYX_ERR(0, 402, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_4ssh2_11sftp_handle_SFTPStatVFS) < 0) __PYX_ERR(0, 402, __pyx_L1_error) __pyx_ptype_4ssh2_11sftp_handle_SFTPStatVFS = &__pyx_type_4ssh2_11sftp_handle_SFTPStatVFS; if (PyType_Ready(&__pyx_type_4ssh2_11sftp_handle___pyx_scope_struct__readdir_ex) < 0) __PYX_ERR(0, 180, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 diff --git a/ssh2/sftp_handle.pyx b/ssh2/sftp_handle.pyx index 38ab552c..a8bbab56 100644 --- a/ssh2/sftp_handle.pyx +++ b/ssh2/sftp_handle.pyx @@ -297,17 +297,14 @@ cdef class SFTPHandle: bytes_written = tot_size - _size return rc, bytes_written - IF EMBEDDED_LIB: - def fsync(self): - """Sync file handle data. + def fsync(self): + """Sync file handle data. - Available from libssh2 >= ``1.4.4`` - - :rtype: int""" - cdef int rc - with nogil: - rc = c_sftp.libssh2_sftp_fsync(self._handle) - return handle_error_codes(rc) + :rtype: int""" + cdef int rc + with nogil: + rc = c_sftp.libssh2_sftp_fsync(self._handle) + return handle_error_codes(rc) def seek(self, size_t offset): """Deprecated, use seek64. diff --git a/ssh2/statinfo.c b/ssh2/statinfo.c index f07f4bca..f0285131 100644 --- a/ssh2/statinfo.c +++ b/ssh2/statinfo.c @@ -1259,8 +1259,8 @@ static int __pyx_pf_4ssh2_8statinfo_8StatInfo___cinit__(struct __pyx_obj_4ssh2_8 * raise MemoryError * * def __dealloc__(self): # <<<<<<<<<<<<<< - * free(self._stat) - * + * if self._stat is not NULL: + * free(self._stat) */ /* Python wrapper */ @@ -1276,30 +1276,59 @@ static void __pyx_pw_4ssh2_8statinfo_8StatInfo_3__dealloc__(PyObject *__pyx_v_se static void __pyx_pf_4ssh2_8statinfo_8StatInfo_2__dealloc__(struct __pyx_obj_4ssh2_8statinfo_StatInfo *__pyx_v_self) { __Pyx_RefNannyDeclarations + int __pyx_t_1; __Pyx_RefNannySetupContext("__dealloc__", 0); /* "ssh2/statinfo.pyx":31 * * def __dealloc__(self): - * free(self._stat) # <<<<<<<<<<<<<< + * if self._stat is not NULL: # <<<<<<<<<<<<<< + * free(self._stat) + * self._stat = NULL + */ + __pyx_t_1 = ((__pyx_v_self->_stat != NULL) != 0); + if (__pyx_t_1) { + + /* "ssh2/statinfo.pyx":32 + * def __dealloc__(self): + * if self._stat is not NULL: + * free(self._stat) # <<<<<<<<<<<<<< + * self._stat = NULL + * + */ + free(__pyx_v_self->_stat); + + /* "ssh2/statinfo.pyx":31 + * + * def __dealloc__(self): + * if self._stat is not NULL: # <<<<<<<<<<<<<< + * free(self._stat) + * self._stat = NULL + */ + } + + /* "ssh2/statinfo.pyx":33 + * if self._stat is not NULL: + * free(self._stat) + * self._stat = NULL # <<<<<<<<<<<<<< * * @property */ - free(__pyx_v_self->_stat); + __pyx_v_self->_stat = NULL; /* "ssh2/statinfo.pyx":30 * raise MemoryError * * def __dealloc__(self): # <<<<<<<<<<<<<< - * free(self._stat) - * + * if self._stat is not NULL: + * free(self._stat) */ /* function exit code */ __Pyx_RefNannyFinishContext(); } -/* "ssh2/statinfo.pyx":34 +/* "ssh2/statinfo.pyx":36 * * @property * def st_size(self): # <<<<<<<<<<<<<< @@ -1329,7 +1358,7 @@ static PyObject *__pyx_pf_4ssh2_8statinfo_8StatInfo_7st_size___get__(struct __py int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "ssh2/statinfo.pyx":35 + /* "ssh2/statinfo.pyx":37 * @property * def st_size(self): * return self._stat.st_size # <<<<<<<<<<<<<< @@ -1337,13 +1366,13 @@ static PyObject *__pyx_pf_4ssh2_8statinfo_8StatInfo_7st_size___get__(struct __py * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_unsigned_PY_LONG_LONG(__pyx_v_self->_stat->st_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 35, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_unsigned_PY_LONG_LONG(__pyx_v_self->_stat->st_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/statinfo.pyx":34 + /* "ssh2/statinfo.pyx":36 * * @property * def st_size(self): # <<<<<<<<<<<<<< @@ -1362,7 +1391,7 @@ static PyObject *__pyx_pf_4ssh2_8statinfo_8StatInfo_7st_size___get__(struct __py return __pyx_r; } -/* "ssh2/statinfo.pyx":38 +/* "ssh2/statinfo.pyx":40 * * @property * def st_ino(self): # <<<<<<<<<<<<<< @@ -1392,7 +1421,7 @@ static PyObject *__pyx_pf_4ssh2_8statinfo_8StatInfo_6st_ino___get__(struct __pyx int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "ssh2/statinfo.pyx":39 + /* "ssh2/statinfo.pyx":41 * @property * def st_ino(self): * return self._stat.st_ino # <<<<<<<<<<<<<< @@ -1400,13 +1429,13 @@ static PyObject *__pyx_pf_4ssh2_8statinfo_8StatInfo_6st_ino___get__(struct __pyx * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_unsigned_long(__pyx_v_self->_stat->st_ino); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 39, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_unsigned_long(__pyx_v_self->_stat->st_ino); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/statinfo.pyx":38 + /* "ssh2/statinfo.pyx":40 * * @property * def st_ino(self): # <<<<<<<<<<<<<< @@ -1425,7 +1454,7 @@ static PyObject *__pyx_pf_4ssh2_8statinfo_8StatInfo_6st_ino___get__(struct __pyx return __pyx_r; } -/* "ssh2/statinfo.pyx":42 +/* "ssh2/statinfo.pyx":44 * * @property * def st_mode(self): # <<<<<<<<<<<<<< @@ -1455,7 +1484,7 @@ static PyObject *__pyx_pf_4ssh2_8statinfo_8StatInfo_7st_mode___get__(struct __py int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "ssh2/statinfo.pyx":43 + /* "ssh2/statinfo.pyx":45 * @property * def st_mode(self): * return self._stat.st_mode # <<<<<<<<<<<<<< @@ -1463,13 +1492,13 @@ static PyObject *__pyx_pf_4ssh2_8statinfo_8StatInfo_7st_mode___get__(struct __py * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_unsigned_long(__pyx_v_self->_stat->st_mode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_unsigned_long(__pyx_v_self->_stat->st_mode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/statinfo.pyx":42 + /* "ssh2/statinfo.pyx":44 * * @property * def st_mode(self): # <<<<<<<<<<<<<< @@ -1488,7 +1517,7 @@ static PyObject *__pyx_pf_4ssh2_8statinfo_8StatInfo_7st_mode___get__(struct __py return __pyx_r; } -/* "ssh2/statinfo.pyx":46 +/* "ssh2/statinfo.pyx":48 * * @property * def st_nlink(self): # <<<<<<<<<<<<<< @@ -1518,7 +1547,7 @@ static PyObject *__pyx_pf_4ssh2_8statinfo_8StatInfo_8st_nlink___get__(struct __p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "ssh2/statinfo.pyx":47 + /* "ssh2/statinfo.pyx":49 * @property * def st_nlink(self): * return self._stat.st_nlink # <<<<<<<<<<<<<< @@ -1526,13 +1555,13 @@ static PyObject *__pyx_pf_4ssh2_8statinfo_8StatInfo_8st_nlink___get__(struct __p * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_self->_stat->st_nlink); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 47, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_self->_stat->st_nlink); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/statinfo.pyx":46 + /* "ssh2/statinfo.pyx":48 * * @property * def st_nlink(self): # <<<<<<<<<<<<<< @@ -1551,7 +1580,7 @@ static PyObject *__pyx_pf_4ssh2_8statinfo_8StatInfo_8st_nlink___get__(struct __p return __pyx_r; } -/* "ssh2/statinfo.pyx":50 +/* "ssh2/statinfo.pyx":52 * * @property * def st_uid(self): # <<<<<<<<<<<<<< @@ -1581,7 +1610,7 @@ static PyObject *__pyx_pf_4ssh2_8statinfo_8StatInfo_6st_uid___get__(struct __pyx int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "ssh2/statinfo.pyx":51 + /* "ssh2/statinfo.pyx":53 * @property * def st_uid(self): * return self._stat.st_uid # <<<<<<<<<<<<<< @@ -1589,13 +1618,13 @@ static PyObject *__pyx_pf_4ssh2_8statinfo_8StatInfo_6st_uid___get__(struct __pyx * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_self->_stat->st_uid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 51, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_self->_stat->st_uid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/statinfo.pyx":50 + /* "ssh2/statinfo.pyx":52 * * @property * def st_uid(self): # <<<<<<<<<<<<<< @@ -1614,7 +1643,7 @@ static PyObject *__pyx_pf_4ssh2_8statinfo_8StatInfo_6st_uid___get__(struct __pyx return __pyx_r; } -/* "ssh2/statinfo.pyx":54 +/* "ssh2/statinfo.pyx":56 * * @property * def st_gid(self): # <<<<<<<<<<<<<< @@ -1644,7 +1673,7 @@ static PyObject *__pyx_pf_4ssh2_8statinfo_8StatInfo_6st_gid___get__(struct __pyx int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "ssh2/statinfo.pyx":55 + /* "ssh2/statinfo.pyx":57 * @property * def st_gid(self): * return self._stat.st_gid # <<<<<<<<<<<<<< @@ -1652,13 +1681,13 @@ static PyObject *__pyx_pf_4ssh2_8statinfo_8StatInfo_6st_gid___get__(struct __pyx * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_self->_stat->st_gid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 55, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_self->_stat->st_gid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/statinfo.pyx":54 + /* "ssh2/statinfo.pyx":56 * * @property * def st_gid(self): # <<<<<<<<<<<<<< @@ -1677,7 +1706,7 @@ static PyObject *__pyx_pf_4ssh2_8statinfo_8StatInfo_6st_gid___get__(struct __pyx return __pyx_r; } -/* "ssh2/statinfo.pyx":58 +/* "ssh2/statinfo.pyx":60 * * @property * def st_rdev(self): # <<<<<<<<<<<<<< @@ -1707,7 +1736,7 @@ static PyObject *__pyx_pf_4ssh2_8statinfo_8StatInfo_7st_rdev___get__(struct __py int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "ssh2/statinfo.pyx":59 + /* "ssh2/statinfo.pyx":61 * @property * def st_rdev(self): * return self._stat.st_rdev # <<<<<<<<<<<<<< @@ -1715,13 +1744,13 @@ static PyObject *__pyx_pf_4ssh2_8statinfo_8StatInfo_7st_rdev___get__(struct __py * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_self->_stat->st_rdev); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 59, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_self->_stat->st_rdev); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/statinfo.pyx":58 + /* "ssh2/statinfo.pyx":60 * * @property * def st_rdev(self): # <<<<<<<<<<<<<< @@ -1740,7 +1769,7 @@ static PyObject *__pyx_pf_4ssh2_8statinfo_8StatInfo_7st_rdev___get__(struct __py return __pyx_r; } -/* "ssh2/statinfo.pyx":62 +/* "ssh2/statinfo.pyx":64 * * @property * def st_blksize(self): # <<<<<<<<<<<<<< @@ -1770,7 +1799,7 @@ static PyObject *__pyx_pf_4ssh2_8statinfo_8StatInfo_10st_blksize___get__(struct int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "ssh2/statinfo.pyx":64 + /* "ssh2/statinfo.pyx":66 * def st_blksize(self): * IF UNAME_SYSNAME != 'Windows': * return self._stat.st_blksize # <<<<<<<<<<<<<< @@ -1778,13 +1807,13 @@ static PyObject *__pyx_pf_4ssh2_8statinfo_8StatInfo_10st_blksize___get__(struct * return None */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_self->_stat->st_blksize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 64, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_self->_stat->st_blksize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/statinfo.pyx":62 + /* "ssh2/statinfo.pyx":64 * * @property * def st_blksize(self): # <<<<<<<<<<<<<< @@ -1803,7 +1832,7 @@ static PyObject *__pyx_pf_4ssh2_8statinfo_8StatInfo_10st_blksize___get__(struct return __pyx_r; } -/* "ssh2/statinfo.pyx":69 +/* "ssh2/statinfo.pyx":71 * * @property * def st_blocks(self): # <<<<<<<<<<<<<< @@ -1833,7 +1862,7 @@ static PyObject *__pyx_pf_4ssh2_8statinfo_8StatInfo_9st_blocks___get__(struct __ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "ssh2/statinfo.pyx":71 + /* "ssh2/statinfo.pyx":73 * def st_blocks(self): * IF UNAME_SYSNAME != 'Windows': * return self._stat.st_blocks # <<<<<<<<<<<<<< @@ -1841,13 +1870,13 @@ static PyObject *__pyx_pf_4ssh2_8statinfo_8StatInfo_9st_blocks___get__(struct __ * return None */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_self->_stat->st_blocks); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 71, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_self->_stat->st_blocks); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/statinfo.pyx":69 + /* "ssh2/statinfo.pyx":71 * * @property * def st_blocks(self): # <<<<<<<<<<<<<< @@ -1866,7 +1895,7 @@ static PyObject *__pyx_pf_4ssh2_8statinfo_8StatInfo_9st_blocks___get__(struct __ return __pyx_r; } -/* "ssh2/statinfo.pyx":76 +/* "ssh2/statinfo.pyx":78 * * @property * def st_atime(self): # <<<<<<<<<<<<<< @@ -1896,7 +1925,7 @@ static PyObject *__pyx_pf_4ssh2_8statinfo_8StatInfo_8st_atime___get__(struct __p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "ssh2/statinfo.pyx":77 + /* "ssh2/statinfo.pyx":79 * @property * def st_atime(self): * return self._stat.st_atime # <<<<<<<<<<<<<< @@ -1904,13 +1933,13 @@ static PyObject *__pyx_pf_4ssh2_8statinfo_8StatInfo_8st_atime___get__(struct __p * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_time_t(__pyx_v_self->_stat->st_atime); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 77, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_time_t(__pyx_v_self->_stat->st_atime); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/statinfo.pyx":76 + /* "ssh2/statinfo.pyx":78 * * @property * def st_atime(self): # <<<<<<<<<<<<<< @@ -1929,7 +1958,7 @@ static PyObject *__pyx_pf_4ssh2_8statinfo_8StatInfo_8st_atime___get__(struct __p return __pyx_r; } -/* "ssh2/statinfo.pyx":80 +/* "ssh2/statinfo.pyx":82 * * @property * def st_mtime(self): # <<<<<<<<<<<<<< @@ -1959,7 +1988,7 @@ static PyObject *__pyx_pf_4ssh2_8statinfo_8StatInfo_8st_mtime___get__(struct __p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "ssh2/statinfo.pyx":81 + /* "ssh2/statinfo.pyx":83 * @property * def st_mtime(self): * return self._stat.st_mtime # <<<<<<<<<<<<<< @@ -1967,13 +1996,13 @@ static PyObject *__pyx_pf_4ssh2_8statinfo_8StatInfo_8st_mtime___get__(struct __p * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_time_t(__pyx_v_self->_stat->st_mtime); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 81, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_time_t(__pyx_v_self->_stat->st_mtime); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/statinfo.pyx":80 + /* "ssh2/statinfo.pyx":82 * * @property * def st_mtime(self): # <<<<<<<<<<<<<< @@ -1992,7 +2021,7 @@ static PyObject *__pyx_pf_4ssh2_8statinfo_8StatInfo_8st_mtime___get__(struct __p return __pyx_r; } -/* "ssh2/statinfo.pyx":84 +/* "ssh2/statinfo.pyx":86 * * @property * def st_ctime(self): # <<<<<<<<<<<<<< @@ -2021,19 +2050,19 @@ static PyObject *__pyx_pf_4ssh2_8statinfo_8StatInfo_8st_ctime___get__(struct __p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "ssh2/statinfo.pyx":85 + /* "ssh2/statinfo.pyx":87 * @property * def st_ctime(self): * return self._stat.st_ctime # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_time_t(__pyx_v_self->_stat->st_ctime); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 85, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_time_t(__pyx_v_self->_stat->st_ctime); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/statinfo.pyx":84 + /* "ssh2/statinfo.pyx":86 * * @property * def st_ctime(self): # <<<<<<<<<<<<<< diff --git a/ssh2/statinfo.pyx b/ssh2/statinfo.pyx index c2d0b7d6..56da4fd3 100644 --- a/ssh2/statinfo.pyx +++ b/ssh2/statinfo.pyx @@ -28,7 +28,9 @@ cdef class StatInfo: raise MemoryError def __dealloc__(self): - free(self._stat) + if self._stat is not NULL: + free(self._stat) + self._stat = NULL @property def st_size(self): diff --git a/ssh2/utils.c b/ssh2/utils.c index 2264a099..cd577ebc 100644 --- a/ssh2/utils.c +++ b/ssh2/utils.c @@ -615,7 +615,7 @@ static CYTHON_INLINE float __PYX_NAN() { #define __PYX_HAVE__ssh2__utils #define __PYX_HAVE_API__ssh2__utils /* Early includes */ -#include "find_eol.h" +#include "ext/find_eol.h" #include #include #include diff --git a/ssh2/utils.pxd b/ssh2/utils.pxd index 2c945c5d..7209be8f 100644 --- a/ssh2/utils.pxd +++ b/ssh2/utils.pxd @@ -14,7 +14,7 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -cdef extern from "find_eol.h" nogil: +cdef extern from "ext/find_eol.h" nogil: int c_find_eol "find_eol" (char* data, int* new_pos) cdef bytes to_bytes(_str) cdef object to_str(char *c_str)