Skip to content

Downloading binary files fails #243

@troyparrett

Description

@troyparrett

return base64.b64decode(resource["blob"]).decode("utf-8")

The download_file and download_files has a .decode("utf-8") that seems problematic for binary files and causes:

packages/bedrock_agentcore/tools/code_interpreter_client.py", line 670, in download_files
files[file_path] = base64.b64decode(resource["blob"]).decode("utf-8")
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x89 in position 0: invalid start byte

Version 1.2; Python 3.14

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions