[issue43113] os.posix_spawn errors with wrong information when shebang points to not-existing file

Alexey Izbyshev report at bugs.python.org
Wed Feb 10 10:28:37 EST 2021


Alexey Izbyshev <izbyshev at ispras.ru> added the comment:

How do you propose to approach documentation of such behavior? The underlying cause is the ambiguity of ENOENT error code from execve() returned by the kernel, so it applies to all places where Python can call execve(), including os.posixspawn(), os.execve() and subprocess, so it's not clear to me where such documentation should be placed. And, of course, this behavior is not specific to CPython.

The Linux man pages mention various causes of this error[1], though POSIX doesn't[2].

While ENOENT ambiguity is indeed confusing, one of the top results of my DDG search on "linux no such file or directory but script exists" is this link[3].

[1] https://man7.org/linux/man-pages/man2/execve.2.html
[2] https://pubs.opengroup.org/onlinepubs/9699919799/functions/execve.html
[3] https://stackoverflow.com/questions/3949161/no-such-file-or-directory-but-it-exists

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43113>
_______________________________________


More information about the Python-bugs-list mailing list