[Zope3-dev] a few linger bugs

Jeremy Hylton jeremy@alum.mit.edu
18 Jul 2002 12:21:28 -0400


I've been trying to cleanup some small bugs in the Zope3 tree, but
there are a few I'm not sure how to handle.

SiteDefinition.py refers to a method useStorage() that is not
defined.  I think it's safe to remove the entire test as show in the
patch below.  At the point self._zodb is being tested against None, it
has already been passed to the ZODBUndoManager(), so I think it's
impossible for it to be None.  To be safe, I'd probably add an
assertion.  Does this sound right?

Index: Zope/StartUp/SiteDefinition.py
===================================================================
RCS file: /cvs-repository/Zope3/lib/python/Zope/StartUp/SiteDefinition.py,v
retrieving revision 1.2
diff -c -r1.2 SiteDefinition.py
*** Zope/StartUp/SiteDefinition.py	10 Jun 2002 23:29:43 -0000	1.2
--- Zope/StartUp/SiteDefinition.py	18 Jul 2002 16:08:19 -0000
***************
*** 132,141 ****
          td = ThreadedTaskDispatcher()
          td.setThreadCount(self._threads)
          
-         # setup the storage, if not already done
-         if self._zodb is None:
-             self.useStorage(_context)
-         
          # check whether a root was already specified for this ZODB; if
          # not create one.
          self._initDB()
--- 132,137 ----

In DocumentTemplate, there's a reference to an undefined name:
compiled_getattr.  This is the only occurence of the string in the
entire Zope3 source tree.  What should actually be happening here?

Index: Zope/DocumentTemplate/DT_Util.py
===================================================================
RCS file: /cvs-repository/Zope3/lib/python/Zope/DocumentTemplate/DT_Util.py,v
retrieving revision 1.1
diff -c -r1.1 DT_Util.py
*** Zope/DocumentTemplate/DT_Util.py	25 Jun 2002 15:37:17 -0000	1.1
--- Zope/DocumentTemplate/DT_Util.py	18 Jul 2002 16:12:03 -0000
***************
*** 290,295 ****
--- 290,296 ----
              except KeyError:
                  if name == '_getattr':
                      d['__builtins__'] = globals
+                     # XXX what is compiled_getattr?
                      exec compiled_getattr in d
  
          return eval(code, {}, d)

In FTPServerChannel.py there is a reference to the undefined variable
rnto.

Index: Zope/Server/FTP/FTPServerChannel.py
===================================================================
RCS file: /cvs-repository/Zope3/lib/python/Zope/Server/FTP/FTPServerChannel.py,v
retrieving revision 1.2
diff -c -r1.2 FTPServerChannel.py
*** Zope/Server/FTP/FTPServerChannel.py	10 Jun 2002 23:29:35 -0000	1.2
--- Zope/Server/FTP/FTPServerChannel.py	18 Jul 2002 16:13:14 -0000
***************
*** 348,353 ****
--- 348,354 ----
          try:
              self._getFilesystem().rename(self._rnfr, path)
          except OSError, err:
+             # XXX rnto?
              self.reply('ERR_RENAME', (self._rnfr, rnto, str(err)))
          else:
              self.reply('SUCCESS_250', 'RNTO')

Jeremy