-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Fix bug at ssh.py:get() with relative path #2214
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Nice, thank you! Would you mind adding a test for this please? We're using doctests, so adding an It looks like the |
* doctest for download and download_file * remove os.path.join, since _download_raw already seem handle remote paths
Maybe still create the file in |
I see, thanks for the info! Hopefully this passes the checks now. |
FWIW if you do not want to waste your time waiting for the automated CI checks, you can run the tests locally with: $ python -m sphinx -b doctest docs/source docs/build/doctest docs/source/tubes/ssh.rst (this requires some setup described in TESTING.md, though) I think we should one day rework the testing to make it easier and more reliable for the contributors. |
This fixes a bug in
ssh.py
that previously prevented downloading a file from a relative path.Previously the following snippet resulted in an error:
TypeError:** Can't mix strings and bytes in path components
Since the
get
function casts the remote variable to bytes, but theself.cwd
is alwaysstr
, this function failed no matter whetherbytes
orstr
was provided.This fixes the bug in
ssh.py:download_file
by casting both parts of the join tobytes