Bläddra i källkod

Make sure file is read in binary and avoid reading fully into memory

Nuwan Goonasekera 9 år sedan
förälder
incheckning
1714da4d0d
1 ändrade filer med 2 tillägg och 2 borttagningar
  1. 2 2
      cloudbridge/cloud/providers/openstack/resources.py

+ 2 - 2
cloudbridge/cloud/providers/openstack/resources.py

@@ -1084,8 +1084,8 @@ class OpenStackBucketObject(BaseBucketObject):
         """
         """
         Stores the contents of the file pointed by the "path" variable.
         Stores the contents of the file pointed by the "path" variable.
         """
         """
-        with open(path, 'r') as f:
-            self.upload(f.read())
+        with open(path, 'rb') as f:
+            self.upload(f)
 
 
     def delete(self):
     def delete(self):
         """
         """