Installing python-nevow breaks twisted trial

Bug #410098 reported by Shawn Willden
50
This bug affects 6 people
Affects Status Importance Assigned to Milestone
Tahoe-LAFS
New
Unknown
nevow
Invalid
Undecided
Unassigned
nevow (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

After installing python-nevow, the "trial" test utility provided by python-twisted-core fails with the following error message:

Traceback (most recent call last):
  File "/usr/bin/trial", line 23, in <module>
    from twisted.scripts.trial import run
ImportError: No module named scripts.trial

Investigation reveals that the culprit is an empty "__init__.py" file generated by the nevow installation. This file is placed in /var/lib/python-support/python2.5/twisted/plugins. The existence of that file breaks twisted's plugin finding approach and causes it to fail to find the twisted.scripts package, which is actually located at /usr/share/pyshared/twisted/scripts.

I can't see how this file gets generated

Source package: nevow
Ubuntu release: Ubuntu 8.04.3 LTS
Package versions: python-nevow: 0.9.26-1, python-twisted-core: 2.5.0-2build2, python2.5: 2.5.2-2ubuntu6

Revision history for this message
Nicola Ferralis (feranick) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. This bug did not have a package associated with it, which is important for ensuring that it gets looked at by the proper developers. You can learn more about finding the right package at https://wiki.ubuntu.com/Bugs/FindRightPackage. I have classified this bug as a bug in nevow.

When reporting bugs in the future please use apport, either via the appropriate application's "Help -> Report a Problem" menu or using 'ubuntu-bug' and the name of the package affected. You can learn more about this functionality at https://wiki.ubuntu.com/ReportingBugs.

affects: ubuntu → nevow (Ubuntu)
Revision history for this message
Zooko Wilcox-O'Hearn (zooko) wrote :

According to http://allmydata.org/pipermail/tahoe-dev/2009-August/002551.html this situation with the bogus __init__.py file doesn't cause a problem as long as the correct "twisted" directory appears earlier on the PYTHONPATH.

My own personal experience with this bug required me to run "sudo /bin/rm /var/lib/python-support/python2.5/twisted/__init__.py" in order to work-around the problem. The same situation arose for a couple of other users of the Tahoe-LAFS app (which uses Twisted and Nevow).

Changed in nevow:
importance: Unknown → Undecided
status: Unknown → New
Revision history for this message
Zooko Wilcox-O'Hearn (zooko) wrote :

I may have confused the issue originally reported by Shawn Willden with this issue that I experience in Tahoe-LAFS: http://allmydata.org/trac/tahoe/ticket/806 .

Shawn reported that he traced the problem to an empty __init__.py file that is written into /var/lib/python-support/python2.5/twisted/plugins . But Tahoe-LAFS's problem is that an empty __init__.py is written into /var/lib/python-support/python2.5/twisted/__init__.py . I'm not entirely sure that it was the installation of nevow that did it, either. Are these two manifestations of the same problem, or two different problems?

See also http://article.gmane.org/gmane.comp.python.distutils.devel/7409 in which Josselin Mouette <joss <at> debian.org> seems to say that Twisted and/or Nevow should change the way they do things to avoid this bug. Is this bug in one of those awful "stalemates" that arise in open source where two different developers each refuse to change the way they do things, with the result that users who want to use both open source tools together have to work-around the breakage?

Revision history for this message
Scott Kitterman (kitterman) wrote :

Should be fixed in nevow (0.10.0-1) unstable; urgency=low.

Changed in nevow (Ubuntu):
status: New → Fix Released
Changed in tahoe-lafs:
status: Unknown → New
Revision history for this message
Zooko Wilcox-O'Hearn (zooko) wrote :

Scott: do you remember what the fix was that went into nevow 0.10.0-1? I'm working with a user who has a similar problem -- they have the python-twisted-web package installed in Lucid, but "import twisted.web" gets an import error after getting twisted from /usr/lib/python2.6/dist-packages/twisted/__init__.py. There are symlinks in /usr/lib/python2.6/dist-packages/twisted/ pointing to pyshared for *some* of the things that live in the namespace "twisted" but not for "web". We haven't yet fully narrowed down whether this is a bug in Ubuntu itself or if we manually edited part of the system or what. It might help if we knew what the change was in nevow that (presumably) should still be present in the Lucid version of nevow. Thanks!

Revision history for this message
Scott Kitterman (kitterman) wrote : Re: [Bug 410098] Re: Installing python-nevow breaks twisted trial

Not sure. Maybe http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=521663 ?

"Zooko O'Whielacronx" <email address hidden> wrote:

>Scott: do you remember what the fix was that went into nevow 0.10.0-1?
>I'm working with a user who has a similar problem -- they have the
>python-twisted-web package installed in Lucid, but "import twisted.web"
>gets an import error after getting twisted from
>/usr/lib/python2.6/dist-
>packages/twisted/__init__.py. There are symlinks in /usr/lib/python2.6
>/dist-packages/twisted/ pointing to pyshared for *some* of the things
>that live in the namespace "twisted" but not for "web". We haven't yet
>fully narrowed down whether this is a bug in Ubuntu itself or if we
>manually edited part of the system or what. It might help if we knew
>what the change was in nevow that (presumably) should still be present
>in the Lucid version of nevow. Thanks!
>
>--
>You received this bug notification because you are a direct subscriber
>of the bug.
>https://bugs.launchpad.net/bugs/410098
>
>Title:
> Installing python-nevow breaks twisted trial
>
>Status in Divmod Nevow:
> New
>Status in Tahoe, the Lovely Accessible File System:
> New
>Status in “nevow” package in Ubuntu:
> Fix Released
>
>Bug description:
>After installing python-nevow, the "trial" test utility provided by
>python-twisted-core fails with the following error message:
>
>Traceback (most recent call last):
> File "/usr/bin/trial", line 23, in <module>
> from twisted.scripts.trial import run
>ImportError: No module named scripts.trial
>
>Investigation reveals that the culprit is an empty "__init__.py" file
>generated by the nevow installation. This file is placed in
>/var/lib/python-support/python2.5/twisted/plugins. The existence of
>that file breaks twisted's plugin finding approach and causes it to
>fail to find the twisted.scripts package, which is actually located at
>/usr/share/pyshared/twisted/scripts.
>
>I can't see how this file gets generated
>
>Source package: nevow
>Ubuntu release: Ubuntu 8.04.3 LTS
>Package versions: python-nevow: 0.9.26-1, python-twisted-core:
>2.5.0-2build2, python2.5: 2.5.2-2ubuntu6
>
>To unsubscribe from this bug, go to:
>https://bugs.launchpad.net/nevow/+bug/410098/+subscribe

Revision history for this message
Jean-Paul Calderone (exarkun) wrote :

Only an Ubuntu packaging bug, as far as I can tell.

Changed in nevow:
status: New → Invalid
Revision history for this message
Daira Hopwood (daira) wrote :
Revision history for this message
Daira Hopwood (daira) wrote :

... and I don't think it is the same bug as http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=521663 .

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

Duplicates of this bug

Other bug subscribers

Remote bug watches

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