From e7e910782c59114db56662c06be58d028c4f75eb Mon Sep 17 00:00:00 2001 From: Jakub <106778416+MarekZegare4@users.noreply.github.com> Date: Sat, 20 Jun 2026 01:50:28 +0200 Subject: [PATCH] fix(build): tolerate control chars in `pio project config` JSON dump get_platform_for_env() in build.sh parses `pio project config --json-output` with Python's strict json.load(), which rejects literal control characters inside string values. Depending on the installed pio version, a build_flags value can embed one there, breaking env-name lookup with "Invalid control character" before the actual build even starts. strict=False accepts it, same as a lenient JSON consumer would for a non-conforming producer. Co-Authored-By: Claude Sonnet 4.6 --- build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 03fdffaf..453dcec1 100755 --- a/build.sh +++ b/build.sh @@ -96,7 +96,7 @@ get_platform_for_env() { local env_name=$1 echo "$PIO_CONFIG_JSON" | python3 -c " import sys, json, re -data = json.load(sys.stdin) +data = json.load(sys.stdin, strict=False) for section, options in data: if section == 'env:$env_name': for key, value in options: