Skip to content

'charmap' codec can't encode character '\U0001f680' in position 4: character maps to <undefined> #2010

Description

@garretwilson

Description

Running the bare AgentCore getting-started demo produces a Unicode error:

'charmap' codec can't encode character '\U0001f680' in position 4: character maps to

Steps to Reproduce

Exactly following [Get started with the AgentCore CLI]https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/runtime-get-started-cli.html):

  1. npm install -g @aws/agentcore
  2. agentcore create --name MyAgent --framework Strands --protocol HTTP --model-provider Bedrock --memory none
  3. In MyAgent/model/load.py, change the model:

    return BedrockModel(model_id="global.amazon.nova-2-lite-v1:0")

  4. cd MyAgent
  5. agentcore dev
  6. Enter a question; e.g. "What are the highlights of the uv package manager for Python?"

Expected Behavior

The model returns a response with no error.

Actual Behavior

The uv package manager for Python is an extremely fast, all-in-one tool that simplifies Python development by replacing multiple tools with a single, high-performance solution. Here are the key highlights of uv:

🚀 **Error: 'charmap' codec can't encode character '\U0001f680' in position 4: character maps to <undefined>

CLI Version

0.27.0

Operating System

Windows

Additional Context

Initial searches indicated this is related to Python. In any case, in an enterprise framework the first-steps demo should run without issue, across platforms.

From experience, I would guess that one or more layer is making assumptions about the system charset rather than being explicit about which charset is needed.

Looking at the console stack trace, the error seems to originate in: MyAgent\\app\\MyAgent\\.venv\\Lib\\site-packages\\bedrock_agentcore\\runtime\\app.py:_sync_stream_with_error_handling:945

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions