When transferring files from a host with get(), an exception is triggered if any path has a "%" code in it.
Fatal error: get() encountered an exception while downloading
Underlying exception:
%d format: a number is required, not dict
To reproduce, create a directory on the remote host with % in the file:
ssh remote 'mkdir -p top/%a; touch top/%a/%d'
mkdir out
The run the following script to try to retrieve this dir:
from fabric.api import settings, get
with settings:
get('top/*', 'out')
The issue is in the % expansion within sftp, where it passes a dict of args before calling abspath() in sftp.py:
local_path = os.path.abspath(escaped_path % path_vars )
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: