[Zope-dev] Re: ZDebug questions

Shane Hathaway shane@digicool.com
Wed, 06 Sep 2000 10:06:54 -0400


Chris Withers wrote:
> Using your sample 'bad' DTML, I got the same but the 'Contains name?'
> column didn't show up :-(
> 
> Any ideas? (yes, I was tracking down a security exception, and that
> column may have been really useful ;-)

My guess is you're using Zope 2.1.6.  ZDebug doesn't have a way to
figure out what DTML method is being called in Zope 2.1.6.  Strange but
true.  So it shows what it can.  The 2.2.x security context stack is
used to figure it out in 2.2.x.  (Which is still a hack. :-/ )

> ...speaking of which, this is related to the following PTK Tracker
> Issue:
> 
> http://www.zope.org/Products/PTK/Tracker/110
> 
> while Andy and I were playing with some stuff, we managed to make ZDebug
> cry by giving the discussion_thread_view DTML method the 'Member' proxy
> role and then viewing it from a Member's toolbox (what's the new name
> for that?) on the left:
> 
> Error Type: TypeError
> Error Value: not all arguments converted

Oops!  Try this patch (I left out a "%s"):

===================================================================
RCS file:
/cvs-repository/Packages/Products/ZDebug/DebugSecurityPolicy.py,v
retrieving revision 1.2
diff -u -r1.2 DebugSecurityPolicy.py
--- DebugSecurityPolicy.py      2000/09/04 19:23:58     1.2
+++ DebugSecurityPolicy.py      2000/09/06 14:04:32
@@ -234,8 +234,8 @@
                         info = 'The proxy roles set for ' \
                                '%s do not allow access to %s, which is
' \
                                'contained in %s. The proxy roles would
' \
-                               'have to include one of the following
roles:' \
-                               % (
+                               'have to include one of the following '
\
+                               'roles: %s' % (
                             getCleanPath(eo), cleanupName(name,
value),
                             getCleanPath(container, value),
                             tuple(roles))

> Well, thanks for the product, it looks like being _extremely_ useful
> :-))

Thank you.  I know when I was new to Zope this would have been
tremendously useful.  Now it's useful because it should help people
solve problems on their own rather than having to post to the list.

Shane