SFTP transfer crashes on paths with "%" characters #1348
Comments
This happens in all versions of Fabric that I've tried. The only workaround I found was to disable % expansion in this code path. Rather than try to escape %'s in the input, it's probably better to move to |
Is there a reason doing normal %-formatting escaping (using double-percents, |
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 |
…ote path when using sftp get()
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. |
@bspink Thank you, I tested this patch and it fixes the case I listed in the issue. I look forward to updating when this is next released. Cheers! |
Rolling into the PR! edit: which is #1361, no auto-link was created, thx GH |
When transferring files from a host with
get()
, an exception is triggered if any path has a "%" code in it.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:
The text was updated successfully, but these errors were encountered: