You are viewing a plain text version of this content. The canonical link for it is here.
Posted to mod_python-dev@quetz.apache.org by Graham Dumpleton <gr...@dscpl.com.au> on 2005/08/14 13:32:17 UTC

Making req.finfo writable.

On 10/08/2005, at 10:36 PM, Nicolas Lehuen wrote:

>
> Second issue is the fact that new mod_python.publisher code uses the
> req.finfo attribute. This may be convenient, but it prevents some cute
> stuff being done in the future.
>
> Actually, I used req.finfo as it allowed me to save a call to  
> os.stat() to check whether
> the requested file existed or not. I can revert back to using  
> os.stat(req.filename) if you prefer.

I note that you aren't using req.finfo any more. Appreciate that. I also
note your comment about whether mod_python.publisher should just
modify req.path_info in place. I'll have a think about that one. :-)

Have had a bit of a think about req.finfo in general and have come to  
the
conclusion that since req.filename is writable, that req.finfo must  
also be
writable.

The reason for this is that if req.filename is changed but req.finfo  
isn't at
least set to None, then they will be referring to different files.  
Ie., the
following will not be the same if someone changes req.filename.

   req.filename
   req.finfo[apache.FINFO_FNAME]

and all the other information that req.finfo refers to would be for a
different file/directory to that referred to by req.filename. This  
could be
an issue where some code relied on these both referring to the same  
file.

In the context of what I am working on where the intent is that  
req.filename
and req.path_info will be modified, I thus should be setting  
req.finfo to None
whenever the value of req.filename is changed, however mod_python does
not currently allow that to be done.

I'll post a JIRA enhancement item about making req.finfo writable with
a patch when I get a chance in the next few days.



Graham