A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2005-November/057959.html below:

[Python-Dev] Inconsistent behaviour in import/zipimport hooks

[Python-Dev] Inconsistent behaviour in import/zipimport hooks [Python-Dev] Inconsistent behaviour in import/zipimport hooksOsvaldo 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

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4