[issue4057] Popen(..., cwd=...) does not set PWD environment variable

2009-12-01 Thread R. David Murray
R. David Murray added the comment: I agree that this is not something that Popen should be doing. If you need the environment variable set, the correct thing to do is what you did: set it in the environment you pass to Popen. -- nosy: +r.david.murray priority: -> normal resolution: -

[issue4057] Popen(..., cwd=...) does not set PWD environment variable

2009-11-30 Thread Jean-Paul Calderone
Jean-Paul Calderone added the comment: `Popen` is the wrong place to implement this functionality. It may be reasonable to introduce a higher-level wrapper API which does this sort of thing. Consider that if `Popen` itself does it, though, then there is no way to launch a process with a partic

[issue4057] Popen(..., cwd=...) does not set PWD environment variable

2009-11-30 Thread Geoffrey Bache
Geoffrey Bache added the comment: I tried that and it didn't work, though not for this reason. I'm also trying to read the output from the subprocess via a pipe and that wasn't being collected for some reason. I didn't really track down why so far, if it makes or breaks this bug I can do so thou

[issue4057] Popen(..., cwd=...) does not set PWD environment variable

2009-11-27 Thread Antoine Pitrou
Antoine Pitrou added the comment: What if you pass shell=True to the subprocess call? -- nosy: +pitrou ___ Python tracker ___ ___ Pyth

[issue4057] Popen(..., cwd=...) does not set PWD environment variable

2009-11-27 Thread Geoffrey Bache
Geoffrey Bache added the comment: You misunderstand: I am not reading $PWD. I need to call a C program as a subprocess, which is written by a third party and which determines its current working directory by reading $PWD. os.chdir will not have any effect on this script, nor will passing "cwd" t

[issue4057] Popen(..., cwd=...) does not set PWD environment variable

2009-11-26 Thread Ronald Oussoren
Ronald Oussoren added the comment: On 26 Nov, 2009, at 19:27, Geoffrey Bache wrote: > > Geoffrey Bache added the comment: > > I can see your point, though I think particularly in this case it's > (unfortunately) fairly common that scripts on POSIX platforms read $PWD > instead of finding the

[issue4057] Popen(..., cwd=...) does not set PWD environment variable

2009-11-26 Thread Geoffrey Bache
Geoffrey Bache added the comment: I can see your point, though I think particularly in this case it's (unfortunately) fairly common that scripts on POSIX platforms read $PWD instead of finding the current working directory properly. I'm probably not the first person that has had to set PWD exp

[issue4057] Popen(..., cwd=...) does not set PWD environment variable

2009-11-26 Thread Ronald Oussoren
Ronald Oussoren added the comment: In most shells $PWD is a magic variable that is maintained by the shell itself. IMHO python has no reason to mess with variables that happen to be defined by some shells. If subprocess were to set $PWD, os.setuid should set $UID, and there may be other mag

[issue4057] Popen(..., cwd=...) does not set PWD environment variable

2009-11-26 Thread Geoffrey Bache
Changes by Geoffrey Bache : -- nosy: +gjb1002 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python

[issue4057] Popen(..., cwd=...) does not set PWD environment variable

2008-10-06 Thread Miki Tebeka
New submission from Miki Tebeka <[EMAIL PROTECTED]>: [21:26] pwd-bug $cat m #!/usr/bin/env python from subprocess import Popen Popen(["./t"], cwd="./p") [21:26] pwd-bug $cat p/t #!/usr/bin/env python from os import environ print environ["PWD"] [21:26] pwd-bug $python m /Users/mtebeka/playgrou