Skip to content

Spaces cause failures when using put and use_sudo #955

Description

@johnharris85

sftp.py (line 109):

def mkdir(self, path, use_sudo):
    from fabric.api import sudo, hide
    if use_sudo:
        with hide('everything'):
            sudo('mkdir %s' % path)

The issue here is that if use_sudo=True then mkdir will break if path contains spaces. I changed it to:

def mkdir(self, path, use_sudo):
    from fabric.api import sudo, hide
    if use_sudo:
        with hide('everything'):
            sudo('mkdir "%s"' % path)

Now it works OK. Untested but solved my issue, may cause problems for others.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions