diff options
| author | kapitche <kapitche@users.noreply.github.com> | 2026-11-22 15:19:44 -0500 |
|---|---|---|
| committer | kapitche <kapitche@users.noreply.github.com> | 2026-11-22 15:19:44 -0500 |
| commit | 6b1b479aa2fe7e5f216a98fbb377d1cd6fdc0f04 (patch) | |
| tree | c10cdc51ae9381fd009ffb21749195640a32e80a /tools/rbf0_encode.py | |
| parent | f847748cc76bd3777f9c070c4034eb2fc1c04e64 (diff) | |
rbf0_encode: a non-UTF-8 report is a one-line error, not a UnicodeDecodeError traceback
Diffstat (limited to 'tools/rbf0_encode.py')
| -rw-r--r-- | tools/rbf0_encode.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/rbf0_encode.py b/tools/rbf0_encode.py index eaf9d9c04..a9e5ab3a6 100644 --- a/tools/rbf0_encode.py +++ b/tools/rbf0_encode.py | |||
| @@ -221,7 +221,7 @@ def write_all(report, out_dir): | |||
| 221 | try: | 221 | try: |
| 222 | with open(report, encoding="utf-8") as f: | 222 | with open(report, encoding="utf-8") as f: |
| 223 | data = json.load(f) | 223 | data = json.load(f) |
| 224 | except (OSError, json.JSONDecodeError) as e: | 224 | except (OSError, ValueError) as e: # ValueError: bad JSON or non-UTF-8 bytes |
| 225 | raise SystemExit(f"{report}: cannot read report: {e}") from None | 225 | raise SystemExit(f"{report}: cannot read report: {e}") from None |
| 226 | if not isinstance(data, dict) or data.get("tool") != "rbf0_tree": | 226 | if not isinstance(data, dict) or data.get("tool") != "rbf0_tree": |
| 227 | raise SystemExit(f"{report}: not an rbf0_tree.py JSON report") | 227 | raise SystemExit(f"{report}: not an rbf0_tree.py JSON report") |