Skip to content

Commit 465f876

Browse files
authored
Channel dealloc (#19)
Fixed issue with channel double free when session open channel fails. Updated exception handling for session authentication. Updated tests. Removed unused exceptions. Added documentation. Updated readme, changelog.
1 parent 1747e32 commit 465f876

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+2814
-6296
lines changed

.circleci/config.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ jobs:
3737
flake8 ssh
3838
python setup.py sdist
3939
cd dist; pip install *; cd ..
40+
cd doc
41+
make html
42+
cd ..
4043
name: Test
4144

4245
osx:

.environment.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
channels:
2+
- conda-forge
3+
dependencies:
4+
- python
5+
- setuptools
6+
- libssh
7+
- toolchain3
8+
- cython

.readthedocs.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
conda:
2+
file: .environment.yml
3+
python:
4+
setup_py_install: true

.travis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ script:
3131
- flake8 ssh
3232
- python setup.py sdist
3333
- cd dist; pip install *; cd ..
34+
- cd doc
35+
- make html
36+
- cd ..
3437
jobs:
3538
include:
3639
- stage: build wheels

Changelog.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,24 @@
11
Change Log
22
=============
33

4+
5+
0.5.0
6+
+++++
7+
8+
Changes
9+
--------
10+
11+
* Updated exception handling to match libssh API - `ssh.exceptions.SSHError` raised on all non-specific errors.
12+
* Updated authentication exception handling to raise specific authentication errors.
13+
* Channel object initialisation now requires Session object to be passed in.
14+
15+
16+
Fixes
17+
------
18+
19+
* Channel deallocation would crash on double free when session channel open failed.
20+
21+
422
0.4.0
523
+++++++
624

README.rst

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,30 +17,25 @@ Bindings for libssh_ C library.
1717
:target: https://pypi.python.org/pypi/ssh-python
1818
.. image:: https://ci.appveyor.com/api/projects/status/2t4bmmtjvfy5s1in/branch/master?svg=true
1919
:target: https://ci.appveyor.com/project/pkittenis/ssh-python
20+
.. image:: https://readthedocs.org/projects/ssh-python/badge/?version=latest
21+
:target: http://ssh-python.readthedocs.org/en/latest/
22+
:alt: Latest documentation
2023

2124

2225
Installation
2326
_____________
2427

25-
Binary wheels are provided for Linux, OSX and Windows wheels to follow.
28+
Binary wheels are provided for Linux (manylinux 2010), OSX (10.14 and 10.15 for brew Python), and Windows 64-bit (Python 3.6/3.7/3.8).
29+
30+
Wheels have *no dependencies*. For building from source, see `documentation <http://ssh-python.readthedocs.org/en/latest/>`_.
2631

2732

2833
.. code-block:: shell
2934
3035
pip install ssh-python
3136
3237
33-
Project is beta status.
34-
35-
36-
Prerequisites
37-
--------------
38-
39-
* OpenSSL *or* gcrypt library and development headers
40-
* Optionally Zlib library and development headers for compression
41-
42-
``Libssh`` source code is embedded in this project and will be built when installation is triggered per above instructions.
43-
Versions of ``libssh`` other than the one embedded in this project are not supported.
38+
Project is beta status, please report any issues.
4439

4540

4641
Quick Start
@@ -90,10 +85,14 @@ _________
9085
The library uses `Cython`_ based native code extensions as wrappers to ``libssh``.
9186

9287
* Thread safe - GIL released as much as possible
88+
89+
* libssh threading limitations apply - anything not supported in C is not supported in Python
9390
* Very low overhead thin wrapper
9491
* Object oriented
92+
9593
* Memory freed automatically and safely as objects are garbage collected by Python
9694
* Uses Python semantics where applicable
95+
9796
* channel/file handle context manager support
9897
* channel/file handle iterator support
9998
* Raises low level C errors as Python exceptions

doc/Changelog.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../Changelog.rst

doc/Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line, and also
5+
# from the environment for the first two.
6+
SPHINXOPTS ?=
7+
SPHINXBUILD ?= sphinx-build
8+
SOURCEDIR = .
9+
BUILDDIR = _build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
%: Makefile
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

doc/api.rst

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
API Documentation
2+
********************
3+
4+
.. toctree::
5+
6+
session
7+
channel
8+
exceptions
9+
options
10+
key
11+
keytypes
12+
sftp
13+
sftp_handles
14+
sftp_attributes
15+
sftp_statvfs
16+
scp
17+
callbacks
18+
connector
19+
event
20+
utils

doc/callbacks.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
ssh.callbacks
2+
=============
3+
4+
.. automodule:: ssh.callbacks
5+
:members:
6+
:undoc-members:
7+
:member-order: groupwise

0 commit comments

Comments
 (0)