Skip to content

sftp: fix BytesWarning: str() on a bytes instance - #1075

Merged
bitprophet merged 1 commit into
paramiko:masterfrom
Rezney:str_on_bytes_py3
Sep 26, 2017
Merged

bitprophet merged 1 commit into
paramiko:masterfrom
Rezney:str_on_bytes_py3

Conversation

@Rezney

@Rezney Rezney commented Sep 26, 2017

Copy link
Copy Markdown
Contributor

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.

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: paramiko#1074
@Rezney

Rezney commented Sep 26, 2017

Copy link
Copy Markdown
Contributor Author

This helped me to get rid of the warnings. Please let me know if it is ok.

@bitprophet

bitprophet commented Sep 26, 2017 •

Copy link
Copy Markdown
Member

Looks like an OK fix to me, thanks!

FWIW, pytest seems to have a bunch of other errors when it runs our test suite (much of our suite is extremely old and barely even qualifies as correct unittest usage) and I have my own todo list item for porting it to a newer pytest-driven plugin I'm writing. So keep that in mind!

@bitprophet
bitprophet merged commit bdf0bc7 into paramiko:master Sep 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants