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

Alexey Izbyshev report at bugs.python.org
Wed Feb 3 11:56:28 EST 2021


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

> IMO the fix is simple: only create OSError from the errno, never pass a filename.

This will remove a normally helpful piece of the error message in exchange to being marginally less confusing in a rare case of non-existing interpreter (the user will still be left wondering why the file they tried to run exists, but "No such file or directory" is reported). So the only "win" here would be for CPython developers because users will be less likely to report a bug like this one.

> posix_spawn() is really complex function which can fail in many different ways.

This issue is not specific to posix_spawn(): subprocess and os.execve() report the filename too. Any fix would need to change those too for consistency.

----------
nosy: +gregory.p.smith

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


More information about the Python-bugs-list mailing list