[Zope-Coders] silly windows request

Chris McDonough chrism@zope.com
09 Oct 2002 15:12:37 -0400


On Wed, 2002-10-09 at 14:47, Guido van Rossum wrote:
> > Yes, I officially give up trying to make portable batch files.
> 
> If you can tell me what the for loop tries to do, I could check in a
> separate config98.bat that tries to do this.

Glutton for punishment, eh? ;-)

It tries to iterate over the lines in the tempfile python-for-zope.reg,
which (hopefully!) contains the path to a Python interpreter on a line
exactly like:

Python.exe=C:\Program Files\Python\python.exe

It should break apart this line and the FOUND_PYTHON batch file var
should be set to "C:\Program Files\Python\python.exe".  The script
should do the right thing thereafter.

Note that the configure.bat script should probably make user-visible
note of the fact when its run that you can pass in the Python you wish
to use by setting the PYTHON envvar in the shell before you run the
configure.bat script:

PYTHON=c:\MyPython\python.exe

The registry-searching bit (and thus the bizarre for loop) will be
skipped if this envvar is set.

> > What values are in zctl.py for the following module-level variables:
> > 
> > CONFIG_LOCATION
> 
> 'c:\inst\etc\zope.conf'
> 
> (I note that this really ought to double the backslashes or use a raw
> string literal.)

Yup.  I'll check in a change now and for the other occurence of this . 
Thanks...

> I looked in c:\zope\lib\python.  It contains a subdir Lib, which
> contains a subdir site-packages, which has all the Zope code.  Was
> this intended?

No.  Bummer.  This must be due to differences between the interpretation
of the "--prefix="  argument to "setup.py" between distutils on W2k and
Win98 (see line 77 of the windows Makefile).  The intent of this line is
to instruct distutils to install the stuff that's in the build tree's
"lib/python" into the target dir's "lib/python".

The same thing is done on UNIX by passing "--home=" instead of
"--prefix=", but on Windows, distutils doesn't support "--home=".  On
Win2k, however, passing "--prefix=" does "the right thing" (maybe due to
a bug?).  As a result under Win2k, the files end up in
"$(TARGET_DIR)/lib/python", not
"$(TARGET_DIR)/lib/python/Lib/site-packages" like on 98.  I'm not
exactly sure how to fix this.  I'll need to dig into the distutils code.

Thanks again for helping!

- C