diff --git a/paramiko/client.py b/paramiko/client.py index 83057e0532f44a493ca755a9151c974850633563_cGFyYW1pa28vY2xpZW50LnB5..4284ca01462aa7c434b5b4abd0eeb1cbd2d91ef0_cGFyYW1pa28vY2xpZW50LnB5 100644 --- a/paramiko/client.py +++ b/paramiko/client.py @@ -315,8 +315,10 @@ :param dict disabled_algorithms: an optional dict passed directly to `.Transport` and its keyword argument of the same name. - :param transport_factory: an optional callable that takes in a new `socket` - `gss_kex`, `gss_deleg_creds`, `disabled_algorithms` and generates a + :param transport_factory: + an optional callable which is handed a subset of the constructor + arguments (primarily those related to the socket, GSS + functionality, and algorithm selection) and generates a `.Transport` instance to be used by this client. Defaults to `.Transport.__init__`. @@ -338,6 +340,8 @@ Added the ``passphrase`` argument. .. versionchanged:: 2.6 Added the ``disabled_algorithms`` argument. + .. versionchanged:: 2.12 + Added the ``transport_factory`` argument. """ if not sock: errors = {} diff --git a/sites/www/changelog.rst b/sites/www/changelog.rst index 83057e0532f44a493ca755a9151c974850633563_c2l0ZXMvd3d3L2NoYW5nZWxvZy5yc3Q=..4284ca01462aa7c434b5b4abd0eeb1cbd2d91ef0_c2l0ZXMvd3d3L2NoYW5nZWxvZy5yc3Q= 100644 --- a/sites/www/changelog.rst +++ b/sites/www/changelog.rst @@ -2,6 +2,10 @@ Changelog ========= +- :feature:`2125` (also re: :issue:`2054`) Add a ``transport_factory`` kwarg to + `SSHClient.connect <paramiko.client.SSHClient.connect>` for advanced + users to gain more control over early Transport setup and manipulation. + Thanks to Noah Pederson for the patch. - :bug:`1822` (via, and relating to, far too many other issues to mention here) Update `~paramiko.client.SSHClient` so it explicitly closes its wrapped socket object upon encountering socket errors at connection time. This should