MAINT: Post-v1.0.1 release follow-ups for main - #2298
Open
romanlutz wants to merge 2 commits into
Open
Conversation
Release-metadata follow-up for the v1.0.1 patch release (step 10 of doc/contributing/10_release_process.md): - Bump `default:` and `stable:` from 1.0.0 to 1.0.1 so the site root and the /stable/ alias serve the latest release. - Replace the `1.0.0` entry under `versions:` with `1.0.1` (ref releases/v1.0.1) instead of listing both. Note on replace-vs-add-both: the file already lists 0.12.1 but not 0.12.0, so superseded patch versions do not appear to be kept in the picker. That precedent is suggestive but not conclusive -- the file was seeded with 0.12.1 already present, so it never demonstrably went through an add-then-replace cycle. If you would rather keep both 1.0.0 and 1.0.1 in the picker, re-add the 1.0.0 entry during review. Validated with build_scripts/resolve_docs_matrix.py, the same script .github/workflows/docs.yml uses to derive the build matrix. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: a008124c-220e-491c-9ea1-2144867ba53d
On Windows, Python encodes sys.stdout with the legacy ANSI code page
(cp1252) whenever stdout is not a true Win32 console -- piped,
redirected, or captured by CI. The script prints non-ASCII status glyphs
(U+2713, U+274C, U+2705) that cp1252 cannot represent, so the print
raises UnicodeEncodeError.
Observed failure: `uv run python build_scripts/prepare_package.py`
crashed on `print("\u2713 Dependencies installed")` right after npm
install had succeeded. The exception propagated out of build_frontend()
and killed main(), so the copy step never ran and pyrit/backend/frontend
was never populated -- a decorative character turned a working build
into a hard failure. The failure-path prints are worse still: a genuine
frontend build error would have been masked by an unrelated encoding
traceback.
Reconfigure stdout/stderr to UTF-8 with errors="replace" at the start of
main(), guarded for streams that are None (pythonw) or lack
reconfigure(). This keeps the glyphs rather than downgrading them to
ASCII markers, and fixes every affected print at once.
Verified on Windows with stdout piped and no PYTHONUTF8/PYTHONIOENCODING
set: sys.stdout.encoding is cp1252 before the call and utf-8 after, all
six glyph messages emit cleanly, and an A/B run of main() with the new
helper stubbed out reproduces the original UnicodeEncodeError.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: a008124c-220e-491c-9ea1-2144867ba53d
jsong468
approved these changes
Jul 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Post-release follow-ups for
mainafter the v1.0.1 patch release, plus one pre-existing build bug found while running the release process. Two independent commits.1. Point the docs site at v1.0.1 (
.github/docs-versions.yml)Step 10 of
doc/contributing/10_release_process.md. Bumpsdefault:andstable:from1.0.0to1.0.1so the site root and the/stable/alias serve the latest release, and updates theversions:list to point atreleases/v1.0.1.Judgment call worth a reviewer's eye: I replaced the
1.0.0entry rather than listing both. The file already lists0.12.1but not0.12.0, so superseded patch versions do not appear to be kept in the picker. That precedent is suggestive but not conclusive — the file was seeded with0.12.1already present, so it never demonstrably went through an add-then-replace cycle. If we'd rather keep both1.0.0and1.0.1in the picker, re-adding the entry is a 3-line change.Note the version bump to
1.1.0.dev0(the other half of step 10) is already onmain, anduv.lock/frontend/package-lock.jsonagree with it, so nothing was needed there. The only reference to "the latest release" anywhere in the codebase was this file; other1.0.0matches are unrelated (harm-category taxonomy version, ARM templatecontentVersion, dependency floors, historical prose, test fixtures) and were left alone.2. Fix a Unicode crash in
build_scripts/prepare_package.pyPre-existing bug on
mainthat breaks Windows release builds whenever stdout is not a true Win32 console — piped, redirected, or captured by CI.On Windows, Python encodes
sys.stdoutwith the legacy ANSI code page (cp1252) when stdout is not a console. The script prints non-ASCII status glyphs (✓,❌,✅) that cp1252 cannot represent, so theprintraisesUnicodeEncodeError.This is not cosmetic. Observed during the v1.0.1 release: the script crashed on
print("✓ Dependencies installed")immediately afternpm installhad succeeded. The exception propagated out ofbuild_frontend()and killedmain(), so the copy step never ran andpyrit/backend/frontend/was never populated — a decorative character turned a working build into a hard failure. The two failure-path prints are worse still: a genuine frontend build error would have been masked by an unrelated encoding traceback.Fix is to make stdout robust rather than strip the glyphs — a small
_configure_utf8_stdio()helper called at the top ofmain()reconfigures stdout/stderr to UTF-8 witherrors="replace", guarded for streams that areNone(pythonw) or lackreconfigure(). This fixes all six affected prints at once and keeps future non-ASCII output safe. Self-contained, +21 lines, no behavior change beyond encoding.Tests and Documentation
No new tests — this is release metadata plus a build-script fix, neither of which is covered by the test suite. No test suite run was warranted since no library code changed. JupyText not run: no docs
.py/.ipynbfiles touched.Validation performed:
docs-versions.ymlparsed withbuild_scripts/resolve_docs_matrix.py, the same script.github/workflows/docs.ymluses to derive the build matrix →default=1.0.1,stable=1.0.1, matrix[latest, 1.0.1, 0.14.0, 0.13.0, 0.12.1]. Itsload_configalso validates thatdefault/stableare among the version slugs, so a mismatch would have failed the check.PYTHONUTF8/PYTHONIOENCODINGboth unset:sys.stdout.encodingiscp1252; printing\u2713raisesUnicodeEncodeError: 'charmap' codec can't encode character '\u2713'.cp1252→utf-8and all six affected messages emit cleanly.sys.stdout = Noneand aStringIOwithoutreconfigureboth no-op safely.prepare_package.main()piped returns 0 and prints the ✓/✅ messages; the same run with the new helper stubbed to a no-op reproduces the originalUnicodeEncodeError. Same code, fix on/off, crash on/off.uv run python build_scripts/prepare_package.py 2>&1 | Select-Object -Last 18, piped: completes green withEXIT=0through✓ Dependencies installed→✓ Frontend built successfully→✅ Package preparation complete!. A separate run wherenpm installgenuinely failed printed❌ Failed to build frontendand returned 1 with no encoding traceback — i.e. the previously-masked failure path now surfaces the real error.ruff format,ruff check, andtyall pass; full pre-commit ran clean on both commits.