[ZPT] Semantics of double slash in path expressions changed from Zope2.5.1 to 2.6?

Clemens Robbenhaar zpt@zope.org
Fri, 6 Dec 2002 00:01:03 +0100


 The semantics of having two consecutive slashes in path expressions
seems to have changed in between Zope2.5.1 and 2.6.0

 In Zope2.5.1, a path expression like 'here//title_or_id' seems to be
equivalent to 'here/title_or_id', e.g. consecutive slashes are joined to
one slash implicitly. This is what I would expect from path expressions, in
analogy e.g. to URL's (though path expressions are not URL's, of course.)


 In Zope2.6.0, the path expression 'here//title_or_id' seems to be
loosely equivalent to the python expression:

 python:getattr( getattr(here,''),'title_or_id')

What actually happens is that something having an empty id is first
looked up in 'here', before looking up 'title_or_id' in that object.

 Usually this leads to a 'KeyError' (with the empty string as a key).
The exception may be prevented if someone manages to add an object with
the empty string as id into the ZODB. I have no idea what use case may
be there for doing this.


 I checked the CHANGELOG.txt but could find no hint that this change has
been intentionally (, though I have quite some talent to overlook the
relevant hints ...). Searching the web did not provide me with an
answer; maybe I did not find the proper search criteria.

 
 Can anybody please give be a hint why this change has been made?

This would help me arguing with the HTML design people why double slashes
are no longer allowed even if they think it is convenient.


Regards,
Clemens