[Zope-CMF] Be more Explicit about Problems/Exceptions was Erratci behaviour

Shane Hathaway shane@zope.com
Thu, 15 Aug 2002 16:13:22 -0400


> From: "alan runyan" <runyaga@runyaga.com>
>>It appears that Python Scripts will lose the context binding while being
>>executed.

I'd like everyone who can reproduce this to try the following patch, 
which fixes a race condition.  I added a unit test that confirmed there 
was a bug here, but I need you guys to verify I fixed the same bug that 
was reported. :-)

The patch is very simple: it rearranges the order of three lines in 
FSObject.py.

Shane


Index: CMFCore/FSObject.py
===================================================================
RCS file: /cvs-repository/CMF/CMFCore/FSObject.py,v
retrieving revision 1.11
diff -u -r1.11 FSObject.py
--- CMFCore/FSObject.py 4 Aug 2002 02:31:30 -0000       1.11
+++ CMFCore/FSObject.py 15 Aug 2002 20:02:16 -0000
@@ -104,9 +104,9 @@
              try:    mtime=stat(fp)[8]
              except: mtime=0
              if not parsed or mtime != self._file_mod_time:
-                self._parsed = 1
-                self._file_mod_time = mtime
                  self._readFile(1)
+                self._file_mod_time = mtime
+                self._parsed = 1

      security.declareProtected(View, 'get_size')
      def get_size(self):