Skip to content

Don't use os.path.join for remote paths #306

@bitprophet

Description

@bitprophet

Description

In most places (SFTP-ly speaking) we assume the remote end uses Unix style forward slashes because there is no reliable way to detect the remote OS, and (AFAIK) even Windows-based remote SSH/SFTP clients use forward slashes anyway.

Thus, our os.path.join policy should be to use os.path.join for local paths but not for remote paths, which should always use /.

Unfortunately, we do not do this consistently, leading Windows client users to run into problems when using put and get. fabric/sftp.py is littered with os.path.join.

So, we should:

  • Develop (or copy, ideally) our own version of os.path.join hardcoded to use a Unix-style separator
  • Use that instead of os.path.join for all remote contexts

Originally submitted by Jeff Forcier (bitprophet) on 2011-03-07 at 06:30pm EST

Attachments

Relations

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions