Commits

Thomas Waldmann  committed ee2a0d5

work around that LimitedStream file-like object might not have tell()

  • Participants
  • Parent commits c62f12d
  • Branches storage-ng

Comments (0)

Files changed (1)

File MoinMoin/storage/backends/_util.py

         self._hash = hashlib.new(hash_method)
         self._size = 0
         self._finished = False
-        fpos = realfile.tell()
-        if fpos:
-            raise ValueError("file needs to be at pos 0")
+        if hasattr(realfile, 'tell'):
+            fpos = realfile.tell()
+            if fpos:
+                raise ValueError("file needs to be at pos 0")
 
     def read(self, size=None):
         # XXX: workaround for werkzeug.wsgi.LimitedStream