Fix FileStorage on Windows: open fd with O_BINARY, UTF-8 release logs
release / build-wheels (linux, bash) (push) Successful in 1m13s
release / build-wheels (windows, cmd) (push) Successful in 1m20s
release / build-wheels (macos, bash) (push) Successful in 1m26s
release / publish-pypi (push) Failing after 2s

os.open() on Windows defaults to O_TEXT, so the CRT translated \r\n in
binary ciphertext: writes grew, offsets shifted, reads came up short and
the RAF callbacks failed with EIO (probe/read/write depending on where
a 0x0A byte landed). Pass O_BINARY where it exists.

Also reconfigure stdout/stderr to UTF-8 in tools/release.py so the
✓/✗/⚠ summary lines don't crash on cp1252 Windows consoles.
This commit is contained in:
LeoVasanko committed 2026-10-04 17:48:34 +00:00
1 parent 59dd4d922f
commit 503ce8e491
2 files changed
+8

No files matched your search

+5
View File
@@ -305,6 +305,11 @@ def run_benchmark(wheel: Path, py_version: str) -> bool:
def main():
"""Build wheels for all supported Python versions."""
# Windows CI consoles default to cp1252; emit ✓/✗/⚠ as UTF-8
for stream in (sys.stdout, sys.stderr):
if hasattr(stream, "reconfigure"):
stream.reconfigure(encoding="utf-8", errors="replace")
# CI matrix jobs build per-platform wheels but never upload; a separate
# publish job uploads everything once all platforms have succeeded.
no_upload = "--no-upload" in sys.argv