From jira@apache.org Fri Mar 17 04:17:29 2006 Return-Path: Mailing-List: contact python-dev-help@httpd.apache.org; run by ezmlm Delivered-To: mailing list python-dev@httpd.apache.org Received: (qmail 24448 invoked by uid 99); 17 Mar 2006 04:17:29 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 Mar 2006 20:17:29 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [192.87.106.226] (HELO ajax.apache.org) (192.87.106.226) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 Mar 2006 20:17:29 -0800 Received: from ajax (localhost.localdomain [127.0.0.1]) by ajax.apache.org (Postfix) with ESMTP id 0A6C2D49FD for ; Fri, 17 Mar 2006 04:17:07 +0000 (GMT) Message-ID: <1125103714.1142569027693.JavaMail.jira@ajax> Date: Fri, 17 Mar 2006 04:17:07 +0000 (GMT) From: "Graham Dumpleton (JIRA)" To: python-dev@httpd.apache.org Subject: [jira] Resolved: (MODPYTHON-113) PythonImport should use apache.import_module() and not PyImport_ImportModule(). In-Reply-To: <294995726.1138259350051.JavaMail.jira@ajax.apache.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ http://issues.apache.org/jira/browse/MODPYTHON-113?page=all ] Graham Dumpleton resolved MODPYTHON-113: ---------------------------------------- Fix Version: 3.3 Resolution: Fixed > 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 > Fix For: 3.3 > 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 though 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 -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira