fix(tools): write release notes on Python 3.9 #6728
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/6728"
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-16T07:49:52Z.
What
Python 3.9's
pathlib.Path.write_textdoes not accept thenewlineargument.prepare_notesused it for both output files, making the existingrelease_packageCTest fail on Python 3.9 (including Xcode's bundled Python).Write the UTF-8 encoded bytes directly instead. This preserves exact LF/CRLF content and avoids platform newline translation. The existing
ReleaseNotesTests.test_full_notes_are_preserved_in_assetchecks the full and shortened outputs byte-for-byte.This is independent of #6424's path-alias checks; the two changes touch the same source file but different behavior.
Tested
python3 -I tools/tests/test_package_release.py— 26 tests passed, 3 skipped.python3 tools/check_conventions.py --base upstream/main— passed.Checklist
mainImported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-16T09:33:52Z.
Review: COMMENTED
Ran this with Xcode's Python 3.9 (
/usr/bin/python33.9.6): Apple M2 Max, macOS 27.2. Head5db90df6eonmain5d9dcc42d, relinker-only build (-DANYPS5_RELINKER_ONLY=ON).python3 tools/tests/test_package_release.pywith 3.9.6: onmain, 4 errors (TypeError: write_text() got an unexpected keyword argument 'newline', thetest_full_notes_are_preserved_in_assetsubtests); with this PR, OK (3 skipped, same as on 3.14).-DPython3_EXECUTABLE=/usr/bin/python3:main170/173 (pr_overlap_tools,release_package,linux_fixed_base);release_packagepasses with this PR. With this PR and #6734 together: 172/173.mainand with this PR.The remaining 3.9 failure,
linux_fixed_base, iszip(..., strict=True)incore/relinker/relinker/tests/test_linux_fixed_base.py:107and is not covered by this PR or #6734.Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-16T14:07:16Z.
Thanks for the Python 3.9 run and for identifying linux_fixed_base as the remaining failure outside this PR. #6843 removes its Python 3.10-only zip(strict=True) call while keeping an explicit equal-length assertion. I validated the focused test on Linux/Python 3.11; I could not run Python 3.9 locally.
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-19T08:04:55Z.
Closing:
mainalready contains this change (02c7da767, "keep the Python tools and tests on Python 3.9").tools/prepare_release_notes.pywrites both outputs withwrite_bytes(...encode("utf-8"))there, so this PR's diff against currentmainis empty. Thanks for the fix and the follow-up; feel free to reopen if something is left thatmaindoesn't cover.Pull request closed