[Zope-dev] __before_publishing_traverse__ problem (2 args only)

Tobias Herp therp at apriori.de
Mon Oct 20 09:15:48 EDT 2003


Hi,

I have a Python product which defines a __before_publishing_traverse_ 
method.  At last I thought it would all work fine now...

Now I added one of my User Folder objects and got an exception because 
__before_publishing_traverse__ was called with only two arguments 
instead of three.  Quite curious (because of course I don't call this 
method myself) I had a look at ZPublisher/BaseRequest.py, line 251, and 
noticed it is called there without providing the REQUEST.  When I 
monkeypatched this method to hand over the request as the third 
argument,  Zope complained that the "global name 'UNSPECIFIED_ROLES'" 
was not defined (and nothing worked anywhere anymore).

So should I make the REQUEST an _optional_ argument to my 
__before_publishing_traverse__ method?  But the purpose of my b.p.t. 
method is to remove up to two path elements from 
REQUEST['TraversalRequestNameStack'] and set request variables 
appropriately, so what is the purpose of this call in BaseRequest?  Is 
there an article anywhere which explains the whole topic in an 
understandable way?

Thanks,

Tobias

(Zope 2.6.2,





More information about the Zope-Dev mailing list