[Python-ideas] Draft PEP for virtualenv in the stdlib

Jim Jewett jimjjewett at gmail.com
Wed Oct 26 20:28:10 CEST 2011


On Wed, Oct 26, 2011 at 1:06 PM, Carl Meyer <carl at oddbird.net> wrote:
> On 10/26/2011 10:04 AM, Jim Jewett wrote:

>> Is there a reason we can't just make sys.* be the virtual
>> environment's version, and sys.base.* be the site-wide version?  You
>> could still find sys.base.*, and you could still check whether
>> sys.prefix == sys.base.prefix, but programs that don't get updated
>> will use the sandboxed virtual version by default.

> Yes, this is a reasonable alternative that Vinay and I discussed at some
> length earlier in development. There are reasonable arguments to be made
> in both directions - you can read my summary of those arguments in the
> "Open Questions" section of the PEP.

Even after re-reading, I'm not sure I fully understand.

As best I can tell, the question is whether sys.prefix should point to
the base system (because of header files?) or the virtual sandbox
(because of user site packages?)

Will header files and such be explicitly hidden from applications
running in the virtual environment?  It sounded like the answer was
"depends on the flag value".  But it seems to me that:

    (a)  If the base system's data (such as headers) are explicitly hidden,
    then there isn't much good reason to then say "oh, by the way, the
    secret is hidden over here".

    (b)  If they are not explicitly hidden, then they (or more-correct
overrides)
    should also be available from the virtual environment (whether by copying
    or by symlink, or even by symlink to the whole directory).

So I'm still not seeing any situation where a normal program should
care about the base value, but I am seeing plenty of situations where
it might erroneously ask for that value and test (or install)
something outside the virtual environment as a result.

-jJ



More information about the Python-ideas mailing list