SFTP transport raises a TypeError exception in a except block if self._port is None

Bug #49363 reported by Lukáš Lalinský
2
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
Undecided
Unassigned

Bug Description

Patch to fix it:

--- sftp.py.orig 2006-06-11 16:13:04.359375000 +0200
+++ sftp.py 2006-06-11 16:12:11.546875000 +0200
@@ -746,7 +746,7 @@
             t.start_client()
         except paramiko.SSHException, e:
             raise ConnectionError('Unable to reach SSH host %s:%d' %
- (self._host, self._port), e)
+ (self._host, self._port or 22), e)

         server_key = t.get_remote_server_key()
         server_key_hex = paramiko.util.hexify(server_key.get_fingerprint())

Revision history for this message
John A Meinel (jameinel) wrote : Re: [Bug 49363] SFTP transport raises a TypeError exception is a except block if self._port is None

Lukáš Lalinský wrote:
> Public bug reported:
>
> Patch to fix it:
>
> --- sftp.py.orig 2006-06-11 16:13:04.359375000 +0200
> +++ sftp.py 2006-06-11 16:12:11.546875000 +0200
> @@ -746,7 +746,7 @@
> t.start_client()
> except paramiko.SSHException, e:
> raise ConnectionError('Unable to reach SSH host %s:%d' %
> - (self._host, self._port), e)
> + (self._host, self._port or 22), e)
>
> server_key = t.get_remote_server_key()
> server_key_hex = paramiko.util.hexify(server_key.get_fingerprint())
>
> ** Affects: bzr (upstream)
> Importance: Untriaged
> Status: Unconfirmed
>
> ** Summary changed:
>
> - SFTP transport raises a TypeError exception is a except block if self._port is None
> + SFTP transport raises a TypeError exception in a except block if self._port is None
>

I would say the correct fix would be to change :%d => :%s, because _port
== None is an important difference (especially in the case that a user
customizes ~/.ssh/config).

John
=:->

Revision history for this message
Robert Collins (lifeless) wrote : Re: [Bug 49363] Re: [Bug 49363] SFTP transport raises a TypeError exception is a except block if self._port is None

On Mon, 2006-06-12 at 12:15 +0000, John A Meinel wrote:

> I would say the correct fix would be to change :%d => :%s, because _port
> == None is an important difference (especially in the case that a user
> customizes ~/.ssh/config).

Agreed.

Rob
--
GPG key available at: <http://www.robertcollins.net/keys.txt>.

Revision history for this message
John A Meinel (jameinel) wrote :

This was fixed a while ago in bzr.dev, the bug was just never closed.

Changed in bzr:
status: Unconfirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.