[Zope-dev] Patch disabling versions, was: Re: small summary and big plea

Clemens Robbenhaar robbenhaar@espresto.com
Tue, 10 Jun 2003 12:37:14 +0200


Hi Toby,

 I am sorry, but the patch to disable versions does not work for me
(using Zope 2.6.1 / Python2.1.3), maybe because of trivial typo:

 > ===================================================================
 > RCS file: /cvs-repository/Zope/lib/python/ZODB/ZApplication.py,v
 > retrieving revision 1.13
 > diff -c -2 -r1.13 ZApplication.py
 > *** lib/python/ZODB/ZApplication.py	8 Apr 2003 18:48:22 -0000	1.13
 > --- lib/python/ZODB/ZApplication.py	9 Jun 2003 22:58:43 -0000
 > ***************
 > *** 42,49 ****
 >   
 >       def __bobo_traverse__(self, REQUEST=None, name=None):
 > !         db, aname, version_support = self._stuff
 > !         if version_support is not None and REQUEST is not None:
 > !             version=REQUEST.get(version_support,'')
 > !         else: version=''
 >           conn=db.open(version)
 >   
 > --- 42,53 ----
 >   
 >       def __bobo_traverse__(self, REQUEST=None, name=None):
 > !         # Disable nasty insecure version support. Thanks to
 > !         # Jamie Heilman and everyone one zope-dev
 > !         #
 > !         # db, aname, version_support = self._stuff
 > !         # if version_support is not None and REQUEST is not None:
 > !         #     version=REQUEST.get(version_support,'')
 > !         # else: version=''
 > !         version = ''
 >           conn=db.open(version)


 This seems to comment out "db" and "aname", too. As one can see in the
context of the diff, "db" is used in the very last line of the patch
context. Zope gives me the NameError I would expect from the code when I
send a request to the patched server.

 Dropping the comment from the line reading the "_stuff" seems to work
for me:


 > --- 42,53 ----
 >   
 >       def __bobo_traverse__(self, REQUEST=None, name=None):
 > !         # Disable nasty insecure version support. Thanks to
 > !         # Jamie Heilman and everyone one zope-dev
 > !         #
 > !         db, aname, version_support = self._stuff
 > !         # if version_support is not None and REQUEST is not None:
 > !         #     version=REQUEST.get(version_support,'')
 > !         # else: version=''
 > !         version = ''
 >           conn=db.open(version)


Cheers,
Clemens