[issue43113] os.posix_spawn errors with wrong information when shebang points to not-existing file
STINNER Victor
report at bugs.python.org
Thu Feb 11 02:56:35 EST 2021
STINNER Victor <vstinner at python.org> added the comment:
> Note that ENOENT is ambiguous, but the exception message is very specific about what file is not found. And it is not always correct.
If you want to be extra nice, you can try to check if the file exists. If it exists, add a message about the shebang.
The problem is that the code to generate the exception is quite generic, it creates an OSError exception object from an errno (int) and a filename (str). It's not trivial to change the exception message. Is it worth it?
----------
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43113>
_______________________________________
More information about the Python-bugs-list
mailing list