Opened 11 years ago

Closed 8 years ago

#2039 closed defect (fixed)

AttributeError: type object 'Mimeview' has no attribute '_implements'

Reported by: Christian Boos Owned by: Alec Thomas
Priority: normal Component: TracDeveloperPlugin
Severity: minor Keywords:
Cc: Trac Release: 0.11


I didn't look closely at the code, but I guess [trac 5936] broke the plugin.

How to Reproduce

While doing a GET operation on /admin/developer/plugins, Trac issued an internal error.

Request parameters:

{'cat_id': u'developer', 'panel_id': u'plugins', 'path_info': None}

System Information

Trac 0.11dev-r6000
Python 2.4.2 (#67, Oct 30 2005, 16:11:18) [MSC v.1310 32 bit (Intel)]
setuptools 0.7a1
SQLite 3.3.10
pysqlite 2.3.3
Genshi 0.5dev-r656
Subversion 1.4.4 (r25188)

Python Traceback

Traceback (most recent call last):
  File "C:\Workspace\src\trac\repos\trunk\trac\web\", line 381, in dispatch_request
  File "C:\Workspace\src\trac\repos\trunk\trac\web\", line 191, in dispatch
    resp = chosen_handler.process_request(req)
  File "C:\Workspace\src\trac\repos\trunk\trac\admin\", line 108, in process_request
  File "c:\workspace\src\trac\plugins\tracdeveloperplugin\tracdeveloper\", line 22, in render_admin_panel
    data = self.get_api(req)
  File "c:\workspace\src\trac\plugins\tracdeveloperplugin\tracdeveloper\", line 68, in get_api
    impl = [interfaces['%s.%s' % (i.__module__, i.__name__)]
AttributeError: type object 'Mimeview' has no attribute '_implements'

Attachments (0)

Change History (4)

comment:1 Changed 11 years ago by Christian Boos

Well, actually this had nothing to do with [T5936], simply with the fact that there are components that don't "implement" anything (this happens, e.g. when they simply provide an extension point).

Fix is trivial:

Index: tracdeveloper/
--- tracdeveloper/    (revision 2294)
+++ tracdeveloper/    (working copy)
@@ -65,8 +65,10 @@

         components = {}
         for component in [c.__class__ for c in self.env.components.values()]:
-            impl = [interfaces['%s.%s' % (i.__module__, i.__name__)]
-                          for i in component._implements]
+            impl = []
+            if hasattr(component, '_implements'):
+                impl = [interfaces['%s.%s' % (i.__module__, i.__name__)]
+                        for i in component._implements]
             interface_methods = [m['name'] for i in impl for m in i['methods']]
             methods = self.extract_methods(req, component, interface_methods)
             data = self.base_data(req, component)

comment:2 Changed 11 years ago by Alec Thomas

Resolution: fixed
Status: newclosed

(In [2700]) Fixes #2039, thanks Christian.

comment:3 Changed 10 years ago by Christian Boos

Resolution: fixed
Severity: majorminor
Status: closedreopened

I just checked the ticket to see if you applied the patch and:

  • I don't remember having received a mail about the previous change - strange. My e-mail is set though.
  • you forgot the first + line: impl = [] ;-)

Let's see if I'll get notified this time.

comment:4 Changed 8 years ago by anatoly techtonik

Resolution: fixed
Status: reopenedclosed

Seems like you hadn't. =) In the meanwhile your last comment was subject for #2147 that was fixed in [2737]. Closing.

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain Alec Thomas.
The resolution will be deleted.

Add Comment

E-mail address and name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.