[Python-Dev] Re: [PyWX] RE: PyWX (Python AOLserver plugin)
Guido van Rossum
Wed, 13 Sep 2000 07:57:03 -0500
> Let's set os.environ to a normal dict (i.e., break the connection to
> the process's actual environment) initialized to the contents of the
> environment. This fake environment can be passed to a child using
> execve. We would have to override os.system() and its cousins to use
> execve with this fake environment.
> We only need to figure out:
> 1. Whether we can just assign a dict to os.environ (and
> posix.environ?) to kill their special behaviors;
You only need to assign to os.environ; posix.environ is not magic.
> 2. Whether such changes can be made separately in each interpreter
> without them affecting one another;
Yes -- each interpreter (if you use NewInterpreter or whatever) has
its own copy of the os module.
> 3. Whether special measures have to be taken to cause the fake
> environment dictionary to be garbage collected when the interpreter
> is destroyed.
> Regarding PWD there's nothing we can realistically do except document
> this limitation and clobber os.chdir() as suggested by Guido.
--Guido van Rossum (home page: http://www.pythonlabs.com/~guido/)