Repository navigation
e2b@2.62.0
Minor Changes
-
9fdfa21: Add
retainOutput(JS) /retain_output(Python) option tocommands.runandcommands.connect(defaulttrue)- When
false, stdout/stderr are not buffered in memory;stdout/stderron the handle, result andCommandExitError/CommandExitExceptionareundefined/None - Output callbacks (
onStdout/onStderr,on_stdout/on_stderr) still receive all output
- When
-
d58ef55:
files.writestreams iterables of byte chunks to the sandbox instead of buffering them:- JS:
AsyncIterable<Uint8Array>data (async generators, Node.jsReadable), alongsideReadableStream. - Python:
Iterable[bytes]inSandboxandAsyncIterable[bytes]inAsyncSandbox; each SDK rejects the other's iterable kind withInvalidArgumentException.
Stream data always uses the octet-stream upload, works with
gzip, and is never buffered in memory. In browsers that can't stream a request body (Firefox, Safari and every iOS browser), JS stream data throwsInvalidArgumentErrorinstead (pass aBlob, e.g.await new Response(stream).blob()); Chromium-based browsers stream it. A chunk that isn't bytes throwsInvalidArgumentError/InvalidArgumentExceptionrather than a transport error.Python file-like objects that aren't
io.IOBasebut have a syncread()(tempfile.NamedTemporaryFile(), werkzeugFileStorage, DjangoFile) are uploaded as files; objects with an asyncread()(aiofiles, aiohttpresponse.content) are consumed as async iterables byAsyncSandbox.WriteEntry(str,bytesor file-like data) is accepted by bothSandbox.files.write_filesandAsyncSandbox.files.write_files; the newSyncWriteEntryandAsyncWriteEntryadditionally takeIterable[bytes]/AsyncIterable[bytes].Breaking (JS):
ReadableStream/AsyncIterabledata is no longer buffered: browsers without streaming request bodies throw, and multipart is refused —useOctetStream: falsethrowsInvalidArgumentError, and an envd older than 0.5.7 throwsTemplateError. Python raisesInvalidArgumentException/TemplateExceptionfor iterables in the same cases.Breaking (both SDKs):
gzip: truewithuseOctetStream: false/gzip=True, use_octet_stream=Falseis now rejected as an invalid combination (InvalidArgumentError/InvalidArgumentException) instead of gzip silently overriding it. - JS: