[BUGFIX] TupleFilesystemStoreBackend reads with ambient locale encoding #12125
All Vouch review confidence checks passed
Residual risk 0.15 = Change Risk (0.35) × (1 − Review Confidence (0.57)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.35 · 162 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.305
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #12125"
general
weight: 0.35
nanjeshramesh
Closes #12120.
Pinned encoding="utf-8" on the four text-mode open() calls the issue
named: the read side of TupleFilesystemStoreBackend
(tuple_store_backend.py), and both directions of the project YAML in
InlineStoreBackend (inline_store_backend.py) and FileDataContext
(file_data_context.py). The write side of the store backend was
already writing UTF-8 bytes explicitly in binary mode, so that one's
untouched.
Tests force a genuinely non-UTF-8 encoding the same way the issue's
own repro does, by spawning a subprocess with LC_ALL=C, LANG=C,
PYTHONCOERCECLOCALE=0, and PYTHONUTF8=0, rather than relying on the
ambient locale (which is UTF-8 in CI either way, so that wouldn't
actually test anything). Confirmed both new tests fail against
unpatched develop with the exact UnicodeDecodeError from the issue,
and pass with the fix.
Ran the full data_context test suite locally, 306 passed, 27 skipped,
1 xfailed, nothing broken.
Two things I noticed but left alone, both already flagged as out of
scope in the issue:
serializable_data_context.py, which isn't one of the three classes
this issue's requirements name
New test file:
tests/data_context/test_file_backed_encoding.py