[ZPT] Memory Leak still?

Evan Simpson evan@zope.com
Mon, 10 Dec 2001 13:08:38 -0500


Ron Bickers wrote:
 > Well.  That's one way to stop a leak. :-)
 >
 > I get this traceback when trying to access my site now. (Info:
 > path('item/url') or nothing)


Ah, yes.  The semantics of this kind of expression have changed, and 
probably should have changed back when '|' was introduced.  Path expressions 
  had returned an un-raised exception object if the path was undefined, and 
you could treat this as a false value for purposes of Python 'or'.  The fix 
for the memory leak changes this so that path expressions always directly 
raise the Undefined exception, so your expression needs to be changed to:

"item/url | nothing" or "python:path('item/url | nothing')" (inefficient, 
but shows how you could do further logical ops.

Cheers,

Evan @ Zope