==== Everything works ==== laga@prometheus:/tmp$ python2.5 Python 2.5.2 (r252:60911, Apr 8 2008, 21:47:16) [GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path.append('/usr/lib/python%s/site-packages/oldxml' % sys.version[:3]) >>> from xml.dom.ext.reader import HtmlLib >>> ==== Raise an unrelated exception. the import breaks ==== laga@prometheus:/tmp$ python2.5 Python 2.5.2 (r252:60911, Apr 8 2008, 21:47:16) [GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> raise NameError Traceback (most recent call last): File "", line 1, in NameError >>> import sys >>> sys.path.append('/usr/lib/python%s/site-packages/oldxml' % sys.version[:3]) >>> from xml.dom.ext.reader import HtmlLib Traceback (most recent call last): File "", line 1, in ImportError: No module named ext.reader >>> ==== PYTHON 2.4 ==== ==== All is well==== laga@prometheus:/tmp$ python2.4 Python 2.4.5 (#2, Mar 12 2008, 15:21:25) [GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu4)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path.append('/usr/lib/python%s/site-packages/oldxml' % sys.version[:3]) >>> from xml.dom.ext.reader import HtmlLib >>> ==== Raise unrelated Error, everything still works ==== laga@prometheus:/tmp$ python2.4 Python 2.4.5 (#2, Mar 12 2008, 15:21:25) [GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu4)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> raise NameError Traceback (most recent call last): File "", line 1, in ? NameError >>> import sys >>> sys.path.append('/usr/lib/python%s/site-packages/oldxml' % sys.version[:3]) >>> from xml.dom.ext.reader import HtmlLib >>> ===== Output of sys.path ===== ===== working python 2.4 ===== ['', '/usr/lib/python24.zip', '/usr/lib/python2.4', '/usr/lib/python2.4/plat-linux2', '/usr/lib/python2.4/lib-tk', '/usr/lib/python2.4/lib-dynload', '/usr/local/lib/python2.4/site-packages', '/usr/lib/python2.4/site-packages', '/usr/lib/python2.4/site-packages/Numeric', '/usr/lib/python2.4/site-packages/PIL', '/usr/lib/python2.4/site-packages/gst-0.10', '/var/lib/python-support/python2.4', '/usr/lib/python2.4/site-packages/gtk-2.0', '/var/lib/python-support/python2.4/gtk-2.0', '/usr/lib/python2.4/site-packages/oldxml'] ===== python 2.5 ===== ['', '/usr/lib/python25.zip', '/usr/lib/python2.5', '/usr/lib/python2.5/plat-linux2', '/usr/lib/python2.5/lib-tk', '/usr/lib/python2.5/lib-dynload', '/usr/local/lib/python2.5/site-packages', '/usr/lib/python2.5/site-packages', '/usr/lib/python2.5/site-packages/Numeric', '/usr/lib/python2.5/site-packages/PIL', '/usr/lib/python2.5/site-packages/gst-0.10', '/var/lib/python-support/python2.5', '/usr/lib/python2.5/site-packages/gtk-2.0', '/var/lib/python-support/python2.5/gtk-2.0', '/usr/lib/python2.5/site-packages/oldxml']