superfluous __init__.py generates import errors

Bug #688335 reported by Alan Franzoni on 2010-12-09
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
zope.interface (Ubuntu)
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:

Alan Franzoni (alanfranz) wrote :
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.

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
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  Edit
Everyone can see this information.

Other bug subscribers