From f863a594e2754da8414d942e12b889ffd9510e2c Mon Sep 17 00:00:00 2001 From: Tomas Valenta Date: Thu, 28 Nov 2024 11:36:10 -0800 Subject: [PATCH] Fix bug in python docs examples when reading files --- apps/web/src/app/(docs)/docs/filesystem/download/page.mdx | 2 +- .../(docs)/docs/quickstart/upload-download-files/page.mdx | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/web/src/app/(docs)/docs/filesystem/download/page.mdx b/apps/web/src/app/(docs)/docs/filesystem/download/page.mdx index 4ada9102b..d9f9de798 100644 --- a/apps/web/src/app/(docs)/docs/filesystem/download/page.mdx +++ b/apps/web/src/app/(docs)/docs/filesystem/download/page.mdx @@ -22,7 +22,7 @@ sandbox = Sandbox() # Read file from sandbox content = sandbox.files.read('/path/in/sandbox') # Write file to local filesystem -with open('/local/path', 'wb') as file: +with open('/local/path', 'w') as file: file.write(content) ``` diff --git a/apps/web/src/app/(docs)/docs/quickstart/upload-download-files/page.mdx b/apps/web/src/app/(docs)/docs/quickstart/upload-download-files/page.mdx index 291976479..5872f67fe 100644 --- a/apps/web/src/app/(docs)/docs/quickstart/upload-download-files/page.mdx +++ b/apps/web/src/app/(docs)/docs/quickstart/upload-download-files/page.mdx @@ -92,7 +92,7 @@ sbx = Sandbox.create() # Download file from the sandbox to path '/home/user/my-file' content = sbx.files.read('/home/user/my-file') # Write file to local path -with open('/local/file', 'wb') as file: +with open('/local/file', 'w') as file: file.write(content) ``` @@ -126,13 +126,13 @@ sbx = Sandbox.create() # Download file A from the sandbox to path '/home/user/my-file-a' contentA = sbx.files.read('/home/user/my-file-a') # Write file A to local path -with open('/local/file/a', 'wb') as file: +with open('/local/file/a', 'w') as file: file.write(contentA) # Download file B from the sandbox to path '/home/user/my-file-b' contentB = sbx.files.read('/home/user/my-file-b') # Write file B to local path -with open('/local/file/b', 'wb') as file: +with open('/local/file/b', 'w') as file: file.write(contentB) ```