[Zope] VHM / traverse subpath interaction bug?

Dieter Maurer dieter at handshake.de
Fri Oct 3 04:14:40 EDT 2008


Chris Withers wrote at 2008-10-2 08:13 +0100:
>I've tried this on Zope 2.8-2.11.1 and it behaves the same on all but 
>feels like a bug. I wonder if anyone else agrees or, better yet, knows 
>what's going on here...
>
>So, add a Script (Python) called test in the root on a Zope instance 
>running on port 8080 and in it put:
>
>return repr(traverse_subpath)
>
>Now go to:
>
>http://localhost:8080/test/x/y/z
>
>..you'll get:
>
>['x', 'y', 'z']
>
>...which makes sense.
>
>Now, if you have a VHM called virtual_hosting (as it normally is) if you 
>go to:
>
>http://localhost:8080/VirtualHostBase/https/example.com:443/test/VirtualHostRoot/x/y/z
>
>...you'll now get:
>
>['virtual_hosting', '/', 'x', 'y', 'z']
>
>...which doesn't seem right to me.
>
>Worse yet, if you go to:
>
>http://localhost:8080/VirtualHostBase/https/example.com:443/test/VirtualHostRoot/_vh_something/x/y/z
>
>...you get:
>
>['virtual_hosting', '/something', 'x', 'y', 'z']
>
>Anyone got any ideas as to what's going on here?

It is very strange that you want to define a Python Script as
root of your site. This use case is simple not supported.


What you see are implementation artifacts (in your not supported use case):

  A "Script (Python)" (among other types) stops traversal and
  makes the remaining traversal steps available in "traverse_subpath".

  A VHM needs to get control twice -- once to set things up
  and once to set the virtual root.
  It ensures to get control the second time by adding additional traversal
  steps.

  Usually, i.e. when the traversal steps leading to the root behave
  "normally", this works fine.
  But, if someone places objects with unusual traversal behaviour
  on the way to the virtual root (such as a "Script (Python)"),
  it may not work.



-- 
Dieter


More information about the Zope mailing list