[PR #3879] [MERGED] Port publish: write the issue body as UTF-8 #5268

Closed
opened 2026-11-03 05:11:23 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/3879
Author: @matyden
Created: 10/29/2026
Status: ✅ Merged
Merged: 10/29/2026
Merged by: @ludovic111

Base: main ← Head: tools/port-publish-utf8


📝 Commits (1)

  • 7b33479 Port publish: write the issue body as UTF-8

📊 Changes

1 file changed (+2 additions, -1 deletions)

View changed files

📝 tools/port_publish.py (+2 -1)

📄 Description

🤖 Opened by matyden's AI agent (Claude Code), not by matyden.

What and why

tools/port_publish.py issue() writes the issue body to a temporary file in the system's code page, and gh issue create/edit --body-file reads that file as UTF-8. On Windows (cp1251 here) a body with →, which every facts item has (- key: a → b), raises UnicodeEncodeError before gh runs; with a code page that can encode the character, gh would publish it garbled. The file is now written as UTF-8.

The same bug makes tests/test_port_publish.py test_apply_lists_the_new_issue_numbers_in_the_tracking_issue fail on Windows without PYTHONUTF8, so every self-check block from a Windows machine shows a ❌ in "Python tests" for an unchanged main.

#3587's description lists this fix, but its merged diff only touches tools/roadmap.py and tests/test_roadmap.py, and 479f53624 made gh() decode gh's output as UTF-8, not write the body file. This is the line that was left out.

Vanilla reference

none (tooling).

Self-check

pr_ready (tools/pr_ready.py --quick --base upstream/main on WIN-TU836SRDD9A, against upstream/main at 668419b92, 1 min 8 s)

Check Result
Scope ✅ 1 files, +2 −1
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 423 passed (1 min 7 s)
rustfmt ➖ no Rust change
clippy ➖ no Rust change
tests ➖ no crate touched
doc tests ➖ no crate touched
content root tests ➖ content root untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ not run (--quick): CI's parity job picks the affected harnesses
Label skip-release

Run on Windows without PYTHONUTF8. Before this change the same run had 1 error in Python tests (the UnicodeEncodeError above); now all 423 pass.

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/3879 **Author:** [@matyden](https://github.com/matyden) **Created:** 10/29/2026 **Status:** ✅ Merged **Merged:** 10/29/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `tools/port-publish-utf8` --- ### 📝 Commits (1) - [`7b33479`](https://github.com/horizon-rust/horizon/commit/7b33479e159680e7ad903f365760ba2c8a2d2276) Port publish: write the issue body as UTF-8 ### 📊 Changes **1 file changed** (+2 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `tools/port_publish.py` (+2 -1) </details> ### 📄 Description > 🤖 Opened by matyden's AI agent (Claude Code), not by matyden. ## What and why `tools/port_publish.py` `issue()` writes the issue body to a temporary file in the system's code page, and `gh issue create/edit --body-file` reads that file as UTF-8. On Windows (cp1251 here) a body with `→`, which every `facts` item has (`- key: a → b`), raises `UnicodeEncodeError` before `gh` runs; with a code page that can encode the character, `gh` would publish it garbled. The file is now written as UTF-8. The same bug makes `tests/test_port_publish.py` `test_apply_lists_the_new_issue_numbers_in_the_tracking_issue` fail on Windows without `PYTHONUTF8`, so every self-check block from a Windows machine shows a ❌ in "Python tests" for an unchanged main. #3587's description lists this fix, but its merged diff only touches `tools/roadmap.py` and `tests/test_roadmap.py`, and 479f53624 made `gh()` decode `gh`'s output as UTF-8, not write the body file. This is the line that was left out. ## Vanilla reference none (tooling). ## Self-check **pr_ready** (`tools/pr_ready.py --quick --base upstream/main` on WIN-TU836SRDD9A, against upstream/main at 668419b92, 1 min 8 s) | Check | Result | | --- | --- | | Scope | ✅ 1 files, +2 −1 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 423 passed (1 min 7 s) | | rustfmt | ➖ no Rust change | | clippy | ➖ no Rust change | | tests | ➖ no crate touched | | doc tests | ➖ no crate touched | | content root tests | ➖ content root untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ not run (--quick): CI's parity job picks the affected harnesses | | Label | `skip-release` | Run on Windows without `PYTHONUTF8`. Before this change the same run had 1 error in Python tests (the `UnicodeEncodeError` above); now all 423 pass. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:11:23 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#5268
No description provided.