Work started: (MODPYTHON-113) PythonImport should use
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-113) PythonImport should use




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

    Work started: (MODPYTHON-113) PythonImport should use  
Graham Dumpleton (JIRA)


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


 
03-11-06 01:45 AM

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

Work on MODPYTHON-113 started by Graham Dumpleton

> PythonImport should use apache.import_module() and not PyImport_ImportModu
le().
> --------------------------------------------------------------------------
-----
>
>          Key: MODPYTHON-113
>          URL: http://issues.apache.org/jira/browse/MODPYTHON-113
>      Project: mod_python
>         Type: Bug
>   Components: core
>     Versions: 3.1.4, 3.2.7
>     Reporter: Graham Dumpleton
>     Assignee: Graham Dumpleton

>
> When the "PythonImport" directive is used, mod_python uses the "PyImport_ImportMod
ule()" function to import the specified module. If that same module is later importe
d using the "apache.import_module()" function, it will be reloaded a second time eve
n t
hough the Python module file hadn't changed and even if "PythonAutoReload" is set to "Off".[
vbcol=seagreen]
> This reloading can cause problems if the module when loaded using PythonIm
port had setup resources such as database connections etc. This is because "
apache.import_module()" will effectively throw away the existing values
> and replace them. This can be an issue if the resources aren't deleted pro
perly and hold open stuff like socket connections with those connections no 
longer being accessible or useable.
> The basic problem here is the mixing of standard Python import mechanism and any s
ystem implemented by mod_python. The best solution now and in the future, would be f
or the "PythonImport" directive to use the "apache.import_module()" function to impo
rt[/vbcol]
any modules. That way it would be ensured they always work together properly and not against
 each other.
> Note that this problem was previously catalogued as ISSUE 17 on my list of
 mod_python module importing problems. This list of problems can be found at
:
>   http://www.dscpl.com.au/articles/modpython-003.html






[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 12:56 AM.      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