fab-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Fab-user] Current Working Directory for local() function under Windows


From: John REG
Subject: [Fab-user] Current Working Directory for local() function under Windows seems incorrect.
Date: Wed, 16 May 2012 20:55:52 -0700 (PDT)

I'm just a beginning to use fabric.  I'm running under a Windows 7 and using 
MinGW with msys in order to replicate a unix-like bash shell environment.  

When I use the local() function, the working directory is changed to the root 
of my c: drive.  If I call subprocess.call(), than the current working 
directory is correct.  If I set "shell=True", in the subprocess.call, then the 
directory is also incorrect.  My fabfile.py:

====================================
from fabric.api import local
import subprocess

def prepare_deploy():
    local("pwd")
    subprocess.call("pwd")
    subprocess.call("pwd", shell=True)
====================================

What I see in my msys shell:

====================================
address@hidden /c/Users/gkvj4293/tmp
$ pwd
/c/Users/gkvj4293/tmp

address@hidden /c/Users/gkvj4293/tmp
$ fab prepare_deploy
/c
/c/Users/gkvj4293/tmp
/c
[localhost] local: pwd

Done.
====================================

Shouldn't local place me in my pwd?  I'm using pre-built python binaries.  My 
versions:

$ python --version
Python 2.7.3

$ fab --version
Fabric 1.4.2
ssh (library) 1.7.14

Perhaps Fabric should provide an option to set shell=False. 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]