[New-bugs-announce] [issue13991] namespace packages depending on order

andrea crotti report at bugs.python.org
Fri Feb 10 21:53:23 CET 2012


New submission from andrea crotti <andrea.crotti.0 at gmail.com>:

I am not really sure that it is a bug, but for me it's at least not the expected behaviour.
In short supposing I have two namespace packages ab and ac (as seen in the tar file), this works perfectly:

import sys
from os import path
sys.path.append(path.abspath('ab'))
sys.path.append(path.abspath('ac'))

from a.b import api as api_ab
from a.c import api as api_ac


But this doesn't:
import sys
from os import path
sys.path.append(path.abspath('ab'))

from a.b import api as api_ab

sys.path.append(path.abspath('ac'))
from a.c import api as api_ac

And raises an ImportError
from a.c import api as api_ac
ImportError: No module named c

Which means that if you actually append all the paths containing package resources before trying to import something it works, but if you interleave the path mangling, it won't..

Is this a bug or maybe I'm doing something wrong?

----------
assignee: tarek
components: Distutils
files: namespace.tar.gz
messages: 153076
nosy: andrea.crotti, eric.araujo, tarek
priority: normal
severity: normal
status: open
title: namespace packages depending on order
versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2
Added file: http://bugs.python.org/file24478/namespace.tar.gz

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue13991>
_______________________________________


More information about the New-bugs-announce mailing list