>> It seems thatPYTHONHOMEhas a totally different meaning onWindows
>> than UNIX boxes. OnWindowsit seems the only thing it is used for is
>> to resolve where relative URLs in PYTHONPATH are rooted at.
>>
>
> Not true.  Look at lines 483-490 of getpathp.c:
>
>        if (pythonhome == NULL || *pythonhome == '\0') {
>                if (search_for_prefix(argv0_path, LANDMARK))
>                        pythonhome = prefix;
>                else
>                        pythonhome = NULL;
>        }
>        else
>                strncpy(prefix, pythonhome, MAXPATHLEN);
>
> In other words, if PYTHONHOME is set, it's copied into the global
> "prefix" variable, which is where sys.prefix comes from.
>
>
>> It would also seem onWindowsthat everything is based off where the
>> Python DLL is located and that cannot be overridden through
>> configuration that mod_wsgi could set.
>
> Also not true.  The Python standard library is installed under C:
> \Python26, while the DLL is installed into C:\Windows\System32.  The
> only thing the DLL location determines is the python26.zip file
> location; this will be something like C:\Windows
> \System32\python26.zip.
>
> I did my own build of mod_wsgi 2.5, with Python 2.6.2 and Apache
> 2.2.11.  The only thing I changed is that I removed the preprocessor
> directives that disable WSGIPythonHome on Windows.  If I set up a web
> server with this directive:
>
> WSGIPythonHome C:/AltPyLib
>
> I get a sys.path which is akin to this:
>
> C:\WINDOWS\system32\python26.zip
> C:\AltPyLib\DLLs
> C:\AltPyLib\lib
> C:\AltPyLib\lib\plat-win
> C:\AltPyLib\lib\lib-tk
> C:\Program Files\apache\bin
>
> Isn't that exactly what's expected?  Other than maybe the zip file,
> which doesn't exist by default anyway.

FWIW, all the speculation in that discussion was based on me having to
interpret second hand information sent to me by others. Usually those
people didn't know what to look for and could well not have been doing
the correct thing or interpreting the result properly. Part of the
feedback could also have been based on older versions of Python which
possibly may not have worked in exactly the same way for all I know.

It is only recently that I have started building mod_wsgi myself on
Windows and even then I don't really test it on Windows much. Now that
I have the environment, I am in a position to properly research this
issue however, so I will create a ticket to do that. I am not sure
though whether changes will be made for mod_wsgi 3.0 however, depends
on how much time I have.

> Incidentally, I've noticed in this thread a lot of people are
> referencing log output like this:
>
> [Tue Jan 15 16:48:57 2008] [warn] mod_wsgi: Python module path 'C:\
> \WINDOWS\\system32\\python25.zip;C:\\Python25\\Lib;C:\\Python25\
> \DLLs;C:\\Python25\\Lib\\lib-tk;;C:\\Program Files\\Apache Software
> Foundation\\Apache2.2\\bin'.
>
> That output is produced by wsgi_python_version, which is called before
> Py_SetPythonHome; so how could it ever reflect WSGIPythonHome?

Later versions of mod_wsgi than you are using don't output that any
more as it is mostly meaningless anyway, even if Python home was
overridden.

PS. I have sent this back onto list with bcc to you in case you don't
want your details public given you sent me this direct.

Graham

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"modwsgi" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/modwsgi?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to