James Lin added the comment:

Yes, but the Python docs have scary-looking warnings about using shell=True, so 
people (rightly) should avoid using shell=True if they don't think that they 
need it.  And in this case, people might not even know that they're invoking 
some binary that expects PWD from the shell.  

In my experience, it's not that uncommon for people to rewrite sh/bash shell 
scripts in Python.  Something starts off as a sh/bash script, evolves to a 
point where it's cumbersome to maintain, and it gets rewritten in Python.  But 
after it's rewritten, some invoked binaries might not behave as before, and 
it's unclear why.

When I encountered this problem myself, the first thing I tried was to 
explicitly set the `cwd` argument.  Some mention of the PWD environment 
variable would have saved me a lot of time.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue30798>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to