quetz-mod_python-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Wilson <dave.lee.wil...@gmail.com>
Subject Re: inital questions and patches
Date Wed, 30 Jun 2004 17:18:25 GMT
Gregory (Grisha) Trubetskoy <grisha@apache.org> wrote:
> Well, first of all, it is made pretty clear in the documentation that the
> cgihandler is a hack.

yep, understood.  unfortunately it seemed like it would be the best
way to use mod_python and pyblosxom, which relies on cgi only and is
ignorant of mod_python.  for example, I noticed the pyblosxom code is
also inserting into sys.path on each request.  makes me think that
sys.path should be present itself as an ordered set, not allowing dup
entries.

> As to why it doesn't use execfile - I don't
> remember. Most likely it's because execfile will actually interpret the
> source code from scratch every time, which is so slow, you might as well
> not bother with mod_python at all and just use the Apache's CGI.

so using load_module will compile it and keep it in memory?  can
execfile execute an already compiled .pyc?  would that too be slow?
any suggestions as to how I might set the __name__ variable when the
cgi script/module is loaded and run?  it's not necessary, just
curious.

> Now this one I'm not so sure about. cgihandler will chdir into the
> directory of the script, and '.' should be in sys.path by default.

it seems '.' is not in sys.path.  at least not at the time
cgihandler's code is executing.

> Also, you cannot just insert things into sys.path because after ten
> requests you'll end up with a sys.path that has ten dirs at the beginning
> :-)

yeah, I see now, thanks.  pyblosxom is doing the same thing.

would anybody here like a gmail invite?  I only have one left.

Dave

Mime
View raw message