Преглед изворни кода

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

Nuwan Goonasekera пре 9 година
родитељ
комит
1714da4d0d
1 измењених фајлова са 2 додато и 2 уклоњено
  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.
         """
-        with open(path, 'r') as f:
-            self.upload(f.read())
+        with open(path, 'rb') as f:
+            self.upload(f)
 
     def delete(self):
         """