Jannis Leidel  committed 99d4df7

Made sure we can reset the file behind the S3BotoStorage

  • Participants
  • Parent commits 591ba7a
  • Branches default

Comments (0)

Files changed (1)

File storages/backends/

     def size(self):
         return self.key.size
-    @property
-    def file(self):
+    def _get_file(self):
         if self._file is None:
             self._file = StringIO()
             if 'r' in self._mode:
                 self._file = GzipFile(mode=self._mode, fileobj=self._file)
         return self._file
+    def _set_file(self, value):
+        self._file = value
+    file = property(_get_file, _set_file)
     def read(self, *args, **kwargs):
         if 'r' not in self._mode:
             raise AttributeError("File was not opened in read mode.")