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
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.joinpolicy should be to useos.path.joinfor 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
putandget.fabric/sftp.pyis littered withos.path.join.So, we should:
os.path.joinhardcoded to use a Unix-style separatoros.path.joinfor all remote contextsOriginally submitted by Jeff Forcier (bitprophet) on 2011-03-07 at 06:30pm EST
Attachments
Relations