hgext/lfs/blobstore.py
changeset 44086 ffac09da7a19
parent 44085 0ee0a3f6a990
child 44223 5f841daf3b41
--- a/hgext/lfs/blobstore.py	Tue Jan 14 19:42:24 2020 -0500
+++ b/hgext/lfs/blobstore.py	Tue Jan 14 20:05:37 2020 -0500
@@ -503,7 +503,6 @@
         for k, v in headers:
             request.add_header(pycompat.strurl(k), pycompat.strurl(v))
 
-        response = b''
         try:
             with contextlib.closing(self.urlopener.open(request)) as res:
                 contentlength = res.info().get(b"content-length")
@@ -520,11 +519,14 @@
                     # blobstore
                     localstore.download(oid, res, contentlength)
                 else:
+                    blocks = []
                     while True:
                         data = res.read(1048576)
                         if not data:
                             break
-                        response += data
+                        blocks.append(data)
+
+                    response = b"".join(blocks)
                     if response:
                         ui.debug(b'lfs %s response: %s' % (action, response))
         except util.urlerr.httperror as ex: