You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While running pytest I am getting the following two warnings:
/usr/lib/python3.6/site-packages/paramiko/sftp_client.py:344: BytesWarning: str() on a bytes instance
'open(%r, %r) -> %s' % (filename, mode, hexlify(handle)))
/usr/lib/python3.6/site-packages/paramiko/sftp_file.py:86: BytesWarning: str() on a bytes instance
self.sftp._log(DEBUG, 'close(%s)' % hexlify(self.handle))
-- Docs: http://doc.pytest.org/en/latest/warnings.html
which I believe is a bug in the code as:
# python3
Python 3.6.2 (default, Sep 22 2017, 08:28:09)
[GCC 7.2.1 20170915 (Red Hat 7.2.1-2)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
>>> from binascii import hexlify
>>>
>>> hexlify(b'test')
b'74657374'
>>>
>>> hexlify('test')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: a bytes-like object is required, not 'str'
>>>
Don't recall offhand what the handle objects are implemented as but this may just be a minor oversight from the Python 3 overhaul & hopefully fixable by using paramiko.py3compat.b() or similar. Thanks for the report!
Activity
bitprophet commentedon Sep 25, 2017
Don't recall offhand what the handle objects are implemented as but this may just be a minor oversight from the Python 3 overhaul & hopefully fixable by using
paramiko.py3compat.b()or similar. Thanks for the report!sftp: fix BytesWarning: str() on a bytes instance
Rezney commentedon Sep 26, 2017
Thanks for taking a look! PR #1075 submitted.
bitprophet commentedon Sep 26, 2017
Rolling into the PR.
sftp: fix BytesWarning: str() on a bytes instance
sftp: fix BytesWarning: str() on a bytes instance