Commits

dan mackinlay committed 5bf40ee

binary mode forced for all file accesses

Comments (0)

Files changed (1)

         return (self.work_dir/key).exists()
         
     def __setitem__(self, key, val, *args, **kwargs):
-        pickle.dump(val, open(self.work_dir/key, 'w'))
+        pickle.dump(val, open(self.work_dir/key, 'wb'))
     
     def __getitem__(self, key, *args, **kwargs):
-        return pickle.load(open(self.work_dir/key, 'r'))
+        return pickle.load(open(self.work_dir/key, 'rb'))
     
     def __repr__(self):
         """
         state['work_dir'] = unicode(state['work_dir'])
         return state
     
-    def __setstate__(self, dict):
-        self.__dict__ = dict
+    def __setstate__(self, state):
+        self.__dict__ = state
         self.work_dir = path(self.work_dir)