[Pythonmac-SIG] environment.plist (was: fixing the PATH environment variable for 2.3)

Kevin Altis altis@semi-retired.com
Mon, 3 Feb 2003 09:43:39 -0800


> From: Russell E Owen
>
> ka wrote:
>
> >To simplify using the "right" Python (aka 2.3a1 not Apple's 2.2), I added
> >/usr/local/bin back to the PATH environment variable, by adding
> PATH to my
> >~/.MacOSX/environment.plist file...
> >
> >I also created a simple .cshrc, since environment.plist doesn't
> seem to be
> >getting picked up in the Terminal...(as
> >per)...<http://www.astro.washington.edu/owen/AquaEnvVar.html>...
>
> Did you log out and log back in again after editing
> environment.plist? That is certainly necessary. After that, I would
> expect environment variables in environment.plist to show up in
> Terminal. They certainly do on my system. I define PYTHONPATH,
> PYTHONSTARTUP and PYTHONDOCS in environment.plist and nowhere else
> and they show up fine in Terminal (they are listed by the "env"
> command and they are seen by the command-line version of Python).
>
> If this is not the case for others, I'd certainly like to know about
> it (especially if anybody has an explanation). I wrote the html page
> in question and would like to correct any false information. But I'm
> having trouble imagining why it would work fine for me and not others.

I think the problem is limited to environment variables defined also defined
in the shell. I have PYTHONPATH and CVS_RSH keys defined in
environment.plist and they work as expected. Bill Bumgarner sent me the
following message:

> From: Bill Bumgarner
>
> Anything launched from the Finder [or project builder, whatever], will
> inherit your environment.plist.
>
> Anything launched at the command line will inherit the command line
> environment which, unfortunately and by default, overrides
> environment.plist.
>
> That is broken.   It should be fixed.   I will try to remember to file
> a bug.

You can test what is picked up by an app run from the terminal or using
PythonLauncher from the Finder by printing out os.environ.

ka