Author gregory.p.smith
Recipients Phaqui, Roy Williams, gregory.p.smith, ned.deily, njs, serhiy.storchaka
Date 2018-02-06.16:52:23
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
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:23gregory.p.smithsetrecipients: + gregory.p.smith, ned.deily, njs, serhiy.storchaka, Phaqui, Roy Williams
2018-02-06 16:52:23gregory.p.smithsetmessageid: <>
2018-02-06 16:52:23gregory.p.smithlinkissue31961 messages
2018-02-06 16:52:23gregory.p.smithcreate