PATH environment variable

mirandacascade at yahoo.com mirandacascade at yahoo.com
Sun Nov 20 14:23:07 EST 2005


Fredrik Lundh wrote:
> what part of your observations makes you think that the environment isn't "captured" (i.e. > copied from the process environment) when the os module is imported ?

Answer: the part that was informed by a fundamental misunderstanding on
my part of how the os module obtains information.

Based on Mr. Lundh's 'copied from the process environment' remark and
his hint, I would infer the following:

1) In the observations I detailed, the 'process' is the pythonwin
application
2) When the pythonwin application is invoked, it obtains a copy of the
current environment
3) the import os statement obtains information from the copy of the
current environment that was obtained when the pythonwin process began
4) a reload(os) or a combination of del os followed by import os also
get information from the copy of the current environment that was
obtained when the pythonwin process began

My questions:
a) are the above inferences (albeit oversimplified) correct?
b) when the hint refers to a new process, does the term 'process' refer
to the same concept that is described in secion 6.1.5 of the Python
Library Reference?




More information about the Python-list mailing list