|
|
@@ -250,8 +250,16 @@ class DockerWorkspaceClient:
|
|
|
except Exception as e:
|
|
|
logger.debug("get_archive failed path=%s: %s", container_path, e)
|
|
|
raise FileNotFoundError(container_path) from e
|
|
|
- chunks = b"".join(stream)
|
|
|
- bio = io.BytesIO(chunks)
|
|
|
+ # get_archive 流在部分 SDK/传输下会产出 str,不能 b"".join;str 用 latin-1 按字节还原
|
|
|
+ parts: list[bytes] = []
|
|
|
+ for chunk in stream:
|
|
|
+ if isinstance(chunk, (bytes, bytearray, memoryview)):
|
|
|
+ parts.append(bytes(chunk))
|
|
|
+ elif isinstance(chunk, str):
|
|
|
+ parts.append(chunk.encode("latin-1"))
|
|
|
+ else:
|
|
|
+ parts.append(bytes(chunk))
|
|
|
+ bio = io.BytesIO(b"".join(parts))
|
|
|
with tarfile.open(fileobj=bio, mode="r") as tar:
|
|
|
member = tar.next()
|
|
|
if member is None:
|