summaryrefslogtreecommitdiff
path: root/paramiko/sftp_client.py
diff options
context:
space:
mode:
authorMichal Reznik <mreznik@redhat.com>2017-09-26 10:32:27 +0200
committerMichal Reznik <mreznik@redhat.com>2017-09-26 11:19:18 +0200
commitbdf0bc78245fcaf840914ef94ff3c1c4af7343ad (patch)
treef348b1e67c4e83545174698506e5cefb322eef84 /paramiko/sftp_client.py
parentaf9ebcfa5e6aefb7a08975173bc648ae1bdc704b (diff)
downloadparamiko-bdf0bc78245fcaf840914ef94ff3c1c4af7343ad.tar.gz
sftp: fix BytesWarning: str() on a bytes instance
when running the code with python3 we get BytesWarning as what we receive from hexlify() function is bytes. Use u() from py3compat to overcome the issue. Fix: https://github.com/paramiko/paramiko/issues/1074
Diffstat (limited to 'paramiko/sftp_client.py')
-rw-r--r--paramiko/sftp_client.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/paramiko/sftp_client.py b/paramiko/sftp_client.py
index 51c02365..14b8b58a 100644
--- a/paramiko/sftp_client.py
+++ b/paramiko/sftp_client.py
@@ -341,7 +341,7 @@ class SFTPClient(BaseSFTP, ClosingContextManager):
handle = msg.get_binary()
self._log(
DEBUG,
- 'open(%r, %r) -> %s' % (filename, mode, hexlify(handle)))
+ 'open(%r, %r) -> %s' % (filename, mode, u(hexlify(handle))))
return SFTPFile(self, handle, mode, bufsize)
# Python continues to vacillate about "open" vs "file"...