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/util.py | |
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/util.py')
-rw-r--r-- | paramiko/util.py | 9 |
1 files changed, 5 insertions, 4 deletions
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 |