Work started: (MODPYTHON-155) req.add_handler() and
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > Apache Server configuration support > Apache Mod-Python > Work started: (MODPYTHON-155) req.add_handler() and




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Work started: (MODPYTHON-155) req.add_handler() and  
Graham Dumpleton (JIRA)


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
07-30-06 06:13 AM

[ http://issues.apache.org/jira/brows...ON-155?page=all ]

Work on MODPYTHON-155 started by Graham Dumpleton.

> req.add_handler() and inheritance of directory to be searched for module
> ------------------------------------------------------------------------
>
>                 Key: MODPYTHON-155
>                 URL: http://issues.apache.org/jira/browse/MODPYTHON-155
>             Project: mod_python
>          Issue Type: Sub-task
>          Components: importer
>            Reporter: Graham Dumpleton
>         Assigned To: Graham Dumpleton
>
> The documentation for req.add_handler() says:
> """Optional dir is a string containing the name of the directory to be added to th
e pythonpath. If no directory is specified, then, if there is already a handler of t
he same type specified, its directory is inherited, otherwise the directory of the p
res
ently executing handler is used. I there is a PythonPath directive in effect, then sys.path 
will be set exactly according to it (no directories added, the dir argument is ignored)."""[
vbcol=seagreen]
> This comment about the directory being inherited from the prior or currently execu
ting handler is actually bogus as the code does not do anything specific at all to t
ry and implement such behaviour. If it works this way at all it is partly by luck as
 wh[/vbcol]
at will actually dictate where the module specified to the req.add_handler()
 method is found is the current order of directories specified in sys.path. 
Since additional directories added into sys.path by the old importer can be 
performed in effectively ra
ndom order, behaviour could actually be quite random if the same module name were used in mu
ltiple directories.
> Because the new importer doesn't add directories into sys.path for Python*Handler 
directives, a problem will currently arise if no directory is supplied to req.add_ha
ndler(). Specifically, a module may not be able to be found. This is because it can 
no
longer fall back on to fact that with old module importer, the directory corresponding to th
e Python*Handler directive would be listed in sys.path somewhere.
> Thus, the documented behaviour for req.add_handler() when the directory hasn't bee
n set needs to actually be implemented as described with an appropriate directory be
ing calculated at the time that req.add_handler() is called with that directory bein
g r
ecorded as needing to be searched for the module. In changing the code thoug
h, if old and new importers are going to be supported during a transition ph
ase, it must detect when the new module importer is being used and only do t
his when it is, as otherwis
e it will screw up how modules are found for the old importer.






[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 09:11 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register