[Fwd] Re: [IPython-user] Re[2]: IPython install under Win2000

Fernando Perez Fernando.Perez at colorado.edu
Mon Jul 18 11:18:41 CDT 2005

Jerry McRae wrote:

> That being said, I have *never* seen *any* environment variables that
> need re-expanding. In fact one cannot set any environment variable to
> a macro (I.E. %anothername%) from the command line or a batch file
> because the macro will be expanded before assigning the environment
> variable.  That would be possible only from a program.  I would
> consider that an aberration and any program that does not play by the
> same unwritten rules as everyone else.
> But then again, I don't know what weirdness Win2000 introduced. Does
> anyone know *for sure* what the environment variables look like in a
> virgin Win2000 install?
> In WinXP Home and Pro there is a USERPROFILE and a HOMEPATH (which is
> used as a starting directory when running cmd.exe), but no HOME. So
> any HOME environment variable was added by customizing or by another
> application.

Thanks for your input: at least your experience supports my gut feeling, that 
environment variables should NOT be re-expanded.  How is end-user code 
supposed to know when to stop expanding?  What are the syntactic rules for 
what should be considered 'unexpanded' and what 'final form'?  I mean, under 
*nix it's easy enough to set an environment variable which contains $ in it:

planck[lanl]> setenv FOO '\$HOME'
planck[lanl]> env | grep FOO

but you won't be making friends if you set $HOME to \$SOMETHINGELSE and then 
complain because programs are not re-expanding your macro manually.  People 
will happily tell you 'set your environment variables to a VALUE, not a macro, 
since all sane *nix code assumes they hold final values'.  I'd like to 
understand exactly why things are different under win32, and if so, what the 
proper rules for expansion and finalization of the expansion chain are.

I don't want to seem to be ignoring Alan's plight, and I'll be happy to apply 
a fix.  But I want it to be the right thing.  If this is an instance where 
Alan's system is misconfigured, I don't want to start adding crufty code which 
may harm something later on (that always happens).



More information about the IPython-user mailing list