Message333832
I'm working on PR but I found an issue.
shutil.which() behaves differently than subprocess, distutils.spawn.find_executable() and os.execv() when PATH is set but set to an empty string:
* os.get_exec_path() returns ['']
* shutil.which() returns None: DON'T RUN
* subprocess RUNS the program
* distutils.spawn.find_executable('program') returns 'program': RUN the program
* os.execv() RUNS the program
Using PATH=":", they all run the program and os.get_exec_path() returns ['', ''].
Who is right? Which behavior do we want for Python?
Note: When PATH is set to an empty string, shutil.which() and distutils.spawn.find_executable() use the empty string, they don't use os.defpath. |
|
Date |
User |
Action |
Args |
2019-01-17 09:22:29 | vstinner | set | recipients:
+ vstinner, gregory.p.smith, giampaolo.rodola, christian.heimes, izbyshev |
2019-01-17 09:22:28 | vstinner | set | messageid: <1547716948.7.0.62413959313.issue35755@roundup.psfhosted.org> |
2019-01-17 09:22:28 | vstinner | link | issue35755 messages |
2019-01-17 09:22:28 | vstinner | create | |
|