sftp.get() fails on files containing '%' when local_is_path is true. #711

Closed
jawnb opened this Issue Aug 22, 2012 · 1 comment

Projects

None yet

2 participants

@jawnb
Contributor
jawnb commented Aug 22, 2012

The path interpolation done in sftp.py on line 118 causes the get() call to break if the filename contains the format string operator (%).

Here's an easy way to reproduce the issue:

def test_case():
    run('mkdir -p /tmp/interpolation_test')
    run('touch /tmp/interpolation_test/%f.txt')
    get('/tmp/interpolation_test', '/tmp')

Raises this:

Fatal error: get() encountered an exception while downloading '/tmp/interpolation_test'

Traceback (most recent call last):
  File "...fabric/operations.py", line 552, in get
    result = ftp.get_dir(remote_path, local_path)
  File "...fabric/sftp.py", line 190, in get_dir
    result.append(self.get(rpath, lpath, True, rremote))
  File "...fabric/sftp.py", line 118, in get
    local_path = os.path.abspath(local_path % path_vars)
TypeError: float argument required, not dict
@bitprophet
Member

Moving to #712

@bitprophet bitprophet closed this Aug 27, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment