Skip to content

fix: handle non-ASCII file paths in build graph (closes #24) - #25

Merged
bnusunny merged 1 commit into
developfrom
fix/issue-24-unicode-file-paths
Mar 17, 2026
Merged

fix: handle non-ASCII file paths in build graph (closes #24)#25
bnusunny merged 1 commit into
developfrom
fix/issue-24-unicode-file-paths

Conversation

@cortex-assistant

Copy link
Copy Markdown

Summary

Fixes #24.

The build graph serialization in samcli/lib/build/build_graph.py uses Path.read_text() and Path.write_text() without specifying encoding='utf-8'. On systems where the locale defaults to ASCII (e.g., LANG=C in Docker containers or CI), this causes a UnicodeDecodeError when the codeuri contains non-ASCII characters (e.g., src/données).

Changes

  • Added encoding='utf-8' to all read_text() and write_text() calls in build_graph.py
  • Added regression tests with non-ASCII codeuri paths

Test plan

  • Added unit tests verifying build graph read/write with non-ASCII codeuri values
  • All existing tests continue to pass

Closes #24

@bnusunny
bnusunny merged commit 29ecb83 into develop Mar 17, 2026
11 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: sam build crashes with UnicodeDecodeError on non-ASCII file paths

1 participant