Message371357
Thanks for confirming that reality aligns with the documentation.
> when doing the same and passing `shell=True` to the POpen() call, there is no such initial folder in the lookup
Correct, because a fully qualified path to cmd.exe is used, and cmd.exe's application folder is not Python's.
Ultimately, the above behaviour could have occurred anyway, so all that has really happened is that it is now more obvious. This is what always happens when you include support for other platforms - you find out which of your previous assumptions were incorrect (same principle applies to all of life if you think about it).
If someone wants to update subprocess to manually search PATH when just provided with a filename, I'm okay with that. It would be a new enhancement though.
For earlier versions, updating the docs to clarify that subprocess does not do a PATH search but relies on operating system behaviour for relative paths is probably the most helpful way to raise awareness. |
|
Date |
User |
Action |
Args |
2020-06-12 12:01:44 | steve.dower | set | recipients:
+ steve.dower, paul.moore, eric.smith, tim.golden, Jurko.Gospodnetić, zach.ware, eryksun, uranusjr, Benedek Rácz |
2020-06-12 12:01:44 | steve.dower | set | messageid: <1591963304.53.0.599494423279.issue38905@roundup.psfhosted.org> |
2020-06-12 12:01:44 | steve.dower | link | issue38905 messages |
2020-06-12 12:01:44 | steve.dower | create | |
|