diff options
author | Michal Reznik <mreznik@redhat.com> | 2017-09-26 10:32:27 +0200 |
---|---|---|
committer | Michal Reznik <mreznik@redhat.com> | 2017-09-26 11:19:18 +0200 |
commit | bdf0bc78245fcaf840914ef94ff3c1c4af7343ad (patch) | |
tree | f348b1e67c4e83545174698506e5cefb322eef84 /paramiko/sftp_client.py | |
parent | af9ebcfa5e6aefb7a08975173bc648ae1bdc704b (diff) | |
download | paramiko-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.py | 2 |
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"... |