
report at bugs
Nov 26, 2009, 11:23 PM
Post #4 of 9
(668 views)
Permalink
|
|
[issue4057] Popen(..., cwd=...) does not set PWD environment variable
[In reply to]
|
|
Ronald Oussoren <ronaldoussoren [at] mac> added the comment: On 26 Nov, 2009, at 19:27, Geoffrey Bache wrote: > > Geoffrey Bache <gjb1002 [at] users> 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 explicitly in > a python program for this reason. Yes, it's really the fault of the > people who maintain the script I'm calling, but I don't think setting > PWD on POSIX could have any bad effects and should surely be easy to do? Shouldn't the script set $PWD itself? AFAIK shells like bash will set $PWD regardless of whether they are running as an interactive shell or as a shellscript. Reading os.environ['PWD'] in a Python script not a good example of whey the proposed functionality might be useful because there are a number of ways to change the current working directory without affecting os.environ. For example using os.chdir, or even an extensions that calls the chdir system call directly. Ronald ---------- Added file: http://bugs.python.org/file15404/smime.p7s _______________________________________ Python tracker <report [at] bugs> <http://bugs.python.org/issue4057> _______________________________________
|