This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author izbyshev
Recipients eric.smith, gregory.p.smith, hroncok, izbyshev, nanjekyejoannah, pablogsal, torsava, vstinner
Date 2021-02-10.18:16:23
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1612980984.3.0.109262200813.issue43113@roundup.psfhosted.org>
In-reply-to
Content
I generally agree, but getting a good, short error message seems to be the hard part here. I previously complained[1] about the following proposal by @hroncok:

FileNotFoundError: [Errno 2] No such file or directory: Either './demo' or the interpreter of './demo' not found.

But may be it's just me. Does anybody else feel that mentioning "the interpreter" is this way could be confusing in prevalent cases when the actual problem is missing './demo' itself? If we can come up with a good message, I can look into turning it into a PR.

The error message above also reads to me like there are no other possible reasons of ENOENT. On Linux, binfmt_misc[2] provides a way to run arbitrary code on execve(). This is used, for example, to transparently run binaries for foreign arches via qemu-user, so probably ENOENT would be returned if QEMU itself it missing. QEMU *may* be thought as a kind of interpreter here, though it's completely unrelated to a hash-bang or an ELF interpreter.

But I don't know about other POSIX platforms. As a theoretical example, if the dynamic library loader is implemented in the kernel, the system call could return ENOENT in case of a missing library. Do we need to worry about it? Does anybody know about the situation on macOS, where posix_spawn() is a system call too?

[1] https://bugs.python.org/issue43113#msg386210
[2] https://en.wikipedia.org/wiki/Binfmt_misc
History
Date User Action Args
2021-02-10 18:16:24izbyshevsetrecipients: + izbyshev, gregory.p.smith, vstinner, eric.smith, torsava, hroncok, pablogsal, nanjekyejoannah
2021-02-10 18:16:24izbyshevsetmessageid: <1612980984.3.0.109262200813.issue43113@roundup.psfhosted.org>
2021-02-10 18:16:24izbyshevlinkissue43113 messages
2021-02-10 18:16:23izbyshevcreate