[New-bugs-announce] [issue29144] Implicit namespace packages in Python 3.6

Lumír Balhar report at bugs.python.org
Tue Jan 3 13:27:01 EST 2017

New submission from Lumír Balhar:


I've found a really strange difference between Python 3.5 and 3.6 related to namespace packages and I cannot find any note in changelogs.

I've created a simple bash script which can reproduce my issue using virtual environments: http://pastebin.com/j3fXMtR4

This script creates a virtual environment, installs marrow.util from PyPI which is one part of namespace package and creates the other part (marrow.mailer) in the local folder. Then script tries to import marrow.util and marrow.mailer - and there is the difference.

In Python 3.5 - I can import marrow.util (installed via pip) but I cannot import local marrow.mailer module. I think that this is right behavior.
In Python 3.6 - I cannot import marrow.util (installed via pip) but I can import local marrow.mailer module.

Python versions are 3.5.2 (installed from Fedora repositories) and 3.6.0 (compiled manually).

Why there is such a big difference? Am I missing something?

I tried to ask on IRC, stackoverflow etc. but without success. Could you please explain the reason for this behavior to me?

Thank you and have a nice day.

Bash script attached

files: test_namespace_package.sh
messages: 284587
nosy: frenzy
priority: normal
severity: normal
status: open
title: Implicit namespace packages in Python 3.6
type: behavior
versions: Python 3.6
Added file: http://bugs.python.org/file46129/test_namespace_package.sh

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list