[Zope3-checkins] SVN: Zope3/trunk/src/zope/app/apidoc/classmodule/browser.py Fixed the SystemError when the user tries to view all subclasses of Persistent

Marius Gedminas marius at pov.lt
Mon Jul 19 13:09:02 EDT 2004


Log message for revision 26633:
  Fixed the SystemError when the user tries to view all subclasses of Persistent
  and object in the apidoc class browser.
  
  


Changed:
  U   Zope3/trunk/src/zope/app/apidoc/classmodule/browser.py


-=-
Modified: Zope3/trunk/src/zope/app/apidoc/classmodule/browser.py
===================================================================
--- Zope3/trunk/src/zope/app/apidoc/classmodule/browser.py	2004-07-19 14:56:53 UTC (rev 26632)
+++ Zope3/trunk/src/zope/app/apidoc/classmodule/browser.py	2004-07-19 17:09:02 UTC (rev 26633)
@@ -467,10 +467,12 @@
         info = []
         classModule = zapi.getUtility(IDocumentationModule, "Class")
         for cls in classes:
-            # XXX Certain classes cause the following line to raise an
-            #     exception.  The easiest way to reproduce the problem is to
-            #     go to /++apidoc++/Class/__builtin__/object/index.html
-            path = getPythonPath(cls)
+            # We need to removeAllProxies because the security checkers for
+            # zope.app.container.contained.ContainedProxy and
+            # zope.app.i18n.messagecatalog.MessageCatalog prevent us from
+            # accessing __name__ and __module__.
+            unwrapped_cls = removeAllProxies(cls)
+            path = getPythonPath(unwrapped_cls)
             try:
                 klass = zapi.traverse(classModule, path.replace('.', '/'))
                 url = zapi.getView(klass, 'absolute_url', self.request)()



More information about the Zope3-Checkins mailing list