06-29-07 06: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 inse
nsitive 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 c
an 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 cas
e an error would occur. On a system with a case insensitive file system howe
ver, various combinations of characters in a URL, upper or lower case, may m
atch 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 i
ndex into the module cache. With different combinations of upper and lower c
ase, the end result will be
that there could be multiple versions of the same module loaded into the pro
cess. 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 ca
se 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 ev
ent that a case sensitive f
ile system is used.
[ Post a follow-up to this message ]
|