[mod_python] What is a directory?

Gregory (Grisha) Trubetskoy grisha at modpython.org
Wed Jul 7 17:50:38 EDT 2004

The code that makes the decision is in src/mod_python.c starting at line 
887. It takes req->filename and calls ap_make_dirstr_parent() on it. If 
that works like it looks it should, (1,3,4) should be in interpeter called 
'/directory/something' and (2,5,6) should be in '/directory'.

You can find out the interpreter name by looking at req.interpreter, BTW.


On Wed, 7 Jul 2004, Stefan C. Kremer wrote:

>> From: "Gregory (Grisha) Trubetskoy" <grisha at modpython.org>
>> When InterpPerDirectory is On, the interpreter name would be based on 
>> the directory name extracted from req->filename.
> So, I guess my question is how is the directory name "extracted" from
> req->filename?
> Or to put it into more concrete terms, let me make a slight modification 
> to the example in the link you provided:
> For example, assume there is a /directory. /directory has an .htaccess 
> file with a PythonHandler directive and InterpPerDirectory, but NO OTHER 
> FILES.  Now suppose that apache is sent requests for:
> 	 (1) /directory/something
>     (2) /directory/something.ext
>     (3) /directory/something/something
>     (4) /directory/something/something.ext
>     (5) /directory/somethingelse
>     (6) /directory/somethingelse.ext
> Assuming that the python handler (via apache) sends some data back for 
> all of these things.  Can you tell me which of these will share 
> sub-interpreters and why?
> Based on my preliminary observations it seems to me that only (1) and 
> (4) end up sharing.  Would that make sense to you?
> 	Stefan
> _______________________________________________
> Mod_python mailing list
> Mod_python at modpython.org
> http://mailman.modpython.org/mailman/listinfo/mod_python

More information about the Mod_python mailing list