[Insight-developers] Python Module Names Cause Havoc, news at 11

Charl P. Botha c . p . botha at ewi . tudelft . nl
18 Dec 2003 14:55:35 +0100


Dear list,

Python imports are usually case sensitive where possible[1].  However,
on filesystems like FAT32, this is not possible.  This poses problems
with ITK Python modules such as itkcommon.py because there are also DLLs
such as ITKCommon.dll.

This means that e.g. an "import itkcommon.py" on a case-insensitive
filesystem (such as FAT32, still used even with Windows 2000 and XP),
depending on the formulation of the PYTHONPATH and PATH, can result in
Python attempting to import ITKCommon.dll and failing miserably.

The problems just get more hairy when one packs an ITK-using Python
application with something like the McMillan Installer.

I propose that the ITK Python modules follow VTK's example and are
renamed from e.g. itkcommon.py to itkCommonPython, itkbase.py to
itkBasePython.py etc.  Most users won't notice the change, because
InsightToolkit.py takes care of all these imports.

Any thoughts on this?

Thanks,
Charl

[1] http://www . python . org/peps/pep-0235 . html

-- 
charl p. botha http://cpbotha . net/ http://visualisation . tudelft . nl/