[New-bugs-announce] [issue31280] Namespace packages in directories added to path aren't importable if packages from the same namespace are in site-packages

Jim Fulton report at bugs.python.org
Fri Aug 25 17:53:30 EDT 2017


New submission from Jim Fulton:

I'm having an issue importing from namespaces packages whose directories are added to sys.path and have other packages from the same namespace in site-packages.

To reproduce:

- Create a virtualenv and install zc.buildout in it (``envdir/bin/pip install zc.buildout``).

- Run the attached script with the virtual environment (``envdir/bin/python z.py``).

Note that scenarios like https://www.python.org/dev/peps/pep-0420/#id3 work fine.  This seems to related to having namespace packages in site-packages, or, presumably anywhere on the default path.

I've verified this with Python 3.4, 3.5, and 3.6.

If y'all agree that this is a bug, then I'll attempt debug it and come up with a PR.

----------
messages: 300856
nosy: j1m
priority: normal
severity: normal
status: open
title: Namespace packages in directories added to path aren't importable if packages from the same namespace are in site-packages
versions: Python 3.4, Python 3.5, Python 3.6

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


More information about the New-bugs-announce mailing list