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

csh and path() Context Manager #1300

Closed
lucacorti opened this issue Mar 31, 2015 · 5 comments
Closed

csh and path() Context Manager #1300

lucacorti opened this issue Mar 31, 2015 · 5 comments

Comments

@lucacorti
Copy link

Hi,

the path context manager seems to fail when trying to append path on FreeBSD/csh containing unescaped characters like $, ~ and .. It also seems to add unneeded extra quotes.

E.g., with bower installed locally:

...
@task
def staging()
...
    env.directory = '~/'
    env.venv_activate = 'bin/activate.csh'
    env.venv = env.directory + 'venv/'
    env.use_shell = False
    env.add_to_path = [
        env.directory + 'node_modules/bower/bin',
        env.directory + 'node_modules/uglifyjs/bin',
        env.directory + 'node_modules/yuglify/bin',
    ]
...
@task
def deploy()
    with cd(env.directory), prefix('source ' + env.venv + env.venv_activate), path(":".join(env.add_to_path)):
        env.run('npm install')
        env.run('bower install')
...

fab staging deploy

returns

[freebsd] run: npm install
[freebsd] out: Bad : modifier in $ (").
[freebsd] out: 

Fatal error: run() received nonzero return code 1 while executing!

Requested: npm install
Executed: cd ~/ && source ~/venv/bin/activate.csh && export PATH="$PATH:"~/node_modules/bower/bin/:~/node_modules/yuglify/bin/:~/node_modules/uglify-js/bin/"" && npm install

also export is probably not working anyway in csh, should be setenv I think.

@lucacorti
Copy link
Author

Forgot to mention I'm on Python 2.7.9, Fabric 1.10.1.

@jeamland
Copy link

It looks like something somewhere is over-quoting the path string. In the "Executed" line, we see:

[...] export PATH="$PATH:"[...]"" [...]

i.e. we're opening quotes before $PATH, then opening again after the : (causing csh to complain) and then closing both sets at the end.

@mradziej
Copy link

mradziej commented Jul 7, 2016

csh behaviour with quoting and backslashes is strange. I had similar problems and found a fix: You need to set backslash_quote in csh. See pull request #1483. Feedback welcome.

@bitprophet
Copy link
Member

Please comment if the setting from #1483 is insufficient and we can reopen - thanks! (Though - I'll note that Fabric 1's aggressively "helpful" autoquoting is generally problematic and won't be present by default in 2.x.)

@lucacorti
Copy link
Author

Still getting the same error. However I'm not currently using path() so I'm fine with leaving it this way and eventually retesting on 2.x.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants