[Python-Dev] towards a stricter definition of sys.executable (original) (raw)

Barry Warsaw barry at python.org
Thu Mar 16 23:25:39 CET 2006


On Thu, 2006-03-16 at 12:02 +0100, Fredrik Lundh wrote:

a) sys.executable points to the executable that was used to load the Python interpreter library/dll.

this use is supported by the docstring and the implementation, and is quite common in the wild. an application using this interpretation may - call sys.executable to run another instance of itself - extract data from resources embedded in (or attached to) sys.executable - locate configuration data etc via os.path.dirname(sys.executable)

Yep, that's how our embedded apps use sys.executable.

to fix this, I propose adding another sys variable; for example, let sys.executable keep behaving like case (a) (which is how it's implemented today), and add a new sys.pythonexecutable for case (b). the latter can then be set to None if a proper interpreter cannot be located.

As long as sys.executable behaving like a) doesn't change, that seems fine with me. ;)

-Barry

-------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 309 bytes Desc: This is a digitally signed message part Url : http://mail.python.org/pipermail/python-dev/attachments/20060316/62ca093a/attachment.pgp



More information about the Python-Dev mailing list