fix: remove double-base64 encoding in upload_file/download_file#464
Open
Hweinstock wants to merge 1 commit intoaws:mainfrom
Open
fix: remove double-base64 encoding in upload_file/download_file#464Hweinstock wants to merge 1 commit intoaws:mainfrom
Hweinstock wants to merge 1 commit intoaws:mainfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #464 +/- ##
=======================================
Coverage ? 89.40%
=======================================
Files ? 82
Lines ? 7570
Branches ? 1132
=======================================
Hits ? 6768
Misses ? 511
Partials ? 291
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
cc1de4c to
9742a05
Compare
9742a05 to
d267bd7
Compare
d267bd7 to
7484fb7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue
Fixes #458
Description
upload_file/upload_filesredundantly base64-encode bytes before passing to botocore's blob shape (which encodes again).download_file/download_filesredundantly base64-decode the response blob that botocore already decoded. Binary files are corrupted on upload and crash or return garbage on download.Changes
base64.b64encode()inupload_file/upload_files— pass raw bytes to botocorebase64.b64decode()indownload_file/download_files— use botocore's already-decoded bytesimport base64test_code_interpreter_client.py)Testing
uv run pytest tests/ -k code_interpreter— all passuv run pytest tests_integ/tools/test_code_interpreter_client.py -xvs— binary upload/download roundtrip verified against live service