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

put() not expanding tildes correctly #323

Closed
bitprophet opened this issue Aug 19, 2011 · 6 comments
Closed

put() not expanding tildes correctly #323

bitprophet opened this issue Aug 19, 2011 · 6 comments
Labels
Bug

Comments

@bitprophet
Copy link
Member

@bitprophet bitprophet commented Aug 19, 2011

Description

IRC user mercurial reports that when he calls put('blah.tar.gz', '~/target_existing_directory'), Fabric spits out a "File not found" IOError abort. Replacing the tilde with an absolute path works correctly. This implies that the tilde replacement is broken.

For reference, his local system is OS X 10.6 and his remote is Ubuntu 10.04.


Originally submitted by Jeff Forcier (bitprophet) on 2011-03-18 at 07:37pm EDT

@ghost ghost assigned bitprophet Aug 19, 2011
@bitprophet
Copy link
Member Author

@bitprophet bitprophet commented Aug 19, 2011

Jeff Forcier (bitprophet) posted:


Confirmed, I can reproduce this locally, and upon investigation the code in get which handles tilde expansion is not replicated in put.

Will test + fix.


on 2011-03-23 at 04:31pm EDT

@bitprophet
Copy link
Member Author

@bitprophet bitprophet commented Aug 19, 2011

Daleep Sall (daleep) posted:


I have also noticed that when I do:

with lcd('~/local_path/'):
   put('local_file', 'remote_path')

I get the error:

Traceback (most recent call last):
  File "/usr/local/lib/python2.6/dist-packages/fabric/main.py", line 537, in main
    commands[name](*args, **kwargs)
  File "fabfile.py", line 35, in make_code_live
    put('local_file', 'remote_path')
  File "/usr/local/lib/python2.6/dist-packages/fabric/network.py", line 304, in host_prompting_wrapper
    return func(*args, **kwargs)
  File "/usr/local/lib/python2.6/dist-packages/fabric/operations.py", line 403, in put
    raise ValueError(err)
ValueError: '~/local_path/local_file' is not a valid local path or glob.

Is this a related issue? Thanks.


on 2011-05-13 at 08:40am EDT

@bitprophet
Copy link
Member Author

@bitprophet bitprophet commented Aug 19, 2011

Piet Delport (pjdelport) posted:


It looks like this regression happened in commit:69634775264786ec765375db87fa0b0eac128285, which deleted the following lines:

        if remote_path.startswith('~'):
            remote_path = remote_path.replace('~', home, 1)

on 2011-07-22 at 06:42am EDT

@ngnpope
Copy link

@ngnpope ngnpope commented Oct 31, 2011

Would it be possible to make this behave more like shells do for tilde-expansion where the username after the tilde will expand to that user's home directory? Some examples:

~/home/user
~user/home/user
~root/root
~www-data/var/www
@bitprophet
Copy link
Member Author

@bitprophet bitprophet commented Oct 31, 2011

See above =) that request is not unreasonable but it's a nice-to-have new feature and not actually related to this, which was a legit bug.

@ngnpope
Copy link

@ngnpope ngnpope commented Nov 2, 2011

Indeed. And fair point.

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
You can’t perform that action at this time.