Skip to content

armgit / camel

Public Imported from GitHub
0

🐫 CAMEL: The first and the best multi-agent framework. Finding the Scaling Law of Agents. https://www.camel-ai.org

chore: _create_file_in_container method bug in Docker interpreter (#2795)

qianyue99623d38d7048ae
diff --git a/camel/interpreters/docker_interpreter.py b/camel/interpreters/docker_interpreter.py
index 117034561..12f2f2f56 100644
--- a/camel/interpreters/docker_interpreter.py
+++ b/camel/interpreters/docker_interpreter.py
@@ -146,8 +146,9 @@ class DockerInterpreter(BaseInterpreter):
tar_stream = io.BytesIO()
with tarfile.open(fileobj=tar_stream, mode='w') as tar:
tarinfo = tarfile.TarInfo(name=filename)
- tarinfo.size = len(content)
- tar.addfile(tarinfo, io.BytesIO(content.encode('utf-8')))
+ encoded_content = content.encode('utf-8')
+ tarinfo.size = len(encoded_content)
+ tar.addfile(tarinfo, io.BytesIO(encoded_content))
tar_stream.seek(0)
# copy the tar into the container