Commit 9d8e08cf authored by Hanno Schlichting's avatar Hanno Schlichting

Added a bit of debugging code, so someone more knowledgeable can have a look ;)

parent 11698435
...@@ -23,15 +23,28 @@ class BrowserView(zope.publisher.browser.BrowserView): ...@@ -23,15 +23,28 @@ class BrowserView(zope.publisher.browser.BrowserView):
# BBB for code that expects BrowserView to still inherit from # BBB for code that expects BrowserView to still inherit from
# Acquisition.Explicit. # Acquisition.Explicit.
# counter = 0
def __of__(self, context): def __of__(self, context):
# Technically this isn't in line with the way Acquisition's # Technically this isn't in line with the way Acquisition's
# __of__ works. With Acquisition, you get a wrapper around # __of__ works. With Acquisition, you get a wrapper around
# the original object and only that wrapper's parent is the # the original object and only that wrapper's parent is the
# new context. Here we change the original object. # new context. Here we change the original object.
# The first segfault happens in form.tests.forms.txt in the first line # XXX The first segfault happens in form.tests.forms.txt in the first
# of the "Widget Overrides" chapter (line 154). # line of the "Widget Overrides" chapter (line 154).
#self.__parent__ = context # ugh. segfault!
# What causes it is:
# ../zope2/lib/python/Zope2/App/startup.py(199)__call__()
# -> log = aq_acquire(published, '__error_log__', containment=1)
# Which causes an infinite loop :(
# self.__parent__ = context # ugh. segfault!
# self.counter = self.counter + 1
# if self.counter > 10:
# import pdb; pdb.set_trace()
return self return self
...@@ -56,3 +69,4 @@ class BrowserView(zope.publisher.browser.BrowserView): ...@@ -56,3 +69,4 @@ class BrowserView(zope.publisher.browser.BrowserView):
def aq_inContextOf(self, *args, **kw): def aq_inContextOf(self, *args, **kw):
return Acquisition.aq_inContextOf(self, *args, **kw) return Acquisition.aq_inContextOf(self, *args, **kw)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment