[issue19948] POSIX semantics of PATH search in execvpe is not respected

2016-11-21 Thread Antti Haapala
Antti Haapala added the comment: While at it, another POSIX semantic that execvp doesn't support is the behaviour when `PATH` is not set, e.g. on Linux, the search path is set to '.', followed by confstr(_CS_PATH). It is debatable whether this is desired (having current directory first in sear

[issue19948] POSIX semantics of PATH search in execvpe is not respected

2016-11-21 Thread Antti Haapala
Antti Haapala added the comment: Someone on Stack Overflow just had a problem where their shell script would work in shell but get `OSError: [Errno 8] Exec format error` when calling it with `subprocess.call`. I'd say rather fix this (on POSIX platforms). Why does Python do path resolving on i

[issue19948] POSIX semantics of PATH search in execvpe is not respected

2016-11-02 Thread Alex Samuel
Alex Samuel added the comment: Here's a real-world case where this can cause unexpected results: A shell script has a typo in the shebang ("#/!bin/bash") but the execute bit set. It still runs via the C library's execvp() and also via bash (which uses execve() but reimplements the behavior)

[issue19948] POSIX semantics of PATH search in execvpe is not respected

2013-12-11 Thread Eric V. Smith
Eric V. Smith added the comment: I know that. This is mostly just a note to myself so I can remember what I've looked at the next time I have a few moments to look at the bug. Or, anyone else who wants to track it down. -- ___ Python tracker

[issue19948] POSIX semantics of PATH search in execvpe is not respected

2013-12-11 Thread Stéphane Glondu
Stéphane Glondu added the comment: > os.execvp calls os._execvpe which calls posix.execv which calls execv. At > least that's how I think it works. I am not contesting that. This bug is about the "search the command in PATH" part. More precisely, the fact that os.execvp continues the search af

[issue19948] POSIX semantics of PATH search in execvpe is not respected

2013-12-11 Thread Eric V. Smith
Eric V. Smith added the comment: os.execvp calls os._execvpe which calls posix.execv which calls execv. At least that's how I think it works. -- ___ Python tracker ___ _

[issue19948] POSIX semantics of PATH search in execvpe is not respected

2013-12-11 Thread Stéphane Glondu
Stéphane Glondu added the comment: > What is the bad idea? Keep looking in subsequent directories in PATH when you > find a candidate for which execve() fails? Sorry, but I beg to differ, and > POSIX is on my side. Sorry, I meant "Stop looking in subsequent [..]". --

[issue19948] POSIX semantics of PATH search in execvpe is not respected

2013-12-11 Thread Stéphane Glondu
Stéphane Glondu added the comment: > What platform is this on? I'm on Linux (Debian testing). > Looking quickly through posix.execve (which is what I think gets called), it > looks like it just calls C's execve(). Yes, but I'm talking about os.execvp, here. With the search in PATH. > Also, w

[issue19948] POSIX semantics of PATH search in execvpe is not respected

2013-12-10 Thread Eric V. Smith
Eric V. Smith added the comment: What platform is this on? Looking quickly through posix.execve (which is what I think gets called), it looks like it just calls C's execve(). Also, what's your use case for this? I realize it might be a standard behavior, but it seems like a bad idea to me. (No

[issue19948] POSIX semantics of PATH search in execvpe is not respected

2013-12-10 Thread R. David Murray
Changes by R. David Murray : -- nosy: +r.david.murray ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://m

[issue19948] POSIX semantics of PATH search in execvpe is not respected

2013-12-10 Thread Stéphane Glondu
New submission from Stéphane Glondu: Hello, According to [1], "In the cases where the other members of the exec family of functions would fail and set errno to [ENOEXEC], the execlp() and execvp() functions shall execute a command interpreter and the environment of the executed command shall