2.7 assertion with CVS of this morning
I refreshed my 2.7 from CVS this morning (7.30 MEZ) and get the following traceback: Robert Site Error An error was encountered while publishing this resource. TypeError Sorry, a site error occurred. Traceback (innermost last): * Module ZPublisher.Publish, line 163, in publish_module_standard * Module Products.PlacelessTranslationService.PatchStringIO, line 45, in new_publish * Module ZPublisher.Publish, line 127, in publish * Module Zope.App.startup, line 203, in zpublisher_exception_hook * Module ZPublisher.Publish, line 100, in publish * Module ZPublisher.mapply, line 88, in mapply * Module ZPublisher.Publish, line 40, in call_object * Module Shared.DC.Scripts.Bindings, line 261, in __call__ * Module Shared.DC.Scripts.Bindings, line 292, in _bindAndExec * Module App.special_dtml, line 175, in _exec * Module DocumentTemplate.DT_Let, line 75, in render * Module DocumentTemplate.DT_Util, line 201, in eval __traceback_info__: _ * Module <string>, line 0, in ? TypeError: guarded_hasattr() takes exactly 2 arguments (3 given) (Also, an error occurred while attempting to render the standard error message.)
robert wrote:
I refreshed my 2.7 from CVS this morning (7.30 MEZ) and get the following traceback:
This is my bad, I'm pretty sure. Was this just trying to get into the ZMI, or was there another application / template which triggered the problem? At any rate, the fix is likely to be to add 'guarded_hasattr' to the list of items which should be wrapped; on the 2.7 branch, this list is at the bottom of AccessControl.Implementation.
Robert
Site Error
An error was encountered while publishing this resource.
TypeError Sorry, a site error occurred.
Traceback (innermost last):
* Module ZPublisher.Publish, line 163, in publish_module_standard * Module Products.PlacelessTranslationService.PatchStringIO, line 45, in new_publish * Module ZPublisher.Publish, line 127, in publish * Module Zope.App.startup, line 203, in zpublisher_exception_hook * Module ZPublisher.Publish, line 100, in publish * Module ZPublisher.mapply, line 88, in mapply * Module ZPublisher.Publish, line 40, in call_object * Module Shared.DC.Scripts.Bindings, line 261, in __call__ * Module Shared.DC.Scripts.Bindings, line 292, in _bindAndExec * Module App.special_dtml, line 175, in _exec * Module DocumentTemplate.DT_Let, line 75, in render * Module DocumentTemplate.DT_Util, line 201, in eval __traceback_info__: _ * Module <string>, line 0, in ?
TypeError: guarded_hasattr() takes exactly 2 arguments (3 given) (Also, an error occurred while attempting to render the standard error message.)
Tres. -- =============================================================== Tres Seaver tseaver@zope.com Zope Corporation "Zope Dealers" http://www.zope.com
Hi Tres, Adding 'guarded_hasattr' to the list of items wrapped items did not help. I do not really understand what happens. I added a third parameter to (in ZopeGuards.py) def guarded_hasattr(object, name, xx=None): if xx: print 'xx->', xx try: guarded_getattr(object, name) except (AttributeError, Unauthorized): return 0 return 1 Now whenever I change to a folder, I get xx-> has_order_support printed on the console. I grepped for has_order_support to find out where this happens, but did not find it. Robert On Tuesday 13 January 2004 17:59, Tres Seaver wrote:
robert wrote:
I refreshed my 2.7 from CVS this morning (7.30 MEZ) and get the following traceback:
This is my bad, I'm pretty sure. Was this just trying to get into the ZMI, or was there another application / template which triggered the problem? At any rate, the fix is likely to be to add 'guarded_hasattr' to the list of items which should be wrapped; on the 2.7 branch, this list is at the bottom of AccessControl.Implementation.
Robert
Site Error
An error was encountered while publishing this resource.
TypeError Sorry, a site error occurred.
Traceback (innermost last):
* Module ZPublisher.Publish, line 163, in publish_module_standard * Module Products.PlacelessTranslationService.PatchStringIO, line 45, in new_publish * Module ZPublisher.Publish, line 127, in publish * Module Zope.App.startup, line 203, in zpublisher_exception_hook * Module ZPublisher.Publish, line 100, in publish * Module ZPublisher.mapply, line 88, in mapply * Module ZPublisher.Publish, line 40, in call_object * Module Shared.DC.Scripts.Bindings, line 261, in __call__ * Module Shared.DC.Scripts.Bindings, line 292, in _bindAndExec * Module App.special_dtml, line 175, in _exec * Module DocumentTemplate.DT_Let, line 75, in render * Module DocumentTemplate.DT_Util, line 201, in eval __traceback_info__: _ * Module <string>, line 0, in ?
TypeError: guarded_hasattr() takes exactly 2 arguments (3 given) (Also, an error occurred while attempting to render the standard error message.)
Tres.
I found this, however 'has_order_support' is not the third argument. That is why I do not unterstand what happens. Robert On Tuesday 13 January 2004 23:58, Yuppie wrote:
robert wrote:
I grepped for has_order_support to find out where this happens, but did not find it.
The Zope 2.7 main.dtml has this code:
_.hasattr(this().aq_self, 'has_order_support')
HTH, Yuppie
_______________________________________________ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Hi Robert! robert wrote:
I found this, however 'has_order_support' is not the third argument. That is why I do not unterstand what happens. [...]
_.hasattr(this().aq_self, 'has_order_support')
I don't know that code very well, but this is how I understand what happens: All names in the TemplateDict are bound as methods. If you call hasattr the TemplateDict ('self') is passed in as first argument, in our case 'has_order_support' becomes the third argument. To avoid this functions need to be wrapped by NotBindable. Did you see my other mail? Adding 'hasattr' (not 'guarded_hasattr') to _NEED_WRAPPING works for me. Cheers, Yuppie
Tres Seaver wrote:
This is my bad, I'm pretty sure. Was this just trying to get into the ZMI, or was there another application / template which triggered the problem? At any rate, the fix is likely to be to add 'guarded_hasattr' to the list of items which should be wrapped; on the 2.7 branch, this list is at the bottom of AccessControl.Implementation.
Yes. Adding 'hasattr' (the key for guarded_hasattr) to _NEED_WRAPPING seems to fix this issue. Cheers, Yuppie
participants (3)
-
robert -
Tres Seaver -
Yuppie