diff options
author | Jeff Forcier <jeff@bitprophet.org> | 2014-11-12 13:57:16 -0800 |
---|---|---|
committer | Jeff Forcier <jeff@bitprophet.org> | 2014-11-12 13:57:16 -0800 |
commit | 14fdeae3b0f5c250fa2aac1ba729e0c6749a2be5 (patch) | |
tree | db317dd27f4f5a2322e07bd87167249d009df730 /paramiko | |
parent | 7ebbabef50bd8b75d9865e76a9534fc7e47273d4 (diff) | |
parent | e57e4ba1c44b05d0d4ce5f50be4b8676d9df79ed (diff) | |
download | paramiko-14fdeae3b0f5c250fa2aac1ba729e0c6749a2be5.tar.gz |
Merge branch '1.14' into 1.15
Conflicts:
tests/test_util.py
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 bf30c784..f80aaba5 100644 --- a/paramiko/transport.py +++ b/paramiko/transport.py @@ -2149,7 +2149,7 @@ class Transport (threading.Thread, ClosingContextManager): 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 88ca2bc4..3ac64a00 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 |