|
@@ -28,13 +28,13 @@ from io import BytesIO
|
|
|
from contextlib import closing
|
|
|
|
|
|
|
|
|
-class ListBytesIO(object):
|
|
|
+class ChunkedBytesIO(object):
|
|
|
"""Turn a list of bytestrings into a file-like object.
|
|
|
|
|
|
This is similar to creating a `BytesIO` from a concatenation of the
|
|
|
bytestring list, but saves memory by NOT creating one giant bytestring first::
|
|
|
|
|
|
- BytesIO(b''.join(list_of_bytestrings)) =~= ListBytesIO(list_of_bytestrings)
|
|
|
+ BytesIO(b''.join(list_of_bytestrings)) =~= ChunkedBytesIO(list_of_bytestrings)
|
|
|
"""
|
|
|
def __init__(self, contents):
|
|
|
self.contents = contents
|
|
@@ -84,7 +84,7 @@ def tar_stream(store, tree, mtime, format=''):
|
|
|
except KeyError:
|
|
|
# Entry probably refers to a submodule, which we don't yet support.
|
|
|
continue
|
|
|
- data = ListBytesIO(blob.chunked)
|
|
|
+ data = ChunkedBytesIO(blob.chunked)
|
|
|
|
|
|
info = tarfile.TarInfo()
|
|
|
info.name = entry_abspath.decode('ascii') # tarfile only works with ascii.
|