From 918b41c7794e0b8820ae7aa83a27b100f95ae83a Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Tue, 10 Nov 2015 17:41:21 -0500 Subject: Update per jaraco.windows 3.4.1 --- paramiko/_winapi.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/paramiko/_winapi.py b/paramiko/_winapi.py index c67c2421..77e0129c 100644 --- a/paramiko/_winapi.py +++ b/paramiko/_winapi.py @@ -1,6 +1,6 @@ """ Windows API functions implemented as ctypes functions and classes as found -in jaraco.windows (3.3). +in jaraco.windows (3.4.1). If you encounter issues with this module, please consider reporting the issues in jaraco.windows and asking the author to port the fixes back here. @@ -123,7 +123,7 @@ MapViewOfFile.restype = ctypes.wintypes.HANDLE class MemoryMap(object): """ - A memory map object which can have security attributes overrideden. + A memory map object which can have security attributes overridden. """ def __init__(self, name, length, security_attributes=None): self.name = name @@ -158,7 +158,7 @@ class MemoryMap(object): if self.pos + n >= self.length: # A little safety. raise ValueError("Refusing to write %d bytes" % n) dest = self.view + self.pos - length = ctypes.wintypes.SIZE(n) + length = ctypes.c_size_t(n) ctypes.windll.kernel32.RtlMoveMemory(dest, msg, length) self.pos += n @@ -168,7 +168,7 @@ class MemoryMap(object): """ out = ctypes.create_string_buffer(n) source = self.view + self.pos - length = ctypes.wintypes.SIZE(n) + length = ctypes.c_size_t(n) ctypes.windll.kernel32.RtlMoveMemory(out, source, length) self.pos += n return out.raw -- cgit v1.2.3 From 7109ddf9e5feabf04016b00d681def30a4acbca7 Mon Sep 17 00:00:00 2001 From: Damien Tournoud Date: Wed, 23 Dec 2015 18:26:18 -0800 Subject: primes: min and max should be inclusive. As seen in the [OpenSSH source code][1], the min and max values of the 'diffie-hellman-group-exchange-*' key exchange types are supposed to be inclusive. In the current state of the code and a standard /etc/ssh/moduli file, OpenSSH client sends min=1024, max=8192, prefer=8192, but paramiko returns one of the 7680 bits prime instead of one of the 8192 bits ones. [1]: https://github.com/openssh/openssh-portable/blob/master/kexgexc.c#L111 --- paramiko/primes.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/paramiko/primes.py b/paramiko/primes.py index 7415c182..d0e17575 100644 --- a/paramiko/primes.py +++ b/paramiko/primes.py @@ -113,12 +113,12 @@ class ModulusPack (object): good = -1 # find nearest bitsize >= preferred for b in bitsizes: - if (b >= prefer) and (b < max) and (b < good or good == -1): + if (b >= prefer) and (b <= max) and (b < good or good == -1): good = b # if that failed, find greatest bitsize >= min if good == -1: for b in bitsizes: - if (b >= min) and (b < max) and (b > good): + if (b >= min) and (b <= max) and (b > good): good = b if good == -1: # their entire (min, max) range has no intersection with our range. -- cgit v1.2.3 From f9404c52c0a5899f9b998e2b52d2316b65202414 Mon Sep 17 00:00:00 2001 From: Jeff Forcier Date: Sat, 23 Apr 2016 16:17:16 -0700 Subject: Fix broken changelog doc link --- sites/www/changelog.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sites/www/changelog.rst b/sites/www/changelog.rst index 18c7ce5e..135bb839 100644 --- a/sites/www/changelog.rst +++ b/sites/www/changelog.rst @@ -115,8 +115,9 @@ Changelog well) would hang due to incorrect values passed into the new window size arguments for `.Transport` (thanks to a botched merge). This has been corrected. Thanks to Dylan Thacker-Smith for the report & patch. -* :feature:`167` Add `.SSHConfig.get_hostnames` for easier introspection of a - loaded SSH config file or object. Courtesy of Søren Løvborg. +* :feature:`167` Add `~paramiko.config.SSHConfig.get_hostnames` for easier + introspection of a loaded SSH config file or object. Courtesy of Søren + Løvborg. * :release:`1.15.0 <2014-09-18>` * :support:`393` Replace internal use of PyCrypto's ``SHA.new`` with the stdlib's ``hashlib.sha1``. Thanks to Alex Gaynor. -- cgit v1.2.3 From 7b2931f040d824a7d5973b704b2835b842384667 Mon Sep 17 00:00:00 2001 From: Abhinav Date: Thu, 3 Dec 2015 18:28:40 +0100 Subject: Update sftp_client.py --- paramiko/sftp_client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/paramiko/sftp_client.py b/paramiko/sftp_client.py index f8c77042..b953526c 100644 --- a/paramiko/sftp_client.py +++ b/paramiko/sftp_client.py @@ -693,10 +693,10 @@ class SFTPClient(BaseSFTP, ClosingContextManager): data = fr.read(32768) fl.write(data) size += len(data) - if callback is not None: - callback(size, file_size) if len(data) == 0: break + if callback is not None: + callback(size, file_size) return size def get(self, remotepath, localpath, callback=None): -- cgit v1.2.3 From 3f151d44b95a414918237be91ae0fba8b167faa2 Mon Sep 17 00:00:00 2001 From: Jeff Forcier Date: Sat, 23 Apr 2016 18:36:27 -0700 Subject: Changelog closes #632 --- sites/www/changelog.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sites/www/changelog.rst b/sites/www/changelog.rst index 135bb839..9989fa35 100644 --- a/sites/www/changelog.rst +++ b/sites/www/changelog.rst @@ -2,6 +2,9 @@ Changelog ========= +* :bug:`632` Fix logic bug in the SFTP client's callback-calling functionality; + previously there was a chance the given callback would fire twice at the end + of a transfer. Thanks to ``@ab9-er`` for catch & patch. * :support:`612` Identify & work around a race condition in the test for handshake timeouts, which was causing frequent test failures for a subset of contributors as well as Travis-CI (usually, but not always, limited to Python -- cgit v1.2.3 From cdc4c6de258899bd481a999989eb7f16ddedce43 Mon Sep 17 00:00:00 2001 From: Jeff Forcier Date: Sat, 23 Apr 2016 18:44:48 -0700 Subject: Update existing test to prove #632 --- tests/test_sftp.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_sftp.py b/tests/test_sftp.py index aa450f59..6bce1794 100755 --- a/tests/test_sftp.py +++ b/tests/test_sftp.py @@ -610,7 +610,7 @@ class SFTPTest (unittest.TestCase): with sftp.open(FOLDER + '/bunny.txt', 'rb') as f: self.assertEqual(text, f.read(128)) - self.assertEqual((41, 41), saved_progress[-1]) + self.assertEqual([(41, 41)], saved_progress) os.unlink(localname) fd, localname = mkstemp() @@ -620,7 +620,7 @@ class SFTPTest (unittest.TestCase): with open(localname, 'rb') as f: self.assertEqual(text, f.read(128)) - self.assertEqual((41, 41), saved_progress[-1]) + self.assertEqual([(41, 41)], saved_progress) os.unlink(localname) sftp.unlink(FOLDER + '/bunny.txt') -- cgit v1.2.3 From 94ea88fc71521918c1f99d34bfcefabc55d394ac Mon Sep 17 00:00:00 2001 From: Jeff Forcier Date: Sat, 23 Apr 2016 18:54:48 -0700 Subject: Refactor because ugh. Original contributor probably meant to patch both of these...BUT. Fuck copy-pasting. Fuck iiiiiit --- paramiko/sftp_client.py | 37 ++++++++++++++++++------------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/paramiko/sftp_client.py b/paramiko/sftp_client.py index b953526c..6a24b943 100644 --- a/paramiko/sftp_client.py +++ b/paramiko/sftp_client.py @@ -591,6 +591,18 @@ class SFTPClient(BaseSFTP, ClosingContextManager): """ return self._cwd and u(self._cwd) + def _transfer_with_callback(self, reader, writer, file_size, callback): + size = 0 + while True: + data = reader.read(32768) + writer.write(data) + size += len(data) + if len(data) == 0: + break + if callback is not None: + callback(size, file_size) + return size + def putfo(self, fl, remotepath, file_size=0, callback=None, confirm=True): """ Copy the contents of an open file object (``fl``) to the SFTP server as @@ -620,15 +632,9 @@ class SFTPClient(BaseSFTP, ClosingContextManager): """ with self.file(remotepath, 'wb') as fr: fr.set_pipelined(True) - size = 0 - while True: - data = fl.read(32768) - fr.write(data) - size += len(data) - if callback is not None: - callback(size, file_size) - if len(data) == 0: - break + size = self._transfer_with_callback( + reader=fl, writer=fr, file_size=file_size, callback=callback + ) if confirm: s = self.stat(remotepath) if s.st_size != size: @@ -688,16 +694,9 @@ class SFTPClient(BaseSFTP, ClosingContextManager): with self.open(remotepath, 'rb') as fr: file_size = self.stat(remotepath).st_size fr.prefetch() - size = 0 - while True: - data = fr.read(32768) - fl.write(data) - size += len(data) - if len(data) == 0: - break - if callback is not None: - callback(size, file_size) - return size + return self._transfer_with_callback( + reader=fr, writer=fl, file_size=file_size, callback=callback + ) def get(self, remotepath, localpath, callback=None): """ -- cgit v1.2.3 From c312b620e7945797468702aeb27cb58def3f0f80 Mon Sep 17 00:00:00 2001 From: Jeff Forcier Date: Sat, 23 Apr 2016 18:55:19 -0700 Subject: Meh --- sites/www/changelog.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sites/www/changelog.rst b/sites/www/changelog.rst index 9989fa35..ce984035 100644 --- a/sites/www/changelog.rst +++ b/sites/www/changelog.rst @@ -4,7 +4,7 @@ Changelog * :bug:`632` Fix logic bug in the SFTP client's callback-calling functionality; previously there was a chance the given callback would fire twice at the end - of a transfer. Thanks to ``@ab9-er`` for catch & patch. + of a transfer. Thanks to ``@ab9-er`` for catch & original patch. * :support:`612` Identify & work around a race condition in the test for handshake timeouts, which was causing frequent test failures for a subset of contributors as well as Travis-CI (usually, but not always, limited to Python -- cgit v1.2.3 From 2d4ad462d58370dcf498b56b567f3babca0052d6 Mon Sep 17 00:00:00 2001 From: Jeff Forcier Date: Sun, 24 Apr 2016 12:12:47 -0700 Subject: Expose some effectively-public Channel attributes in API docs. Closes #621 --- paramiko/channel.py | 5 +++++ sites/www/changelog.rst | 3 +++ 2 files changed, 8 insertions(+) diff --git a/paramiko/channel.py b/paramiko/channel.py index 44a4b291..f4540bcd 100644 --- a/paramiko/channel.py +++ b/paramiko/channel.py @@ -88,15 +88,20 @@ class Channel (ClosingContextManager): :param int chanid: the ID of this channel, as passed by an existing `.Transport`. """ + #: Channel ID self.chanid = chanid + #: Remote channel ID self.remote_chanid = 0 + #: `.Transport` managing this channel self.transport = None + #: Whether the connection is presently active self.active = False self.eof_received = 0 self.eof_sent = 0 self.in_buffer = BufferedPipe() self.in_stderr_buffer = BufferedPipe() self.timeout = None + #: Whether the connection has been closed self.closed = False self.ultra_debug = False self.lock = threading.Lock() diff --git a/sites/www/changelog.rst b/sites/www/changelog.rst index ce984035..feef1c9b 100644 --- a/sites/www/changelog.rst +++ b/sites/www/changelog.rst @@ -2,6 +2,9 @@ Changelog ========= +* :support:`621 backported` Annotate some public attributes on + `~paramiko.channel.Channel` such as ``.closed``. Thanks to Sergey Vasilyev + for the report. * :bug:`632` Fix logic bug in the SFTP client's callback-calling functionality; previously there was a chance the given callback would fire twice at the end of a transfer. Thanks to ``@ab9-er`` for catch & original patch. -- cgit v1.2.3 From f15b383e4499e85689bfcc83dc942f0b6c898264 Mon Sep 17 00:00:00 2001 From: Jeff Forcier Date: Sun, 24 Apr 2016 13:16:51 -0700 Subject: Changelog re #619, re #613 --- sites/www/changelog.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sites/www/changelog.rst b/sites/www/changelog.rst index 6a605216..32b5752b 100644 --- a/sites/www/changelog.rst +++ b/sites/www/changelog.rst @@ -2,6 +2,8 @@ Changelog ========= +* :bug:`613` (via :issue:`619`) Update to ``jaraco.windows`` 3.4.1 to fix some + errors related to ``ctypes`` on Windows platforms. Credit to Jason R. Coombs. * :support:`621 backported` Annotate some public attributes on `~paramiko.channel.Channel` such as ``.closed``. Thanks to Sergey Vasilyev for the report. -- cgit v1.2.3 From e1d09fe4b0f4ab8eee5e923dd63ae08155334e80 Mon Sep 17 00:00:00 2001 From: Marius Gedminas Date: Thu, 4 Feb 2016 19:56:51 +0200 Subject: Make NoValidConnectionsError picklable correctly Fixes #617. --- paramiko/ssh_exception.py | 3 +++ test.py | 4 +++- tests/test_ssh_exception.py | 15 +++++++++++++++ 3 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 tests/test_ssh_exception.py diff --git a/paramiko/ssh_exception.py b/paramiko/ssh_exception.py index 016a411e..b61000ae 100644 --- a/paramiko/ssh_exception.py +++ b/paramiko/ssh_exception.py @@ -173,3 +173,6 @@ class NoValidConnectionsError(socket.error): msg.format(addrs[0][1], body, tail) ) self.errors = errors + + def __reduce__(self): + return (NoValidConnectionsError, (self.errors, )) diff --git a/test.py b/test.py index 37fc5a6f..a1f13d85 100755 --- a/test.py +++ b/test.py @@ -43,8 +43,9 @@ from tests.test_kex import KexTest from tests.test_packetizer import PacketizerTest from tests.test_auth import AuthTest from tests.test_transport import TransportTest +from tests.test_ssh_exception import NoValidConnectionsErrorTest from tests.test_client import SSHClientTest -from test_client import SSHClientTest +from test_client import SSHClientTest # XXX why shadow the above import? from test_gssapi import GSSAPITest from test_ssh_gss import GSSAuthTest from test_kex_gss import GSSKexTest @@ -156,6 +157,7 @@ def main(): if options.use_transport: suite.addTest(unittest.makeSuite(AuthTest)) suite.addTest(unittest.makeSuite(TransportTest)) + suite.addTest(unittest.makeSuite(NoValidConnectionsErrorTest)) suite.addTest(unittest.makeSuite(SSHClientTest)) if options.use_sftp: suite.addTest(unittest.makeSuite(SFTPTest)) diff --git a/tests/test_ssh_exception.py b/tests/test_ssh_exception.py new file mode 100644 index 00000000..2d1f899f --- /dev/null +++ b/tests/test_ssh_exception.py @@ -0,0 +1,15 @@ +import pickle +import unittest + +from paramiko.ssh_exception import NoValidConnectionsError + + +class NoValidConnectionsErrorTest (unittest.TestCase): + + def test_pickling(self): + # Regression test for https://github.com/paramiko/paramiko/issues/617 + exc = NoValidConnectionsError({'ab': ''}) + new_exc = pickle.loads(pickle.dumps(exc)) + self.assertEqual(type(exc), type(new_exc)) + self.assertEqual(str(exc), str(new_exc)) + self.assertEqual(exc.args, new_exc.args) -- cgit v1.2.3 From 858c167a6487e4a9d9cca3653b8e260f085dba02 Mon Sep 17 00:00:00 2001 From: Marius Gedminas Date: Fri, 5 Feb 2016 08:38:00 +0200 Subject: Fix tests on Python 3.x (This also fixes #678.) --- paramiko/ssh_exception.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/paramiko/ssh_exception.py b/paramiko/ssh_exception.py index b61000ae..bdf97e24 100644 --- a/paramiko/ssh_exception.py +++ b/paramiko/ssh_exception.py @@ -164,7 +164,7 @@ class NoValidConnectionsError(socket.error): :param dict errors: The errors dict to store, as described by class docstring. """ - addrs = errors.keys() + addrs = list(errors.keys()) body = ', '.join([x[0] for x in addrs[:-1]]) tail = addrs[-1][0] msg = "Unable to connect to port {0} on {1} or {2}" -- cgit v1.2.3 From 0411010d55755913fa7bd5b0a9c719c8548549f4 Mon Sep 17 00:00:00 2001 From: Marius Gedminas Date: Fri, 5 Feb 2016 08:43:50 +0200 Subject: Improve NoValidConnectionsError formatting Because "Unable to connect to port 22 on or X.X.X.X" looks seriously _weird_ with the blank space between "on" and "or". --- paramiko/ssh_exception.py | 7 +++++-- tests/test_ssh_exception.py | 17 ++++++++++++++++- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/paramiko/ssh_exception.py b/paramiko/ssh_exception.py index bdf97e24..fea3146a 100644 --- a/paramiko/ssh_exception.py +++ b/paramiko/ssh_exception.py @@ -164,10 +164,13 @@ class NoValidConnectionsError(socket.error): :param dict errors: The errors dict to store, as described by class docstring. """ - addrs = list(errors.keys()) + addrs = sorted(errors.keys()) body = ', '.join([x[0] for x in addrs[:-1]]) tail = addrs[-1][0] - msg = "Unable to connect to port {0} on {1} or {2}" + if body: + msg = "Unable to connect to port {0} on {1} or {2}" + else: + msg = "Unable to connect to port {0} on {2}" super(NoValidConnectionsError, self).__init__( None, # stand-in for errno msg.format(addrs[0][1], body, tail) diff --git a/tests/test_ssh_exception.py b/tests/test_ssh_exception.py index 2d1f899f..9c109de1 100644 --- a/tests/test_ssh_exception.py +++ b/tests/test_ssh_exception.py @@ -8,8 +8,23 @@ class NoValidConnectionsErrorTest (unittest.TestCase): def test_pickling(self): # Regression test for https://github.com/paramiko/paramiko/issues/617 - exc = NoValidConnectionsError({'ab': ''}) + exc = NoValidConnectionsError({('127.0.0.1', '22'): Exception()}) new_exc = pickle.loads(pickle.dumps(exc)) self.assertEqual(type(exc), type(new_exc)) self.assertEqual(str(exc), str(new_exc)) self.assertEqual(exc.args, new_exc.args) + + def test_error_message_for_single_host(self): + exc = NoValidConnectionsError({('127.0.0.1', '22'): Exception()}) + self.assertIn("Unable to connect to port 22 on 127.0.0.1", str(exc)) + + def test_error_message_for_two_hosts(self): + exc = NoValidConnectionsError({('127.0.0.1', '22'): Exception(), + ('::1', '22'): Exception()}) + self.assertIn("Unable to connect to port 22 on 127.0.0.1 or ::1", str(exc)) + + def test_error_message_for_multiple_hosts(self): + exc = NoValidConnectionsError({('127.0.0.1', '22'): Exception(), + ('::1', '22'): Exception(), + ('10.0.0.42', '22'): Exception()}) + self.assertIn("Unable to connect to port 22 on 10.0.0.42, 127.0.0.1 or ::1", str(exc)) -- cgit v1.2.3 From 6c1539bbf7046e5e3d1f20725baa1ae48d1b7ce3 Mon Sep 17 00:00:00 2001 From: Marius Gedminas Date: Fri, 5 Feb 2016 08:45:52 +0200 Subject: Support pickling hypothetical subclasses --- paramiko/ssh_exception.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/paramiko/ssh_exception.py b/paramiko/ssh_exception.py index fea3146a..ed36a952 100644 --- a/paramiko/ssh_exception.py +++ b/paramiko/ssh_exception.py @@ -178,4 +178,4 @@ class NoValidConnectionsError(socket.error): self.errors = errors def __reduce__(self): - return (NoValidConnectionsError, (self.errors, )) + return (self.__class__, (self.errors, )) -- cgit v1.2.3 From d3af63ac5edc06cb07ad3f2afb5a30a2f79713b6 Mon Sep 17 00:00:00 2001 From: Jeff Forcier Date: Sun, 24 Apr 2016 14:00:44 -0700 Subject: Python 2.6 fix re: assertIn --- tests/test_ssh_exception.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/test_ssh_exception.py b/tests/test_ssh_exception.py index 9c109de1..18f2a97d 100644 --- a/tests/test_ssh_exception.py +++ b/tests/test_ssh_exception.py @@ -16,15 +16,16 @@ class NoValidConnectionsErrorTest (unittest.TestCase): def test_error_message_for_single_host(self): exc = NoValidConnectionsError({('127.0.0.1', '22'): Exception()}) - self.assertIn("Unable to connect to port 22 on 127.0.0.1", str(exc)) + assert "Unable to connect to port 22 on 127.0.0.1" in str(exc) def test_error_message_for_two_hosts(self): exc = NoValidConnectionsError({('127.0.0.1', '22'): Exception(), ('::1', '22'): Exception()}) - self.assertIn("Unable to connect to port 22 on 127.0.0.1 or ::1", str(exc)) + assert "Unable to connect to port 22 on 127.0.0.1 or ::1" in str(exc) def test_error_message_for_multiple_hosts(self): exc = NoValidConnectionsError({('127.0.0.1', '22'): Exception(), ('::1', '22'): Exception(), ('10.0.0.42', '22'): Exception()}) - self.assertIn("Unable to connect to port 22 on 10.0.0.42, 127.0.0.1 or ::1", str(exc)) + exp = "Unable to connect to port 22 on 10.0.0.42, 127.0.0.1 or ::1" + assert exp in str(exc) -- cgit v1.2.3 From e2206bc9a6ec2d4eae316a12fef50fc898d6db12 Mon Sep 17 00:00:00 2001 From: Jeff Forcier Date: Sun, 24 Apr 2016 14:09:33 -0700 Subject: Changelog re #617, #679, #678, #685. Also re https://github.com/fabric/fabric/issues/1429 but IDK if Github will tickle that repo correctly :D --- sites/www/changelog.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sites/www/changelog.rst b/sites/www/changelog.rst index 32b5752b..d7c7fa8a 100644 --- a/sites/www/changelog.rst +++ b/sites/www/changelog.rst @@ -2,6 +2,11 @@ Changelog ========= +* :bug:`617` (aka `fabric/fabric#1429 + `_; via :issue:`679`; related: + :issue:`678`, :issue:`685`) Fix up + `~paramiko.ssh_exception.NoValidConnectionsError` so it pickles correctly. + Thanks to Rebecca Schlussel for the report & Marius Gedminas for the patch. * :bug:`613` (via :issue:`619`) Update to ``jaraco.windows`` 3.4.1 to fix some errors related to ``ctypes`` on Windows platforms. Credit to Jason R. Coombs. * :support:`621 backported` Annotate some public attributes on -- cgit v1.2.3 From b7c9b5d7649903cd14ceb40f8e691aa27d413962 Mon Sep 17 00:00:00 2001 From: Jeff Forcier Date: Sun, 24 Apr 2016 14:12:57 -0700 Subject: Oh hey this also fixes the only other open 1.16.1 ticket yey --- sites/www/changelog.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sites/www/changelog.rst b/sites/www/changelog.rst index d7c7fa8a..20ea740f 100644 --- a/sites/www/changelog.rst +++ b/sites/www/changelog.rst @@ -4,7 +4,7 @@ Changelog * :bug:`617` (aka `fabric/fabric#1429 `_; via :issue:`679`; related: - :issue:`678`, :issue:`685`) Fix up + :issue:`678`, :issue:`685`, :issue:`616`) Fix up `~paramiko.ssh_exception.NoValidConnectionsError` so it pickles correctly. Thanks to Rebecca Schlussel for the report & Marius Gedminas for the patch. * :bug:`613` (via :issue:`619`) Update to ``jaraco.windows`` 3.4.1 to fix some -- cgit v1.2.3 From a3a8d3f1f1f6c7431e2c79fb798cf884021e375a Mon Sep 17 00:00:00 2001 From: Jeff Forcier Date: Sun, 24 Apr 2016 14:14:33 -0700 Subject: Apparently a whole lot of people noticed that tiny python 3 issue --- sites/www/changelog.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sites/www/changelog.rst b/sites/www/changelog.rst index 20ea740f..795e03eb 100644 --- a/sites/www/changelog.rst +++ b/sites/www/changelog.rst @@ -4,7 +4,7 @@ Changelog * :bug:`617` (aka `fabric/fabric#1429 `_; via :issue:`679`; related: - :issue:`678`, :issue:`685`, :issue:`616`) Fix up + :issue:`678`, :issue:`685`, :issue:`615` & :issue:`616`) Fix up `~paramiko.ssh_exception.NoValidConnectionsError` so it pickles correctly. Thanks to Rebecca Schlussel for the report & Marius Gedminas for the patch. * :bug:`613` (via :issue:`619`) Update to ``jaraco.windows`` 3.4.1 to fix some -- cgit v1.2.3 From 8311ad95adbfefa681f1c827c047a740f46f11fc Mon Sep 17 00:00:00 2001 From: Jeff Forcier Date: Sun, 24 Apr 2016 14:16:41 -0700 Subject: Be clearer --- sites/www/changelog.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sites/www/changelog.rst b/sites/www/changelog.rst index 795e03eb..e7c420da 100644 --- a/sites/www/changelog.rst +++ b/sites/www/changelog.rst @@ -5,8 +5,9 @@ Changelog * :bug:`617` (aka `fabric/fabric#1429 `_; via :issue:`679`; related: :issue:`678`, :issue:`685`, :issue:`615` & :issue:`616`) Fix up - `~paramiko.ssh_exception.NoValidConnectionsError` so it pickles correctly. - Thanks to Rebecca Schlussel for the report & Marius Gedminas for the patch. + `~paramiko.ssh_exception.NoValidConnectionsError` so it pickles correctly, + and fix a related Python 3 compatibility issue. Thanks to Rebecca Schlussel + for the report & Marius Gedminas for the patch. * :bug:`613` (via :issue:`619`) Update to ``jaraco.windows`` 3.4.1 to fix some errors related to ``ctypes`` on Windows platforms. Credit to Jason R. Coombs. * :support:`621 backported` Annotate some public attributes on -- cgit v1.2.3 From cc761c49f54acae098bec8a815e53f191145f4c3 Mon Sep 17 00:00:00 2001 From: Jeff Forcier Date: Sun, 24 Apr 2016 15:08:38 -0700 Subject: Changelog re #649 --- sites/www/changelog.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sites/www/changelog.rst b/sites/www/changelog.rst index 7f3667e3..37ce2e48 100644 --- a/sites/www/changelog.rst +++ b/sites/www/changelog.rst @@ -2,6 +2,9 @@ Changelog ========= +* :bug:`649 major` Update the module in charge of handling SSH moduli so it's + consistent with OpenSSH behavior re: prime number selection. Thanks to Damien + Tournoud for catch & patch. * :bug:`617` (aka `fabric/fabric#1429 `_; via :issue:`679`; related: :issue:`678`, :issue:`685`, :issue:`615` & :issue:`616`) Fix up -- cgit v1.2.3 From 634032fbdcc877b26b34a5a4ea26c05340f93b1d Mon Sep 17 00:00:00 2001 From: Jeff Forcier Date: Sun, 24 Apr 2016 15:22:23 -0700 Subject: Attempt clarification of `set_missing_host_key_policy` param. This trips up lots of users. Re #45 --- paramiko/client.py | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/paramiko/client.py b/paramiko/client.py index 9ee30287..4e806bb8 100644 --- a/paramiko/client.py +++ b/paramiko/client.py @@ -161,10 +161,23 @@ class SSHClient (ClosingContextManager): def set_missing_host_key_policy(self, policy): """ - Set the policy to use when connecting to a server that doesn't have a - host key in either the system or local `.HostKeys` objects. The - default policy is to reject all unknown servers (using `.RejectPolicy`). - You may substitute `.AutoAddPolicy` or write your own policy class. + Set policy to use when connecting to servers without a known host key. + + Specifically: + + * A **policy** is an instance of a "policy class", namely some subclass + of `.MissingHostKeyPolicy` such as `.RejectPolicy` (the default), + `.AutoAddPolicy`, `.WarningPolicy`, or a user-created subclass. + + .. note:: + This method takes class **instances**, not **classes** themselves. + Thus it must be called as e.g. + ``.set_missing_host_key_policy(WarningPolicy())`` and *not* + ``.set_missing_host_key_policy(WarningPolicy)``. + + * A host key is **known** when it appears in the client object's cached + host keys structures (those manipulated by `load_system_host_keys` + and/or `load_host_keys`). :param .MissingHostKeyPolicy policy: the policy to use when receiving a host key from a -- cgit v1.2.3 From 76a14eddc6796c264d45d8069c8f02345a855624 Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Sat, 23 Apr 2016 13:53:07 -0400 Subject: Simplify setup.py by always relying on setuptools It is installed everywhere now, there is no practical way to use python without it. --- setup.py | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/setup.py b/setup.py index f9c4b4fe..ad957329 100644 --- a/setup.py +++ b/setup.py @@ -31,23 +31,10 @@ To install the `in-development version `pip install paramiko==dev`. ''' -# if someday we want to *require* setuptools, uncomment this: -# (it will cause setuptools to be automatically downloaded) -#import ez_setup -#ez_setup.use_setuptools() - import sys -try: - from setuptools import setup - kw = { - 'install_requires': [ - 'pycrypto>=2.1,!=2.4', - 'ecdsa>=0.11', - ], - } -except ImportError: - from distutils.core import setup - kw = {} + +from setuptools import setup + if sys.platform == 'darwin': import setup_helper @@ -89,5 +76,8 @@ setup( 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', ], - **kw + install_requires=[ + 'pycrypto>=2.1,!=2.4', + 'ecdsa>=0.11', + ], ) -- cgit v1.2.3 From 06ef0e97eaa9767c2a799d231ae28c1c86418a7d Mon Sep 17 00:00:00 2001 From: Jeff Forcier Date: Sun, 24 Apr 2016 19:02:33 -0700 Subject: Changelog closes #729 --- sites/www/changelog.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sites/www/changelog.rst b/sites/www/changelog.rst index feef1c9b..b9d8b28e 100644 --- a/sites/www/changelog.rst +++ b/sites/www/changelog.rst @@ -2,6 +2,9 @@ Changelog ========= +* :support:`729 backported` Clean up ``setup.py`` to always use ``setuptools``, + not doing so was a historical artifact from bygone days. Thanks to Alex + Gaynor. * :support:`621 backported` Annotate some public attributes on `~paramiko.channel.Channel` such as ``.closed``. Thanks to Sergey Vasilyev for the report. -- cgit v1.2.3 From d29a1fc52535aafc3aa23c58e9060c44af33d99b Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Sat, 23 Apr 2016 13:49:58 -0400 Subject: Enabling caching of pip downloads and wheels --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index 55cba46d..3b7b2b42 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,8 @@ language: python sudo: false +cache: + directories: + - $HOME/.cache/pip python: - "2.6" - "2.7" -- cgit v1.2.3