On Nov 29, 2016 5:51 AM, "Wolfgang Maier" < wolfgang.maier@biologie.uni-freiburg.de> wrote:
On 29.11.2016 10:39, Paul Moore wrote:
On 28 November 2016 at 22:33, Steve Dower <steve.dower@python.org> wrote:
Given that, this wouldn't necessarily need to be an executable file. The finder could locate a "foo.missing" file and raise ModuleNotFoundError
with
the contents of the file as the message. No need to allow/require any Python code at all, and no risk of polluting sys.modules.
I like this idea. Would it completely satisfy the original use case for the proposal? (Or, to put it another way, is there any specific need for arbitrary code execution in the missing.py file?)
The only thing that I could think of so far would be cross-platform .missing.py files that query the system (e.g. using the platform module) to generate adequate messages for the specific platform or distro. E.g., correctly recommend to use dnf install or yum install or apt install, etc.
In those cases it would probably be as easy, if not easier, to do that at build-time, which would get us back to simple text files. Making a standard script is hard, if not impossible, in many cases because the package name often does not match the module name. So you are going to need manual intervention in many cases, and modifying a one-line text file is going to be easier than modifying a script.