Author Phaqui
Recipients Phaqui, Roy Williams, gregory.p.smith, ned.deily, njs, serhiy.storchaka
Date 2018-02-05.23:40:49
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1517874049.29.0.467229070634.issue31961@psf.upfronthosting.co.za>
In-reply-to
Content
> # runs this weird file
> subprocess.run([bin])

> # Currently an error; if this is implemented, would run
> # /bin/ls, and pass it the -l argument. Refers to something
> # completely different than our .exists() call above.

I do not understand where it is stated that this is the behavior. My understanding was that if run() is passed a single argument, it will interpret the string "/bin/ls -l" to mean "run the `/bin/ls` program, and pass it one argument `-l`, whereas if instead run() is given a list, it will literally treat the first element as the program to run, regardless of how many spaces or whatever else it contains ... And as such, if `bin` is a Path-like object, this issue tries to resolve that
run([bin]) works as excepted, but run(bin) fails horribly.

Sure, I can understand that for strings it may not feel natural how these two things are interpreted differently, but if `bin` is a Path-like object, it at least feels very natural to me that then it should be run as the program name itself (as "paths" does not have arguments).
History
Date User Action Args
2018-02-05 23:40:49Phaquisetrecipients: + Phaqui, gregory.p.smith, ned.deily, njs, serhiy.storchaka, Roy Williams
2018-02-05 23:40:49Phaquisetmessageid: <1517874049.29.0.467229070634.issue31961@psf.upfronthosting.co.za>
2018-02-05 23:40:49Phaquilinkissue31961 messages
2018-02-05 23:40:49Phaquicreate