[Python-Dev] Inconsistent behaviour in import/zipimport hooks
Osvaldo Santana Neto
osantana at gmail.com
Wed Nov 9 03:33:47 CET 2005
Hi,
I'm working on Python[1] port for Maemo Platform[2] and I've found a
inconsistent behavior in zipimport and import hook with '.pyc' and
'.pyo' files. The shell section below show this problem using a
'module_c.pyc', 'module_o.pyo' and 'modules.zip' (with module_c and
module_o inside):
$ ls
module_c.pyc module_o.pyo modules.zip
$ python
>>> import module_c
>>> import module_o
ImportError: No module named module_o
$ python -O
>>> import module_c
ImportError: No module named module_c
>>> import module_o
$ rm *.pyc *.pyo
$ PYTHONPATH=modules.zip python
>>> import module_c
module_c
>>> import module_o
module_o
$ PYTHONPATH=modules.zip python -O
>>> import module_c
module_c
>>> import module_o
module_o
I've create a patch suggestion to remove this inconsistency[3] (*I* think
zipimport behaviour is better).
[1] http://pymaemo.sf.net/
[2] http://www.maemo.org/
[3] http://python.org/sf/1346572
--
Osvaldo Santana Neto (aCiDBaSe)
icq, url = (11287184, "http://www.pythonbrasil.com.br")
More information about the Python-Dev
mailing list