Skip to content

Commit

Permalink
Fix docs examples for Python SDK read method (#482)
Browse files Browse the repository at this point in the history
The Python examples were using read that returned string, but we were
using it as bytes in the examples.

Users already opened two issues about this that we had to solve until
they mentioned it is wrong in the docs.
  • Loading branch information
ValentaTomas authored Nov 28, 2024
2 parents f64559b + f863a59 commit d6059a8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion apps/web/src/app/(docs)/docs/filesystem/download/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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)
```
</CodeGroup>
Original file line number Diff line number Diff line change
Expand Up @@ -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)
```
</CodeGroup>
Expand Down Expand Up @@ -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)
```
</CodeGroup>
Expand Down

0 comments on commit d6059a8

Please sign in to comment.