Join GitHub today
SFTP transfer crashes on paths with "%" characters #1348
When transferring files from a host with
To reproduce, create a directory on the remote host with % in the file:
The run the following script to try to retrieve this dir:
The issue is in the % expansion within sftp, where it passes a dict of args before calling abspath() in sftp.py:
Because when doing a recursive get() from a remote directory, you can't know what's under the directory without listing its contents first?
This can happen if there is any name with
added a commit
Aug 5, 2015
The patch I wrote didn't change to using the format method for strings as mentioned above, as that would break functionality for anyone with any of the specially-handled formatted strings. I just updated the existing regex to be more specific and escape anything except for the aforementioned special strings.