> 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. No. > 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/)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4