Code

fix more metakit dumbness
authorrichard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2>
Fri, 5 Dec 2003 04:43:46 +0000 (04:43 +0000)
committerrichard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2>
Fri, 5 Dec 2003 04:43:46 +0000 (04:43 +0000)
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@2017 57a73879-2fb5-44c3-a270-3262357dd7e2

roundup/backends/back_metakit.py

index 53035262a8680d71847f6d43090373e667b30d6e..38b63bb0d03b80cc792736b2fd192d4932ec1c29 100755 (executable)
@@ -1,4 +1,4 @@
-# $Id: back_metakit.py,v 1.53 2003-11-14 00:11:18 richard Exp $
+# $Id: back_metakit.py,v 1.54 2003-12-05 04:43:46 richard Exp $
 '''
    Metakit backend for Roundup, originally by Gordon McMillan.
 
@@ -280,7 +280,7 @@ _marker = []
 
 _ALLOWSETTINGPRIVATEPROPS = 0
 
-class Class:    
+class Class(hyperdb.Class):
     privateprops = None
     def __init__(self, db, classname, **properties):
         #self.db = weakref.proxy(db)
@@ -1408,11 +1408,13 @@ class FileClass(Class, hyperdb.FileClass):
             if x.startswith('file:'):
                 fnm = x[5:]
                 try:
-                    x = open(fnm, 'rb').read()
+                    f = open(fnm, 'rb')
                 except IOError, (strerror):
                     # XXX by catching this we donot see an error in the log.
                     return 'ERROR reading file: %s%s\n%s\n%s'%(
                             self.classname, nodeid, poss_msg, strerror)
+                x = f.read()
+                f.close()
         return x
 
     def create(self, **propvalues):