After more playing I've discovered that calling the resutl of aq_inner() appears to be a very bad idea ;-) The line: print self.aq_inner() in the __call__ method of a python product caused the python process to dump an 'unknown software exception'. Should that be so? Also, I thought aq_inner gave the contaiment context (presumably as a list?) but it just returns a single object. So, how can I get the containment context of an object as a list? cheers, Chris
Chris Withers wrote:
After more playing I've discovered that calling the resutl of aq_inner() appears to be a very bad idea ;-)
The line: print self.aq_inner()
in the __call__ method of a python product caused the python process to dump an 'unknown software exception'.
Should that be so?
No. Sound's like a bug. Would you mind submitting a collector entry?
Also, I thought aq_inner gave the contaiment context (presumably as a list?) but it just returns a single object.
It returns the innermost wrapped objects. IOW, it stips off all levels of wrapping except one.
So, how can I get the containment context of an object as a list?
See: http://www.zope.org/Members/michel/Projects/Interfaces/AcquisitionModuleInte... In particular: Acquisition.aq_chain(ob,1) More acquisition pointers can be found at: http://www.zope.org/Members/michel/Projects/Interfaces/Acquisition Jim -- Jim Fulton mailto:jim@digicool.com Technical Director (888) 344-4332 Python Powered! Digital Creations http://www.digicool.com http://www.python.org Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email address may not be added to any commercial mail list with out my permission. Violation of my privacy with advertising or SPAM will result in a suit for a MINIMUM of $500 damages/incident, $1500 for repeats.
Jim Fulton wrote:
The line: print self.aq_inner()
in the __call__ method of a python product caused the python process to dump an 'unknown software exception'.
Should that be so?
No. Sound's like a bug. Would you mind submitting a collector entry?
Not at all, but... Toby Dickenson wrote:
I bet you are using python 1.5.2 on Windows.
I am, Toby's explanation sounds accurate. So, does this go in the Zope collector or the Python collector? If the later, does anyone know if it is in there already? Jim Fulton wrote:
http://www.zope.org/Members/michel/Projects/Interfaces/AcquisitionModuleInte... http://www.zope.org/Members/michel/Projects/Interfaces/Acquisition
...very useful links :-)
In particular:
Acquisition.aq_chain(ob,1)
How would this differ from getPhysicalPath(ob)? Is it just that getPhysicalPath won't contain any acquired objects, if you see what I mean? I think something ob.getPhysicalPath() is probably what I want, but if you read my post titled "__call__ hell :-(" you'll see I can't actually find the object I'd need to call getPhysicalPath() on. I think it's the 'client' I'm looking for but I have no idea for to get that in the __call__ method of my python product. Any ideas? (if it helps, the __call__ method is executed as the result of a <dtml-var myObject> which appears in standard_html_header) cheers, Chris
Chris, Have you tried Christian Tismers Stackless Python, which has 'infinite' recursion capabilities? www.stackless.com Phil ----- Original Message ----- From: "Chris Withers" <chrisw@nipltd.com> To: "Jim Fulton" <jim@digicool.com> Cc: <zope-dev@zope.org> Sent: Tuesday, September 26, 2000 2:09 PM Subject: [Zope-dev] aq_inner crash: Python 1.5.2's fault? (also how to get the client)
Jim Fulton wrote:
The line: print self.aq_inner()
in the __call__ method of a python product caused the python process to dump an 'unknown software exception'.
Should that be so?
No. Sound's like a bug. Would you mind submitting a collector entry?
Not at all, but...
Toby Dickenson wrote:
I bet you are using python 1.5.2 on Windows.
I am, Toby's explanation sounds accurate. So, does this go in the Zope collector or the Python collector? If the later, does anyone know if it is in there already?
Jim Fulton wrote:
http://www.zope.org/Members/michel/Projects/Interfaces/AcquisitionModuleInte rface
http://www.zope.org/Members/michel/Projects/Interfaces/Acquisition
...very useful links :-)
In particular:
Acquisition.aq_chain(ob,1)
How would this differ from getPhysicalPath(ob)? Is it just that getPhysicalPath won't contain any acquired objects, if you see what I mean?
I think something ob.getPhysicalPath() is probably what I want, but if you read my post titled "__call__ hell :-(" you'll see I can't actually find the object I'd need to call getPhysicalPath() on. I think it's the 'client' I'm looking for but I have no idea for to get that in the __call__ method of my python product.
Any ideas?
(if it helps, the __call__ method is executed as the result of a <dtml-var myObject> which appears in standard_html_header)
cheers,
Chris
_______________________________________________ Zope-Dev maillist - Zope-Dev@zope.org http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Phil Harris wrote:
Have you tried Christian Tismers Stackless Python, which has 'infinite' recursion capabilities?
I'm not sure this would be entirely helpful here ;-) I wonder what aq_base(), over aq_base, does that causes an infinite recursion? Maybe I should still stick this in the collector... *goes off to do so* cheers, Chris
Chris Withers wrote:
Phil Harris wrote:
Have you tried Christian Tismers Stackless Python, which has 'infinite' recursion capabilities?
I'm not sure this would be entirely helpful here ;-)
I wonder what aq_base(), over aq_base, does that causes an infinite recursion? Maybe I should still stick this in the collector...
aq_base is not a method (nor is aq_inner). "wrapped_object.aq_base()" just unwraps wrapped_object then tries to execute __call__() on the unwrapped object. If there is infinite recursion that results, there's a 99.9% chance that the object simply isn't supposed to be called when unwrapped (which DTML can't do anyway because of security checks.) Shane
On Tue, 26 Sep 2000 14:09:39 +0100, Chris Withers <chrisw@nipltd.com> wrote:
I bet you are using python 1.5.2 on Windows.
I am, Toby's explanation sounds accurate. So, does this go in the Zope collector or the Python collector? If the later, does anyone know if it is in there already?
The latter, yes, and its long fixed. Toby Dickenson tdickenson@geminidataloggers.com
On Tue, 26 Sep 2000 11:32:17 +0100, Chris Withers <chrisw@nipltd.com> wrote:
After more playing I've discovered that calling the resutl of aq_inner() appears to be a very bad idea ;-)
The line: print self.aq_inner()
in the __call__ method of a python product caused the python process to dump an 'unknown software exception'.
Should that be so?
I bet you are using python 1.5.2 on Windows. Python has a good try at catching too-deep recursion. In that version its limit was set a little too high, and Windows catches the error first.
Also, I thought aq_inner gave the contaiment context (presumably as a list?) but it just returns a single object. So, how can I get the containment context of an object as a list?
Check out the implementation of getPhysicalPath Toby Dickenson tdickenson@geminidataloggers.com
participants (5)
-
Chris Withers -
Jim Fulton -
Phil Harris -
Shane Hathaway -
Toby Dickenson