[Python-Dev] warnings about missing __init__.py in toplevel directories

Ronald Oussoren ronaldoussoren at mac.com
Sat May 27 00:07:36 CEST 2006


Hi,

Some time ago a warning was introduced for directories on sys.path  
that don't contain an __init__.py but have the same name as a package/ 
module that is being imported.

Is it intentional that this triggers for toplevel imports? These  
warnings are triggered in the build process for PyObjC, which is in  
itself pretty harmless but very annoying.


We have a source-deps directory that contains several external  
packages that are used during the build. Those external packages are  
included through the svn:external mechanism and are in directories  
named after those packages, with a .pth file to include them on  
sys.path. In most cases the package name is the same as the python  
package, which is triggering the warning.

Our package structure:

	setup.py
	source-deps/
		subprocess/
		subprocess.pth # includes subproces on sys.path
		py2app/
		py2app.pth  # includes py2app on sys.path
		...
	... # the regular sources, documentation and stuff

Ronald


More information about the Python-Dev mailing list