This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author andrea.crotti
Recipients andrea.crotti, eric.araujo, tarek
Date 2012-02-10.20:53:22
SpamBayes Score 1.662559e-12
Marked as misclassified No
Message-id <1328907203.29.0.677752935093.issue13991@psf.upfronthosting.co.za>
In-reply-to
Content
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?
History
Date User Action Args
2012-02-10 20:53:23andrea.crottisetrecipients: + andrea.crotti, tarek, eric.araujo
2012-02-10 20:53:23andrea.crottisetmessageid: <1328907203.29.0.677752935093.issue13991@psf.upfronthosting.co.za>
2012-02-10 20:53:22andrea.crottilinkissue13991 messages
2012-02-10 20:53:22andrea.crotticreate