Apache Mod-Python - Updated: (MODPYTHON-113) PythonImport should use

This is Interesting: Free IT Magazines  
Home > Archive > Apache Mod-Python > March 2006 > Updated: (MODPYTHON-113) PythonImport should use





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Updated: (MODPYTHON-113) PythonImport should use
Graham Dumpleton (JIRA)

2006-03-16, 7:45 am

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

Graham Dumpleton updated MODPYTHON-113:
---------------------------------------

Attachment: MP113_20060316_grahamd_1.diff

Attached "MP113_20060316_grahamd_1.diff" containing proposed changes. This also includes changes to implement MODPYTHON-118.

The problem covered by this issue needs to be addressed, but changes for MODPYTHON-118 are optional and can be left out if anyone objects.

Feedback appreciated.

> PythonImport should use apache.import_module() and not PyImport_ImportModule().
> -------------------------------------------------------------------------------
>
> 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
> Attachments: MP113_20060316_grahamd_1.diff
>
> When the "PythonImport" directive is used, mod_python uses the "PyImport_ImportModule()" function to import the specified module. If that same module is later imported using the "apache.import_module()" function, it will be reloaded a second time even t

hough the Python module file hadn't changed and even if "PythonAutoReload" is set to "Off".
> This reloading can cause problems if the module when loaded using PythonImport 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 properly 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 system implemented by mod_python. The best solution now and in the future, would be for the "PythonImport" directive to use the "apache.import_module()" function to import

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


Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com