Message info
 
To:Ronald Oussoren From:Martin v. Löwis Subject:Re: [Python-Dev] PEP 405 (pyvenv) and system Python upgrades Date:Mon, 07 May 2012 22:51:21 +0200
 

> The bin/python3 executable in a framework is a small stub that
> execv's the real interpreter that is stuffed in a Python.app bundle
> inside the Python framework. That's done to ensure that GUI code can
> work from the command-line, Apple's GUI framework refuse to work when
> the executable is not in an application bundle.
>
> Because of this trick pyvenv won't know which executable the user
> actually called and hence cannot find the pyvenv configuration file
> (which is next to the stub executable).

I don't understand. The "executable that the user actually called":
does that refer to

a) the stub (which the user *actually* called) or
b) the eventual binary (which is what gets *actually* run).

If a), then I think argv[0] just needs to continue to refer to the
stub, which is easy to achieve in execv.

If b), I wonder why the code needs to know the location to the binary
inside the bundle. But if this is needed to know, I suggest that some
environment variable is passed from the stub to the actual binary
(akin PYTHONHOME). How does the stub normally find out where the
framework is located?

Regards,
Martin
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40all-mail-archive.com