Commits

Mike Lin committed 53776e3

Open file in binary mode before pickling or unpickling

  • Participants
  • Parent commits 96b57e9

Comments (0)

Files changed (1)

     def put(self, id, bfr):
         try:
             fn = self.__fn(id)
-            f = self.open(fn, 'w')
+            f = self.open(fn, 'wb')
             f.write(bfr)
             f.close()
             return bfr
         try:
             fn = self.__fn(id)
             self.validate(fn)
-            return self.open(fn)
+            return self.open(fn, 'rb')
         except:
             pass