← Back to Pull requests

[BUGFIX] TupleFilesystemStoreBackend reads with ambient locale encoding #12125

Closed
unknown closed this pull request without merging on Sep 09, 2026 15:35 UTC
View on GitHub
unknown unknown commented on Aug 29, 2026 00:19 UTC
Author

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:

  • config_variables.yml handling in abstract_data_context.py

  • a handful of similarly unpinned open() calls in

  • 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

    Diff: 162 lines (+121 / -41) across 2 files Reviewer: nanjeshramesh Review duration: 16755m
    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
    0.35
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    56%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    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
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 56.8% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 34.9% (LOW) · Higher = larger blast radius
    34.9%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 56.8% · Lower = rushed or shallow review
    56.8%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 15.1% · Safe to merge
    15.1%