Message311733
Nathaniel's specific description of a problem is wrong. A Path with embedded spaces is treated no different than one without by default.
Where things change, and what needs fixing, is when shell=True is passed. In that case a PathLike object should not be allowed as it will be turned into a flat string passed to the shell for parsing.
# I've created an executable bash script called "x/mybin -h" for this that just does: echo "hello from mybin $*"
>>> run("x/mybin -h", shell=True)
/bin/sh: 1: x/mybin: not found
CompletedProcess(args='x/mybin -h', returncode=127)
>>> run("x/mybin -h")
hello from mybin
CompletedProcess(args='x/mybin -h', returncode=0)
>>> run(Path("x/mybin -h"), shell=True)
/bin/sh: 1: x/mybin: not found
CompletedProcess(args=PosixPath('x/mybin -h'), returncode=127)
>>> run([Path("x/mybin -h")], shell=True)
/bin/sh: 1: x/mybin: not found
CompletedProcess(args=[PosixPath('x/mybin -h')], returncode=127)
>>> run(Path("x/mybin -h"))
hello from mybin
CompletedProcess(args=PosixPath('x/mybin -h'), returncode=0)
>>> run([Path("x/mybin -h")])
hello from mybin |
|
| Date |
User |
Action |
Args |
| 2018-02-06 16:52:23 | gregory.p.smith | set | recipients:
+ gregory.p.smith, ned.deily, njs, serhiy.storchaka, Phaqui, Roy Williams |
| 2018-02-06 16:52:23 | gregory.p.smith | set | messageid: <1517935943.74.0.467229070634.issue31961@psf.upfronthosting.co.za> |
| 2018-02-06 16:52:23 | gregory.p.smith | link | issue31961 messages |
| 2018-02-06 16:52:23 | gregory.p.smith | create | |
|