From b787a963474545e11f5d30ab583e5df48dfa26d2 Mon Sep 17 00:00:00 2001 From: Pieter Viljoen Date: Thu, 15 Oct 2026 21:51:46 -0700 Subject: [PATCH 1/5] State the Subprocess Encoding Rule in the Python Style Reference A text-mode subprocess call that names no encoding decodes with the locale encoding, which is UTF-8 on Linux and a legacy code page on Windows, so the omission passes on Linux and misreads non-ASCII output on a Windows host, and no linter in the toolchain checks for it. State the rule and its reason under the python-codestyle Skill's patterns to avoid, where CODESTYLE.md says the Python rules live, so every carrier reads it, and regenerate the distributions. Co-Authored-By: Claude Opus 5.5 --- .agents/skills/python-codestyle/references/code-style.md | 8 ++++++++ .../fleet-skills/.source-digests/python-codestyle | 2 +- .../skills/python-codestyle/references/code-style.md | 8 ++++++++ .github/skills/python-codestyle/references/code-style.md | 8 ++++++++ 4 files changed, 25 insertions(+), 1 deletion(-) diff --git a/.agents/skills/python-codestyle/references/code-style.md b/.agents/skills/python-codestyle/references/code-style.md index fb28bb428..fd2f02318 100644 --- a/.agents/skills/python-codestyle/references/code-style.md +++ b/.agents/skills/python-codestyle/references/code-style.md @@ -87,6 +87,14 @@ - **Don't use exceptions for expected control flow.** Exceptions are for unexpected states. - **Don't suppress errors silently** (`except Exception: pass`). Either handle the specific exception and document why it's safe, or let it propagate. +- **Don't leave a text-mode `subprocess` call to the locale's encoding.** Every call that reads + or writes a pipe as text (`text=True`, `universal_newlines=True`, or an `errors` argument) names + its `encoding`. A call that names none decodes with the locale encoding, which is UTF-8 on Linux + and a legacy code page on Windows, so the omission looks correct on Linux and misreads non-ASCII + output on a Windows host. No rule in the ruff, pyright, or mypy toolchain checks a subprocess + call for it, so naming the encoding is the only guard. Naming it settles how the bytes are read, + not what a byte outside that encoding is worth. Each call decides that with its own `errors` + argument, and the strict default decides it by raising. diff --git a/.claude-plugin/fleet-skills/.source-digests/python-codestyle b/.claude-plugin/fleet-skills/.source-digests/python-codestyle index 0148f2b35..8ab9c018a 100644 --- a/.claude-plugin/fleet-skills/.source-digests/python-codestyle +++ b/.claude-plugin/fleet-skills/.source-digests/python-codestyle @@ -1 +1 @@ -78b687fa4e03cda7 +7fcc5a05ab99ad36 diff --git a/.claude-plugin/fleet-skills/skills/python-codestyle/references/code-style.md b/.claude-plugin/fleet-skills/skills/python-codestyle/references/code-style.md index fb28bb428..fd2f02318 100644 --- a/.claude-plugin/fleet-skills/skills/python-codestyle/references/code-style.md +++ b/.claude-plugin/fleet-skills/skills/python-codestyle/references/code-style.md @@ -87,6 +87,14 @@ - **Don't use exceptions for expected control flow.** Exceptions are for unexpected states. - **Don't suppress errors silently** (`except Exception: pass`). Either handle the specific exception and document why it's safe, or let it propagate. +- **Don't leave a text-mode `subprocess` call to the locale's encoding.** Every call that reads + or writes a pipe as text (`text=True`, `universal_newlines=True`, or an `errors` argument) names + its `encoding`. A call that names none decodes with the locale encoding, which is UTF-8 on Linux + and a legacy code page on Windows, so the omission looks correct on Linux and misreads non-ASCII + output on a Windows host. No rule in the ruff, pyright, or mypy toolchain checks a subprocess + call for it, so naming the encoding is the only guard. Naming it settles how the bytes are read, + not what a byte outside that encoding is worth. Each call decides that with its own `errors` + argument, and the strict default decides it by raising. diff --git a/.github/skills/python-codestyle/references/code-style.md b/.github/skills/python-codestyle/references/code-style.md index fb28bb428..fd2f02318 100644 --- a/.github/skills/python-codestyle/references/code-style.md +++ b/.github/skills/python-codestyle/references/code-style.md @@ -87,6 +87,14 @@ - **Don't use exceptions for expected control flow.** Exceptions are for unexpected states. - **Don't suppress errors silently** (`except Exception: pass`). Either handle the specific exception and document why it's safe, or let it propagate. +- **Don't leave a text-mode `subprocess` call to the locale's encoding.** Every call that reads + or writes a pipe as text (`text=True`, `universal_newlines=True`, or an `errors` argument) names + its `encoding`. A call that names none decodes with the locale encoding, which is UTF-8 on Linux + and a legacy code page on Windows, so the omission looks correct on Linux and misreads non-ASCII + output on a Windows host. No rule in the ruff, pyright, or mypy toolchain checks a subprocess + call for it, so naming the encoding is the only guard. Naming it settles how the bytes are read, + not what a byte outside that encoding is worth. Each call decides that with its own `errors` + argument, and the strict default decides it by raising. From 9dbef04dc71d9913d7ecda23486b8e38c199bdcd Mon Sep 17 00:00:00 2001 From: Pieter Viljoen Date: Thu, 15 Oct 2026 21:54:26 -0700 Subject: [PATCH 2/5] Bound the Encoding Rule's Reason to the Default Text Encoding The locale encoding is only the default below Python 3.15 and outside UTF-8 Mode, and a runtime warning exists even though no static check does, so state the reason with that bound and drop the claim that naming the encoding is the only guard. Split the long sentence. Co-Authored-By: Claude Opus 5.5 --- .../skills/python-codestyle/references/code-style.md | 12 ++++++------ .../fleet-skills/.source-digests/python-codestyle | 2 +- .../skills/python-codestyle/references/code-style.md | 12 ++++++------ .../skills/python-codestyle/references/code-style.md | 12 ++++++------ 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/.agents/skills/python-codestyle/references/code-style.md b/.agents/skills/python-codestyle/references/code-style.md index fd2f02318..b8cf097b4 100644 --- a/.agents/skills/python-codestyle/references/code-style.md +++ b/.agents/skills/python-codestyle/references/code-style.md @@ -89,12 +89,12 @@ exception and document why it's safe, or let it propagate. - **Don't leave a text-mode `subprocess` call to the locale's encoding.** Every call that reads or writes a pipe as text (`text=True`, `universal_newlines=True`, or an `errors` argument) names - its `encoding`. A call that names none decodes with the locale encoding, which is UTF-8 on Linux - and a legacy code page on Windows, so the omission looks correct on Linux and misreads non-ASCII - output on a Windows host. No rule in the ruff, pyright, or mypy toolchain checks a subprocess - call for it, so naming the encoding is the only guard. Naming it settles how the bytes are read, - not what a byte outside that encoding is worth. Each call decides that with its own `errors` - argument, and the strict default decides it by raising. + its `encoding`. Below Python 3.15, a call that names none decodes with the locale encoding unless + UTF-8 Mode is on. That encoding is UTF-8 on Linux and a legacy code page on Windows. The omission + therefore looks correct on Linux and misreads non-ASCII output on a Windows host. No static check + in the ruff, pyright, or mypy toolchain looks for the omission in a subprocess call. Naming the + encoding settles how the bytes are read, not what a byte outside that encoding is worth. Each + call decides that with its own `errors` argument, and the strict default decides it by raising. diff --git a/.claude-plugin/fleet-skills/.source-digests/python-codestyle b/.claude-plugin/fleet-skills/.source-digests/python-codestyle index 8ab9c018a..bcf81a8ac 100644 --- a/.claude-plugin/fleet-skills/.source-digests/python-codestyle +++ b/.claude-plugin/fleet-skills/.source-digests/python-codestyle @@ -1 +1 @@ -7fcc5a05ab99ad36 +c92a12d7424ad8ef diff --git a/.claude-plugin/fleet-skills/skills/python-codestyle/references/code-style.md b/.claude-plugin/fleet-skills/skills/python-codestyle/references/code-style.md index fd2f02318..b8cf097b4 100644 --- a/.claude-plugin/fleet-skills/skills/python-codestyle/references/code-style.md +++ b/.claude-plugin/fleet-skills/skills/python-codestyle/references/code-style.md @@ -89,12 +89,12 @@ exception and document why it's safe, or let it propagate. - **Don't leave a text-mode `subprocess` call to the locale's encoding.** Every call that reads or writes a pipe as text (`text=True`, `universal_newlines=True`, or an `errors` argument) names - its `encoding`. A call that names none decodes with the locale encoding, which is UTF-8 on Linux - and a legacy code page on Windows, so the omission looks correct on Linux and misreads non-ASCII - output on a Windows host. No rule in the ruff, pyright, or mypy toolchain checks a subprocess - call for it, so naming the encoding is the only guard. Naming it settles how the bytes are read, - not what a byte outside that encoding is worth. Each call decides that with its own `errors` - argument, and the strict default decides it by raising. + its `encoding`. Below Python 3.15, a call that names none decodes with the locale encoding unless + UTF-8 Mode is on. That encoding is UTF-8 on Linux and a legacy code page on Windows. The omission + therefore looks correct on Linux and misreads non-ASCII output on a Windows host. No static check + in the ruff, pyright, or mypy toolchain looks for the omission in a subprocess call. Naming the + encoding settles how the bytes are read, not what a byte outside that encoding is worth. Each + call decides that with its own `errors` argument, and the strict default decides it by raising. diff --git a/.github/skills/python-codestyle/references/code-style.md b/.github/skills/python-codestyle/references/code-style.md index fd2f02318..b8cf097b4 100644 --- a/.github/skills/python-codestyle/references/code-style.md +++ b/.github/skills/python-codestyle/references/code-style.md @@ -89,12 +89,12 @@ exception and document why it's safe, or let it propagate. - **Don't leave a text-mode `subprocess` call to the locale's encoding.** Every call that reads or writes a pipe as text (`text=True`, `universal_newlines=True`, or an `errors` argument) names - its `encoding`. A call that names none decodes with the locale encoding, which is UTF-8 on Linux - and a legacy code page on Windows, so the omission looks correct on Linux and misreads non-ASCII - output on a Windows host. No rule in the ruff, pyright, or mypy toolchain checks a subprocess - call for it, so naming the encoding is the only guard. Naming it settles how the bytes are read, - not what a byte outside that encoding is worth. Each call decides that with its own `errors` - argument, and the strict default decides it by raising. + its `encoding`. Below Python 3.15, a call that names none decodes with the locale encoding unless + UTF-8 Mode is on. That encoding is UTF-8 on Linux and a legacy code page on Windows. The omission + therefore looks correct on Linux and misreads non-ASCII output on a Windows host. No static check + in the ruff, pyright, or mypy toolchain looks for the omission in a subprocess call. Naming the + encoding settles how the bytes are read, not what a byte outside that encoding is worth. Each + call decides that with its own `errors` argument, and the strict default decides it by raising. From 1974fa903b6bcb8c87dec08484665b0241888949 Mon Sep 17 00:00:00 2001 From: Pieter Viljoen Date: Thu, 15 Oct 2026 22:10:17 -0700 Subject: [PATCH 3/5] Say the Default Encoding Follows the Host's Locale The locale encoding is UTF-8 on an ordinary Linux host rather than on every one, so state that it follows the locale and that the omission misreads or rejects non-ASCII output on any non-UTF-8 host, a Windows host being the common case. Co-Authored-By: Claude Opus 5.5 --- .agents/skills/python-codestyle/references/code-style.md | 5 +++-- .claude-plugin/fleet-skills/.source-digests/python-codestyle | 2 +- .../skills/python-codestyle/references/code-style.md | 5 +++-- .github/skills/python-codestyle/references/code-style.md | 5 +++-- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.agents/skills/python-codestyle/references/code-style.md b/.agents/skills/python-codestyle/references/code-style.md index b8cf097b4..ed93db93c 100644 --- a/.agents/skills/python-codestyle/references/code-style.md +++ b/.agents/skills/python-codestyle/references/code-style.md @@ -90,8 +90,9 @@ - **Don't leave a text-mode `subprocess` call to the locale's encoding.** Every call that reads or writes a pipe as text (`text=True`, `universal_newlines=True`, or an `errors` argument) names its `encoding`. Below Python 3.15, a call that names none decodes with the locale encoding unless - UTF-8 Mode is on. That encoding is UTF-8 on Linux and a legacy code page on Windows. The omission - therefore looks correct on Linux and misreads non-ASCII output on a Windows host. No static check + UTF-8 Mode is on. That encoding follows the host's locale, usually UTF-8 on Linux and the ANSI + code page on Windows. The omission therefore looks correct on a UTF-8 host and misreads or + rejects non-ASCII output on any other, a Windows host being the common case. No static check in the ruff, pyright, or mypy toolchain looks for the omission in a subprocess call. Naming the encoding settles how the bytes are read, not what a byte outside that encoding is worth. Each call decides that with its own `errors` argument, and the strict default decides it by raising. diff --git a/.claude-plugin/fleet-skills/.source-digests/python-codestyle b/.claude-plugin/fleet-skills/.source-digests/python-codestyle index bcf81a8ac..4d3038a64 100644 --- a/.claude-plugin/fleet-skills/.source-digests/python-codestyle +++ b/.claude-plugin/fleet-skills/.source-digests/python-codestyle @@ -1 +1 @@ -c92a12d7424ad8ef +a5c9c0d3542203d0 diff --git a/.claude-plugin/fleet-skills/skills/python-codestyle/references/code-style.md b/.claude-plugin/fleet-skills/skills/python-codestyle/references/code-style.md index b8cf097b4..ed93db93c 100644 --- a/.claude-plugin/fleet-skills/skills/python-codestyle/references/code-style.md +++ b/.claude-plugin/fleet-skills/skills/python-codestyle/references/code-style.md @@ -90,8 +90,9 @@ - **Don't leave a text-mode `subprocess` call to the locale's encoding.** Every call that reads or writes a pipe as text (`text=True`, `universal_newlines=True`, or an `errors` argument) names its `encoding`. Below Python 3.15, a call that names none decodes with the locale encoding unless - UTF-8 Mode is on. That encoding is UTF-8 on Linux and a legacy code page on Windows. The omission - therefore looks correct on Linux and misreads non-ASCII output on a Windows host. No static check + UTF-8 Mode is on. That encoding follows the host's locale, usually UTF-8 on Linux and the ANSI + code page on Windows. The omission therefore looks correct on a UTF-8 host and misreads or + rejects non-ASCII output on any other, a Windows host being the common case. No static check in the ruff, pyright, or mypy toolchain looks for the omission in a subprocess call. Naming the encoding settles how the bytes are read, not what a byte outside that encoding is worth. Each call decides that with its own `errors` argument, and the strict default decides it by raising. diff --git a/.github/skills/python-codestyle/references/code-style.md b/.github/skills/python-codestyle/references/code-style.md index b8cf097b4..ed93db93c 100644 --- a/.github/skills/python-codestyle/references/code-style.md +++ b/.github/skills/python-codestyle/references/code-style.md @@ -90,8 +90,9 @@ - **Don't leave a text-mode `subprocess` call to the locale's encoding.** Every call that reads or writes a pipe as text (`text=True`, `universal_newlines=True`, or an `errors` argument) names its `encoding`. Below Python 3.15, a call that names none decodes with the locale encoding unless - UTF-8 Mode is on. That encoding is UTF-8 on Linux and a legacy code page on Windows. The omission - therefore looks correct on Linux and misreads non-ASCII output on a Windows host. No static check + UTF-8 Mode is on. That encoding follows the host's locale, usually UTF-8 on Linux and the ANSI + code page on Windows. The omission therefore looks correct on a UTF-8 host and misreads or + rejects non-ASCII output on any other, a Windows host being the common case. No static check in the ruff, pyright, or mypy toolchain looks for the omission in a subprocess call. Naming the encoding settles how the bytes are read, not what a byte outside that encoding is worth. Each call decides that with its own `errors` argument, and the strict default decides it by raising. From e0af782a8af39d3fdbf29b18020b5a33353e3cbf Mon Sep 17 00:00:00 2001 From: Pieter Viljoen Date: Thu, 15 Oct 2026 22:11:17 -0700 Subject: [PATCH 4/5] Tie the Misread to a Child Writing UTF-8, Not to the Host Alone The default misreads only when the child writes an encoding other than the locale's, so the rule now asks for the encoding the child actually writes and states that precondition on the failure. Co-Authored-By: Claude Opus 5.5 --- .../python-codestyle/references/code-style.md | 15 ++++++++------- .../fleet-skills/.source-digests/python-codestyle | 2 +- .../python-codestyle/references/code-style.md | 15 ++++++++------- .../python-codestyle/references/code-style.md | 15 ++++++++------- 4 files changed, 25 insertions(+), 22 deletions(-) diff --git a/.agents/skills/python-codestyle/references/code-style.md b/.agents/skills/python-codestyle/references/code-style.md index ed93db93c..5f6ee4124 100644 --- a/.agents/skills/python-codestyle/references/code-style.md +++ b/.agents/skills/python-codestyle/references/code-style.md @@ -89,13 +89,14 @@ exception and document why it's safe, or let it propagate. - **Don't leave a text-mode `subprocess` call to the locale's encoding.** Every call that reads or writes a pipe as text (`text=True`, `universal_newlines=True`, or an `errors` argument) names - its `encoding`. Below Python 3.15, a call that names none decodes with the locale encoding unless - UTF-8 Mode is on. That encoding follows the host's locale, usually UTF-8 on Linux and the ANSI - code page on Windows. The omission therefore looks correct on a UTF-8 host and misreads or - rejects non-ASCII output on any other, a Windows host being the common case. No static check - in the ruff, pyright, or mypy toolchain looks for the omission in a subprocess call. Naming the - encoding settles how the bytes are read, not what a byte outside that encoding is worth. Each - call decides that with its own `errors` argument, and the strict default decides it by raising. + the encoding its child actually writes. Below Python 3.15, a call that names none decodes with + the locale encoding unless UTF-8 Mode is on. That encoding follows the host's locale, usually + UTF-8 on Linux and the ANSI code page on Windows. The omission therefore looks correct on a UTF-8 + host. On any other, a Windows host being the common case, it misreads or rejects non-ASCII output + from a child writing UTF-8. No static check in the ruff, pyright, or mypy toolchain looks for the + omission in a subprocess call. Naming the encoding settles how the bytes are read, not what a + byte outside that encoding is worth. Each call decides that with its own `errors` argument, and + the strict default decides it by raising. diff --git a/.claude-plugin/fleet-skills/.source-digests/python-codestyle b/.claude-plugin/fleet-skills/.source-digests/python-codestyle index 4d3038a64..7abd1caab 100644 --- a/.claude-plugin/fleet-skills/.source-digests/python-codestyle +++ b/.claude-plugin/fleet-skills/.source-digests/python-codestyle @@ -1 +1 @@ -a5c9c0d3542203d0 +09c1e0aa8c51dbf4 diff --git a/.claude-plugin/fleet-skills/skills/python-codestyle/references/code-style.md b/.claude-plugin/fleet-skills/skills/python-codestyle/references/code-style.md index ed93db93c..5f6ee4124 100644 --- a/.claude-plugin/fleet-skills/skills/python-codestyle/references/code-style.md +++ b/.claude-plugin/fleet-skills/skills/python-codestyle/references/code-style.md @@ -89,13 +89,14 @@ exception and document why it's safe, or let it propagate. - **Don't leave a text-mode `subprocess` call to the locale's encoding.** Every call that reads or writes a pipe as text (`text=True`, `universal_newlines=True`, or an `errors` argument) names - its `encoding`. Below Python 3.15, a call that names none decodes with the locale encoding unless - UTF-8 Mode is on. That encoding follows the host's locale, usually UTF-8 on Linux and the ANSI - code page on Windows. The omission therefore looks correct on a UTF-8 host and misreads or - rejects non-ASCII output on any other, a Windows host being the common case. No static check - in the ruff, pyright, or mypy toolchain looks for the omission in a subprocess call. Naming the - encoding settles how the bytes are read, not what a byte outside that encoding is worth. Each - call decides that with its own `errors` argument, and the strict default decides it by raising. + the encoding its child actually writes. Below Python 3.15, a call that names none decodes with + the locale encoding unless UTF-8 Mode is on. That encoding follows the host's locale, usually + UTF-8 on Linux and the ANSI code page on Windows. The omission therefore looks correct on a UTF-8 + host. On any other, a Windows host being the common case, it misreads or rejects non-ASCII output + from a child writing UTF-8. No static check in the ruff, pyright, or mypy toolchain looks for the + omission in a subprocess call. Naming the encoding settles how the bytes are read, not what a + byte outside that encoding is worth. Each call decides that with its own `errors` argument, and + the strict default decides it by raising. diff --git a/.github/skills/python-codestyle/references/code-style.md b/.github/skills/python-codestyle/references/code-style.md index ed93db93c..5f6ee4124 100644 --- a/.github/skills/python-codestyle/references/code-style.md +++ b/.github/skills/python-codestyle/references/code-style.md @@ -89,13 +89,14 @@ exception and document why it's safe, or let it propagate. - **Don't leave a text-mode `subprocess` call to the locale's encoding.** Every call that reads or writes a pipe as text (`text=True`, `universal_newlines=True`, or an `errors` argument) names - its `encoding`. Below Python 3.15, a call that names none decodes with the locale encoding unless - UTF-8 Mode is on. That encoding follows the host's locale, usually UTF-8 on Linux and the ANSI - code page on Windows. The omission therefore looks correct on a UTF-8 host and misreads or - rejects non-ASCII output on any other, a Windows host being the common case. No static check - in the ruff, pyright, or mypy toolchain looks for the omission in a subprocess call. Naming the - encoding settles how the bytes are read, not what a byte outside that encoding is worth. Each - call decides that with its own `errors` argument, and the strict default decides it by raising. + the encoding its child actually writes. Below Python 3.15, a call that names none decodes with + the locale encoding unless UTF-8 Mode is on. That encoding follows the host's locale, usually + UTF-8 on Linux and the ANSI code page on Windows. The omission therefore looks correct on a UTF-8 + host. On any other, a Windows host being the common case, it misreads or rejects non-ASCII output + from a child writing UTF-8. No static check in the ruff, pyright, or mypy toolchain looks for the + omission in a subprocess call. Naming the encoding settles how the bytes are read, not what a + byte outside that encoding is worth. Each call decides that with its own `errors` argument, and + the strict default decides it by raising. From 11691d410da303add6e5e61402e1db69c6fe36d5 Mon Sep 17 00:00:00 2001 From: Pieter Viljoen Date: Thu, 15 Oct 2026 22:12:53 -0700 Subject: [PATCH 5/5] Cover the Write Direction of a Text Pipe in the Encoding Rule A call that only feeds a child's stdin is in scope too, so the rule names the encoding the child uses on that pipe rather than only the one it writes, and the errors sentence covers a character outside the encoding as well as a byte. Co-Authored-By: Claude Opus 5.5 --- .../python-codestyle/references/code-style.md | 16 ++++++++-------- .../.source-digests/python-codestyle | 2 +- .../python-codestyle/references/code-style.md | 16 ++++++++-------- .../python-codestyle/references/code-style.md | 16 ++++++++-------- 4 files changed, 25 insertions(+), 25 deletions(-) diff --git a/.agents/skills/python-codestyle/references/code-style.md b/.agents/skills/python-codestyle/references/code-style.md index 5f6ee4124..cca918e1b 100644 --- a/.agents/skills/python-codestyle/references/code-style.md +++ b/.agents/skills/python-codestyle/references/code-style.md @@ -89,14 +89,14 @@ exception and document why it's safe, or let it propagate. - **Don't leave a text-mode `subprocess` call to the locale's encoding.** Every call that reads or writes a pipe as text (`text=True`, `universal_newlines=True`, or an `errors` argument) names - the encoding its child actually writes. Below Python 3.15, a call that names none decodes with - the locale encoding unless UTF-8 Mode is on. That encoding follows the host's locale, usually - UTF-8 on Linux and the ANSI code page on Windows. The omission therefore looks correct on a UTF-8 - host. On any other, a Windows host being the common case, it misreads or rejects non-ASCII output - from a child writing UTF-8. No static check in the ruff, pyright, or mypy toolchain looks for the - omission in a subprocess call. Naming the encoding settles how the bytes are read, not what a - byte outside that encoding is worth. Each call decides that with its own `errors` argument, and - the strict default decides it by raising. + the encoding its child uses on that pipe. Below Python 3.15, a call that names none encodes and + decodes with the locale encoding unless UTF-8 Mode is on. That encoding follows the host's + locale, usually UTF-8 on Linux and the ANSI code page on Windows. The omission therefore looks + correct on a UTF-8 host. On any other, a Windows host being the common case, it misreads or + rejects non-ASCII output from a child writing UTF-8. No static check in the ruff, pyright, or + mypy toolchain looks for the omission in a subprocess call. Naming the encoding settles how the + bytes are translated, not what a byte or character outside that encoding is worth. Each call + decides that with its own `errors` argument, and the strict default decides it by raising. diff --git a/.claude-plugin/fleet-skills/.source-digests/python-codestyle b/.claude-plugin/fleet-skills/.source-digests/python-codestyle index 7abd1caab..75e738476 100644 --- a/.claude-plugin/fleet-skills/.source-digests/python-codestyle +++ b/.claude-plugin/fleet-skills/.source-digests/python-codestyle @@ -1 +1 @@ -09c1e0aa8c51dbf4 +a54a634cf8810359 diff --git a/.claude-plugin/fleet-skills/skills/python-codestyle/references/code-style.md b/.claude-plugin/fleet-skills/skills/python-codestyle/references/code-style.md index 5f6ee4124..cca918e1b 100644 --- a/.claude-plugin/fleet-skills/skills/python-codestyle/references/code-style.md +++ b/.claude-plugin/fleet-skills/skills/python-codestyle/references/code-style.md @@ -89,14 +89,14 @@ exception and document why it's safe, or let it propagate. - **Don't leave a text-mode `subprocess` call to the locale's encoding.** Every call that reads or writes a pipe as text (`text=True`, `universal_newlines=True`, or an `errors` argument) names - the encoding its child actually writes. Below Python 3.15, a call that names none decodes with - the locale encoding unless UTF-8 Mode is on. That encoding follows the host's locale, usually - UTF-8 on Linux and the ANSI code page on Windows. The omission therefore looks correct on a UTF-8 - host. On any other, a Windows host being the common case, it misreads or rejects non-ASCII output - from a child writing UTF-8. No static check in the ruff, pyright, or mypy toolchain looks for the - omission in a subprocess call. Naming the encoding settles how the bytes are read, not what a - byte outside that encoding is worth. Each call decides that with its own `errors` argument, and - the strict default decides it by raising. + the encoding its child uses on that pipe. Below Python 3.15, a call that names none encodes and + decodes with the locale encoding unless UTF-8 Mode is on. That encoding follows the host's + locale, usually UTF-8 on Linux and the ANSI code page on Windows. The omission therefore looks + correct on a UTF-8 host. On any other, a Windows host being the common case, it misreads or + rejects non-ASCII output from a child writing UTF-8. No static check in the ruff, pyright, or + mypy toolchain looks for the omission in a subprocess call. Naming the encoding settles how the + bytes are translated, not what a byte or character outside that encoding is worth. Each call + decides that with its own `errors` argument, and the strict default decides it by raising. diff --git a/.github/skills/python-codestyle/references/code-style.md b/.github/skills/python-codestyle/references/code-style.md index 5f6ee4124..cca918e1b 100644 --- a/.github/skills/python-codestyle/references/code-style.md +++ b/.github/skills/python-codestyle/references/code-style.md @@ -89,14 +89,14 @@ exception and document why it's safe, or let it propagate. - **Don't leave a text-mode `subprocess` call to the locale's encoding.** Every call that reads or writes a pipe as text (`text=True`, `universal_newlines=True`, or an `errors` argument) names - the encoding its child actually writes. Below Python 3.15, a call that names none decodes with - the locale encoding unless UTF-8 Mode is on. That encoding follows the host's locale, usually - UTF-8 on Linux and the ANSI code page on Windows. The omission therefore looks correct on a UTF-8 - host. On any other, a Windows host being the common case, it misreads or rejects non-ASCII output - from a child writing UTF-8. No static check in the ruff, pyright, or mypy toolchain looks for the - omission in a subprocess call. Naming the encoding settles how the bytes are read, not what a - byte outside that encoding is worth. Each call decides that with its own `errors` argument, and - the strict default decides it by raising. + the encoding its child uses on that pipe. Below Python 3.15, a call that names none encodes and + decodes with the locale encoding unless UTF-8 Mode is on. That encoding follows the host's + locale, usually UTF-8 on Linux and the ANSI code page on Windows. The omission therefore looks + correct on a UTF-8 host. On any other, a Windows host being the common case, it misreads or + rejects non-ASCII output from a child writing UTF-8. No static check in the ruff, pyright, or + mypy toolchain looks for the omission in a subprocess call. Naming the encoding settles how the + bytes are translated, not what a byte or character outside that encoding is worth. Each call + decides that with its own `errors` argument, and the strict default decides it by raising.