fix(tools): write overlap reports as UTF-8 #2134
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2134"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-09T09:46:54Z.
What
Write
--outoverlap reports with an explicit UTF-8 encoding. The decoding fix in #1989 preserves Unicode pull-request metadata, butPath.write_textotherwise uses the Windows locale and can raiseUnicodeEncodeErrorfor metadata outside that code page. This change adds a focused regression test for the output bytes.Relationship to #1741
#1741 adds definition-aware export detection and its CMake test registration. This PR changes report serialization and its encoding test. They touch the same Python module but implement independent behavior; neither depends on the other.
Relationship to #988
#988 adds workflow logging and job summaries. This PR fixes the encoding used for report files. These changes do not duplicate behavior, though both touch the report-writing code; if either merges first, retain the explicit UTF-8 encoding in the resulting writer.
Tested
mainat27965d8a; the full diff is limited totools/pr_overlap.pyandtools/tests/test_pr_overlap_encoding.py.python3 tools/tests/test_pr_overlap_encoding.pypasses (9/9) andpython3 tools/tests/test_pr_overlap.pypasses (3/3) on this head.Path.write_textcall without an encoding reproducedUnicodeEncodeError; explicit UTF-8 encoding succeeded. The focused test passed 9/9 on the pre-rebase source, whose change is unchanged by this rebase. The CLI was not run end-to-end because it requiresgh.python3 tools/check_conventions.py --base upstream/mainandgit diff --check upstream/main...HEADpass.Checklist
main; no open PR implements report-file UTF-8 encodingImported from boykopovar/AnyPS5. Originally posted by MGXAe on 2026-10-09T12:50:44Z.
Tested on native Windows 11 (Python 3.14.3, locale cp1252, UTF-8 mode off), since the description notes Windows wasn't available.
On
main,Path.write_text("PR title → 日本語")raisesUnicodeEncodeError: 'charmap' codec can't encode character '\u2192' in position 9: character maps to <undefined>; withencoding="utf-8"it succeeds.tools/tests/test_pr_overlap_encoding.py: 9/9 pass on this head (8a8013b3).main'spr_overlap.py(nowrite_reports).tools/check_conventions.pypasses andgit diff --checkis clean.I reproduced the write call directly rather than running
pr_overlap.pyend-to-end, since that needsgh.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-09T13:48:22Z.
Rebased the single UTF-8 report change onto current upstream
maind70b8998; new head:89b2ea29da630bdad604a50ec008f5e94967b239. Local focused test passes 9/9, local Conventions and diff checks pass, and the exact-head upstream Conventions check is green. I updated the PR description with the Windows report and its scope: the direct encoding check was not an end-to-end CLI run.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-09T19:41:22Z.
Validation on the updated head
I rebased the existing branch linearly onto upstream
mainat8b393b6eand pushed head20dbe58a. The full diff remains limited to UTF-8 report serialization and its regression test. The focused Python suite passes 9/9 on this head, Conventions andgit diff --checkpass, and the PR description explains the independent overlap with #1741.The Windows cp1252 reproduction is from the same source change before rebasing; it was a direct
Path.write_textcheck, not an end-to-end CLI run. The full Linux/Windows Build and relinker matrix still needs a collaborator with write access. Could someone run Actions → Build for PR #2134 on this head?