Skip to content

Commit b9112a9

Browse files
committed
ssh: Fix password authentication with Python 3.x & OpenSSH 7.5+
Since PERMDENIED_PROMPT is a byte string the interpolation was resulting in: b"user@host: b'permission denied'". Needless to say this didn't match.
1 parent 67f2643 commit b9112a9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

mitogen/ssh.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,8 +291,8 @@ def _connect_bootstrap(self, extra_fd):
291291
raise HostKeyError(self.hostkey_failed_msg)
292292
elif buf.lower().startswith((
293293
PERMDENIED_PROMPT,
294-
b("%s@%s: %s" % (self.username, self.hostname,
295-
PERMDENIED_PROMPT)),
294+
b("%s@%s: " % (self.username, self.hostname))
295+
+ PERMDENIED_PROMPT,
296296
)):
297297
# issue #271: work around conflict with user shell reporting
298298
# 'permission denied' e.g. during chdir($HOME) by only matching

0 commit comments

Comments
 (0)