Re: [IPython-user] Re: Re: Re[2]: IPython not reloading file under Win2000

Jerry McRae qrs0xyc02 at
Mon Jul 18 14:18:37 CDT 2005

Hi Alan,

You <A> wrote on Monday (7/18/2005 at 3:00 PM) thus about [IPython-user] Re: Re: Re[2]: IPython not reloading file under	Win2000:
A> On Mon, 18 Jul 2005, Jerry McRae apparently wrote: 
>> The program DOES NOT make any attempt to decode this 
>> literally, or do anything but use the environment 
>> variables as literals. 

A> I'm not quite sure what you're saying.  But see the part:
A>     for evar in ('HOME', 'USERPROFILE', 'TMP'):
A>         try:
A>             path = os.environ[evar]
A>             if os.path.isdir(path):
A>                 homedir = os.path.join(path, PYTHONCARD_CONFIG_DIR)
A> etc.

* read the environment variable HOME
  -  if it is a valid path, use it to find the pythoncard directory
  -  otherwise, try the USERPROFILE environment variable
  -  otherwise, try the TMP environment variable (which will almost
     always exit)
* if none of these three environment variables were a valid directory,
  use some kind of default.

In order for the program to re-expand it would have to scan the
returned string for more %xxx% variables, which it does not do.  If
your HOME was "C:\Documents and settings\%USERPROFILE%", then that
literal would be returned from the os.environ, and would only pass the
valid directory check if you actually had a folder named

I wish I knew what programs you had that looked at the HOME variable.
I suspect that only programs that were meant to work on both Windozy
and *NIX ever look at HOME, but not having a Win2000 box, I wouldn't
assume I knew for sure where HOME came from.

You know what your current HOME is set to.  Try setting it to the
actual folder name you wish, then try some other programs that you use
often, especially if they are Python programs, and see if they break.
Better yet, remove HOME at try some other programs.  If they complain,
or create HOME, you've identified where it came from.
If they do, change it back (or fix those programs).  The solution you
have so far works, but I'm afraid is specific just for you, and will
be a hassle when upgrading.

When you go after honey with a balloon, 
the great thing is to not let the bees know you're coming.

(Python 2.3.5, IPython 0.6.13, Windows XP)

More information about the IPython-user mailing list