[Chicago] Weird Issue with Popen/chdir

Daniel Griffin dgriff1 at gmail.com
Thu Oct 29 03:30:35 CET 2009


Hi all,

I am trying to use Popen to run a script in a certain directory. I am using
the cwd argument.  I am on Mac OS 10.5/10.6

My test script is simply:
from subprocess import Popen, PIPE
p = popen("pwd", stdout=PIPE, shell=True, cwd="/etc")
p.wait()
p.communicate()[0]

and it outputs
/private/etc

The same thing happens with os.chdir
I google a bunch with no luck, anyone have any input?

thanks,
Dan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/chicago/attachments/20091028/a896b301/attachment.htm>


More information about the Chicago mailing list