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 hroncok, izbyshev, nanjekyejoannah, pablogsal, torsava, vstinner
Date 2021-02-03.14:16:46
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1612361806.57.0.669902289796.issue43113@roundup.psfhosted.org>
In-reply-to
Content
> FileNotFoundError: [Errno 2] No such file or directory: Either './demo' or the interpreter of './demo' not found.

This doesn't sound good to me because a very probable and a very improbable reasons are combined together without any distinction. Another possible issue is that usage of the word "interpreter" in this narrow sense might be non-obvious for users.

ISTM that the most minimal way to check for the possibility of interpreter issue would be do something like `access(exe_path, X_OK)` in case of ENOENT: if it's successful, then a "bad interpreter" condition is likely. But in case of os.posix_spawnp(), the search in PATH is performed by libc, so CPython doesn't know exe_path. OTOH, subprocess and os.exec*p do perform their own search in PATH, but in case of subprocess it happens in the context of the child process, so we'll probably need to devise a separate error code to report to the parent via the error pipe to distinguish this condition.

So far, I'm not convinced that the result is worth it, but I do agree that such mysterious "No such file" errors are not user-friendly.
History
Date User Action Args
2021-02-03 14:16:46izbyshevsetrecipients: + izbyshev, vstinner, torsava, hroncok, pablogsal, nanjekyejoannah
2021-02-03 14:16:46izbyshevsetmessageid: <1612361806.57.0.669902289796.issue43113@roundup.psfhosted.org>
2021-02-03 14:16:46izbyshevlinkissue43113 messages
2021-02-03 14:16:46izbyshevcreate