superfluous __init__.py generates import errors

Bug #688335 reported by Alan Franzoni
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
zope.interface (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

The zope.interface package is manually copying __init__.py from sources to the "zope" directory. This should NOT be done when a nspkg.pth is installed for the package, as it is correctly done.

Although this does not seem to provoke issues at a first glance, it's what provokes two hard-to-track issues with zc.buildout:

https://bugs.launchpad.net/zc.buildout/+bug/685638
https://bugs.launchpad.net/zc.buildout/+bug/659231

if you check other zope.* packages in debian/ubuntu, you'll see none of them manually copy __init__.py .

Full discussion here:

http://mail.python.org/pipermail/distutils-sig/2010-December/017127.html

Patch attached. I'll open a bug in Debian ASAP:

Revision history for this message
Alan Franzoni (alanfranz) wrote :
Revision history for this message
Brian Sutherland (jinty) wrote :

This __init__.py is included because it causes other breakage if removed. Please see a previous discussion on removing this:

     https://bugs.launchpad.net/van.pydeb/+bug/619294

That bug contains a test case which fails when the __init__.py is removed.

Background reading on the breakage:

     http://mail.python.org/pipermail/distutils-sig/2009-May/011730.html

Consistency in what is broken is probably more important than fixing one thing only to break another;) So I'd rather we didn't try fix this until the test case in the van.pydeb bug passes without the __init__.py.

Revision history for this message
Brian Sutherland (jinty) wrote :

In discussion on distutils-sig it was decided that having the zope/__init__.py available is the right thing to do and will be standard in dh_python2 in future. So this is not a bug.

Also the OP discovered that the bug really biting him was https://bugs.launchpad.net/ubuntu/+source/distribute/+bug/576434

Changed in zope.interface (Ubuntu):
status: New → Invalid
Revision history for this message
Edwin Grubbs (edwin-grubbs) wrote :

This can also cause pam-motd to stop updating /var/run/motd. The /etc/update-motd.d/50-landscape-sysinfo script calls /usr/bin/landscape-sysinfo which has an ImportError that is caught silently and returns a non-zero exit code.

https://bugs.launchpad.net/ubuntu/+source/pam/+bug/661654

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.