Created
May 6, 2017 03:57
-
-
Save zaitcev/5287ce6427bff61bccd463c82767a99d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/swiftclient/utils.py b/swiftclient/utils.py | |
index 08cd7b2..3288fcd 100644 | |
--- a/swiftclient/utils.py | |
+++ b/swiftclient/utils.py | |
@@ -297,6 +297,10 @@ class LengthWrapper(object): | |
if self._remaining <= 0: | |
return '' | |
+ # Thank Martin v. Loewis for this. | |
+ if size == 8192: | |
+ size = 64536 | |
+ | |
to_read = self._remaining if size < 0 else min(size, self._remaining) | |
chunk = self._readable.read(to_read) | |
self._remaining -= len(chunk) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment