| Graham Dumpleton (JIRA) 2007-06-29, 1:13 am |
| Module importer doesn't deal with case insensitive file systems properly.
-------------------------------------------------------------------------
Key: MODPYTHON-230
URL: https://issues.apache.org/jira/browse/MODPYTHON-230
Project: mod_python
Issue Type: Bug
Components: importer
Affects Versions: 3.3.1
Reporter: Graham Dumpleton
As highlighted in:
http://www.modpython.org/pipermail/...May/023603.html
the module importer in mod_python 3.3.1 doesn't cope properly with case insensitive file systems such as on Windows and MacOS X platforms.
Problem is that part of a URL may be used in constructing the actual path of a Python code file to be loaded by the module importer. As such, the user can dictate what the case of characters used in the physical file path may be. On a case sensitive file
system this is not a problem because if the file doesn't exist with that case an error would occur. On a system with a case insensitive file system however, various combinations of characters in a URL, upper or lower case, may match a physical file. The a
ctual problem now is that the module importer will take the path exactly as given and use it to construct a dummy module name and further uses that to index into the module cache. With different combinations of upper and lower case, the end result will be
that there could be multiple versions of the same module loaded into the process. This could cause problems where the module has globa
l data that is updated and consulted from one request to the next.
On Windows and MacOS X systems, the _module_label() function should lower case the path name before generating the module name key. An option should be provided however to override this behaviour on Windows and MacOS X in the event that a case sensitive f
ile system is used.
|