[Zope-dev] Re: bug in VirtualHostMonster in 2.5.0

Leonardo Rochael Almeida leo@hiper.com.br
20 Feb 2002 20:02:06 -0300


This is a MIME-formatted message.  If you see this text it means that your
E-mail software does not support MIME-formatted messages.

--=_spitfire-14416-1014246127-0001-2
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 7bit

Ok, I think I found a fix for it, but it's not a change in VHM.

As I mentioned in a follow-up to Zope bug 235, there is an inconsistency
in lib/python/ZPublisher/HTTPRequest.py in HTTPRequest.setVirtualRoot()

The attached patch (also in the bug report) explains what this
inconsistency is and seems to fix the VHM problem, but I don't know what
other side-effects it has. The 'utilities/testrunner.py -a' seems to run
ok.

On Wed, 2002-02-20 at 16:29, Leonardo Rochael Almeida wrote:
> Hi guys,
> 
> I bring to your attention the bug
> "235":http://collector.zope.org/Zope/235 in the Zope collector, which I
> just posted.
> 
> Apparently VHM is inserting exactly one spurious '/' in urls when the
> _vh_folder syntax is used. The problem seems to be in the
> VirtualHostMonster.__call__ method at
> lib/python/Products/SiteAccess/VirtualHostMonster.py, which has changed
> a lot relative to the 2.4.x version, however I couldn't make head or
> tails of that algorithm, so I wouldn't know how to fix it.
> 
> This problem is seriously hampering our deployment of Zope 2.5.0 on
> clients, since most of the time we publish the root of the site from a
> Zope Folder and need the _vh_folder syntax to access the real Zope root
> for manteinance.
> 
> Cheers, Leo
> 
> PS: since we're talking about the collector, I'll also plug the other
> but I posted there "http://collector.zope.org/Zope/167", which talks
> about a problem with SuperFind() and includes a simple fix. It's still
> pending...

-- 
Ideas don't stay in some minds very long because they don't like
solitary confinement.


--=_spitfire-14416-1014246127-0001-2
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Description: patch against lib/python/ZPublisher/HTTPRequest.py
Content-Disposition: attachment; filename=HTTPRequest.py.patch

--- HTTPRequest.py.orig	Wed Feb 20 19:14:20 2002
+++ HTTPRequest.py	Wed Feb 20 19:16:00 2002
@@ -158,7 +158,8 @@
         """ Treat the current publishing object as a VirtualRoot """
         other =3D self.other
         if type(path) is type(''):
-            path =3D filter(None, path.split( '/'))
+            path =3D path.split('/')
+        path =3D filter(None, path)
         self._script[:] =3D map(quote, path)
         del self._steps[:]
         parents =3D other['PARENTS']

--=_spitfire-14416-1014246127-0001-2--