put() not expanding tildes correctly #323

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

Comments

Projects
None yet
2 participants
@bitprophet
Member

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

This comment has been minimized.

Show comment
Hide comment
@bitprophet

bitprophet Aug 19, 2011

Member

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

Member

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

This comment has been minimized.

Show comment
Hide comment
@bitprophet

bitprophet Aug 19, 2011

Member

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

Member

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

This comment has been minimized.

Show comment
Hide comment
@bitprophet

bitprophet Aug 19, 2011

Member

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

Member

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

This comment has been minimized.

Show comment
Hide comment
@ngnpope

ngnpope 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

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

This comment has been minimized.

Show comment
Hide comment
@bitprophet

bitprophet Oct 31, 2011

Member

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.

Member

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

This comment has been minimized.

Show comment
Hide comment
@ngnpope

ngnpope Nov 2, 2011

Indeed. And fair point.

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