-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Don't use os.path.join for remote paths #306
Comments
**** (adamjernst) posted: Well it seems this is done, but you could also import the "posixpath" module which should be available on all platforms, and uses / as the separator. This has the advantage of hewing to a well-defined spec (POSIX). on 2011-03-14 at 10:14pm EDT |
Jeff Forcier (bitprophet) posted: Chris -- can you point me to the specific commits or branch for your changes? Having a hard time parsing the general commit list for that GH link. Adam -- is posixpath available by default on Windows? The docs are unclear and I've no Windows box to test on right now. on 2011-04-22 at 05:11pm EDT |
Jason R. Coombs (jaraco) posted: confirmed: posixpath is available on all platforms by default. on 2011-05-25 at 02:20pm EDT |
Jason R. Coombs (jaraco) posted: I've added another commit (https://github.com/jaraco/fabric/commit/0a592f185783a1331816733565bb0ac005e9f714) to my fork which incorporates the additional locations where remote paths were using os.path.join. on 2011-05-25 at 02:30pm EDT |
Christian Long (christianmlong) posted: I applied Jason's posixpath fixes to Fabric 1.0.1. See attached patch file. Works on Windows XP, Python 2.5. on 2011-06-01 at 12:08pm EDT |
Jeff Forcier (bitprophet) posted: Christian Long wrote:
Awesome, thanks. This was actually next on my list for tackling (trying to get 1.0.2 and 1.1 out soon) so you have good timing. on 2011-06-01 at 05:09pm EDT |
Yannick Jost (yanjost) posted: Still not in 1.2 ? on 2011-07-22 at 07:39am EDT |
I have same issue, but seems it is not addressed in 1.2 |
Protip: ticket status is a great indicator of whether something has been released or not ;) Also, changelogs. This ticket is open, and is not listed in the 1.2 changelog, so no, it has not been fixed yet. The best way to keep track is to just watch this ticket -- I will comment (or you will see commit message notes & its status going to 'Closed') when it's fixed :) |
Fixed via #570. |
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 useos.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
andget
.fabric/sftp.py
is littered withos.path.join
.So, we should:
os.path.join
hardcoded to use a Unix-style separatoros.path.join
for all remote contextsOriginally submitted by Jeff Forcier (bitprophet) on 2011-03-07 at 06:30pm EST
Attachments
Relations
The text was updated successfully, but these errors were encountered: