bzr: ERROR: 'module' object has no attribute '__path__'

Lalo Martins lalo at
Sun Aug 28 01:15:32 BST 2005

And so says Matthieu Moy on 28/08/05 06:24...
> Hi,
> I get the following when running "bzr plugins":
> bzr: ERROR: 'module' object has no attribute '__path__'

hmm.  Someone copy-pasted from too fast :-)  modules don't
have __path__, only packages do.

This fixes it:
*** modified file 'bzrlib/'
--- bzrlib/
+++ bzrlib/
@@ -1669,7 +1669,15 @@
         from inspect import getdoc
         from pprint import pprint
         for plugin in bzrlib.plugin.all_plugins:
-            print plugin.__path__[0]
+            if hasattr(plugin, '__path__'):
+                # package
+                print plugin.__path__[0]
+            elif hasattr(plugin, '__file__'):
+                # normal module
+                print plugin.__file__
+            else:
+                # some kind of weirdness... not sure how it got here
+                print repr(plugin)
             d = getdoc(plugin)
             if d:
                 print '\t', d.split('\n')[0]

                                               Lalo Martins
      So many of our dreams at first seem impossible,
       then they seem improbable, and then, when we
       summon the will, they soon become inevitable.
--                  mailto:lalo at
GNU: never give up freedom       

More information about the bazaar mailing list