-
-
Notifications
You must be signed in to change notification settings - Fork 30
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
sftp.get downloads only the last chunk of file #341
Comments
The link to the actual code line: pylibssh/src/pylibsshext/sftp.pyx Line 103 in ba0797c
Reading through the python questions, this sounds like a common confusion and I think you are right that this should be Wondering why nobody noticed this earlier. |
Signed-off-by: Jakub Jelen <[email protected]>
Fixes: ansible#341 Signed-off-by: Jakub Jelen <[email protected]>
Fixes: ansible#341 Signed-off-by: Jakub Jelen <[email protected]>
Signed-off-by: Jakub Jelen <[email protected]>
Signed-off-by: Jakub Jelen <[email protected]>
Signed-off-by: Jakub Jelen <[email protected]>
Signed-off-by: Jakub Jelen <[email protected]>
Signed-off-by: Jakub Jelen <[email protected]>
Signed-off-by: Jakub Jelen <[email protected]>
Signed-off-by: Jakub Jelen <[email protected]>
I hit this issue yesterday, while testing |
Yeah. Should have been fixed with #638. Unfortunately not yet merged :( |
Fixes: ansible#341 Signed-off-by: Jakub Jelen <[email protected]>
Signed-off-by: Jakub Jelen <[email protected]>
Fixes: ansible#341 Signed-off-by: Jakub Jelen <[email protected]>
Signed-off-by: Jakub Jelen <[email protected]>
Fixes: ansible#341 Signed-off-by: Jakub Jelen <[email protected]>
Signed-off-by: Jakub Jelen <[email protected]>
Fixes: ansible#341 Signed-off-by: Jakub Jelen <[email protected]>
Signed-off-by: Jakub Jelen <[email protected]>
SUMMARY
I'm trying to download configuration file from remote router and getting only last chunk of the file.
ISSUE TYPE
PYLISSH and LIBSSH VERSION
OS / ENVIRONMENT
Ubuntu 22.04 LTS
Python 3.10.4
STEPS TO REPRODUCE
Narrowing the problem I wrote a piece of code below.
You need a file on remote host to reproduce it.
EXPECTED RESULTS
File 'm8.rsc' in current directory, size of 16K
ACTUAL RESULTS
File 'm8.rsc', containing last 223b of source file.
As I found out, the problem lays in line #103 of sftp.pyx
In python3, "w" parameter truncates the file, so during reading the source file new data overwrites old.
Please check and consider changing open mode to 'ab'
The text was updated successfully, but these errors were encountered: