Skip to content
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() fails on files containing '%' when local_is_path is true. #711

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

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

jawnb opened this issue Aug 22, 2012 · 1 comment

Comments

@jawnb
Copy link

@jawnb 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants