Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.python
Re: Odd behaviour of *.pth files and Apache
Gabriel Genellina
2/26/2008 5:02:00 AM
En Sat, 23 Feb 2008 12:52:45 -0200, D'Arcy J.M. Cain <darcy@druid.net>
escribió:
> On Thu, 21 Feb 2008 13:55:25 -0500
> "D'Arcy J.M. Cain" <darcy@druid.net> wrote:
>> I tried searching the archives for information on this but nothing
>> seemed to be germane. I am running Python sripts as CGI under Apache
>> and I have a .pth file in site-packages that includes directory that
>> has another .pth in it. Sometimes it picks up the paths in the
>> second .pth and sometimes it does not. It always seems to work if I am
>> working in a location not in the ServerRoot but if I use the main site
>> it does not pick up the directories in the included .pth.
>
> I have more information now. It seems that it recurses the .pth files
> it finds in PYTHONPATH but not for directories found in the .pth files
> in site-packages. Is this expected behaviour? The documentation
> suggests that it should pick up both.
If a .pth file contains a valid directory, it is added to sys.path but
it's not searched for additional .pth files. From
http://docs.python.org/lib/module...
"A path configuration file is a file whose name has the form package.pth
AND EXISTS IN ONE OF THE FOUR DIRECTORIES MENTIONED ABOVE" (emphasis by me)
(the four directories being .../lib/python2.5/site-packages, site-python,
etc.)
(Mmm, what the 2.5 docs say is not exactly the same as the actual code in
site.py, and the version in
http://docs.python.org/dev/library...
is not the same as the svn version of site.py... anyway, directories added
by mean of .pth files are not recursively searched for more .pth files)
--
Gabriel Genellina
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
Re: Odd behaviour of *.pth files and Apache
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password