diff options
author | Jeff Forcier <jeff@bitprophet.org> | 2014-11-12 13:56:08 -0800 |
---|---|---|
committer | Jeff Forcier <jeff@bitprophet.org> | 2014-11-12 13:56:08 -0800 |
commit | e57e4ba1c44b05d0d4ce5f50be4b8676d9df79ed (patch) | |
tree | 76feb74b6f71a4141caa52f94145395d3e98095a /paramiko | |
parent | 5f28b9c5aed90394288fdc7249b5a527dc009f59 (diff) | |
parent | ee06fc8f634b424b026afde3b853f8c321b1919f (diff) | |
download | paramiko-e57e4ba1c44b05d0d4ce5f50be4b8676d9df79ed.tar.gz |
Merge branch '1.13' into 1.14
Diffstat (limited to 'paramiko')
-rw-r--r-- | paramiko/transport.py | 2 | ||||
-rw-r--r-- | paramiko/util.py | 9 |
2 files changed, 6 insertions, 5 deletions
diff --git a/paramiko/transport.py b/paramiko/transport.py index 7a6c1d8d..eb488a18 100644 --- a/paramiko/transport.py +++ b/paramiko/transport.py @@ -1979,7 +1979,7 @@ class Transport (threading.Thread): always_display = m.get_boolean() msg = m.get_string() lang = m.get_string() - self._log(DEBUG, 'Debug msg: ' + util.safe_string(msg)) + self._log(DEBUG, 'Debug msg: {0}'.format(util.safe_string(msg))) def _get_subsystem_handler(self, name): try: diff --git a/paramiko/util.py b/paramiko/util.py index f4ee3adc..ab1bb98d 100644 --- a/paramiko/util.py +++ b/paramiko/util.py @@ -115,12 +115,13 @@ def unhexify(s): def safe_string(s): - out = '' + out = b('') for c in s: - if (byte_ord(c) >= 32) and (byte_ord(c) <= 127): - out += c + i = byte_ord(c) + if 32 <= i <= 127: + out += byte_chr(i) else: - out += '%%%02X' % byte_ord(c) + out += b('%%%02X' % i) return out |