fix: keep the Python tools and tests on Python 3.9 #7142

Merged
javierUDP merged 1 commit from upstream-pr/7142 into main 2026-10-17 14:25:01 +00:00
javierUDP commented 2026-10-17 13:34:44 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by javierUDP on 2026-10-17T13:34:44Z.


What

Path.write_text(newline=...) and zip(strict=True) were added in Python 3.10. macOS ships 3.9.6 as /usr/bin/python3, which is the interpreter CMake finds on a host without a newer one, so on a stock macOS host:

  • prepare_release_notes.py raises TypeError: write_text() got an unexpected keyword argument 'newline' when the release workflow writes notes.md and the release body, before either file is created.
  • pr_overlap_tools, release_package and linux_fixed_base fail with the same TypeError and with TypeError: zip() takes no keyword arguments.

write_bytes of the encoded text keeps newline translation off on every host, which is what newline="" and newline="\n" asked for, and the dynamic tag lists are compared by length before the pairs are walked.

The relinker-only build documents the minimum interpreter it needs.

A scan of every tracked .py with 3.9 finds no other 3.10 syntax or API: these three files are all of it.

Tested

Apple M5, macOS 26.4, AppleClang 21.0.0, on current main, relinker-only build:

build interpreter before after
arm64 3.9.6 (/usr/bin/python3) 175/178 178/178
x86-64 under Rosetta 3.9.6 175/178 178/178
arm64 3.14.7 178/178 178/178
tools/tests directly 3.9.6 35/37 37/37
tools/tests directly 3.14.7 37/37 37/37

python3 tools/check_conventions.py --base origin/main passes. No Linux or Windows host was available; the change is interpreter-level and the release workflow is unchanged.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file: n/a
  • No notes, investigation .md files or images added to the repository
  • New third-party code is a submodule built from source: n/a
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4900485719 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7142). Originally posted by [javierUDP](https://github.com/javierUDP) on 2026-10-17T13:34:44Z. --- ### What `Path.write_text(newline=...)` and `zip(strict=True)` were added in Python 3.10. macOS ships 3.9.6 as `/usr/bin/python3`, which is the interpreter CMake finds on a host without a newer one, so on a stock macOS host: - `prepare_release_notes.py` raises `TypeError: write_text() got an unexpected keyword argument 'newline'` when the release workflow writes `notes.md` and the release body, before either file is created. - `pr_overlap_tools`, `release_package` and `linux_fixed_base` fail with the same `TypeError` and with `TypeError: zip() takes no keyword arguments`. `write_bytes` of the encoded text keeps newline translation off on every host, which is what `newline=""` and `newline="\n"` asked for, and the dynamic tag lists are compared by length before the pairs are walked. The relinker-only build documents the minimum interpreter it needs. A scan of every tracked `.py` with 3.9 finds no other 3.10 syntax or API: these three files are all of it. ### Tested Apple M5, macOS 26.4, AppleClang 21.0.0, on current `main`, relinker-only build: | build | interpreter | before | after | | --- | --- | --- | --- | | arm64 | 3.9.6 (`/usr/bin/python3`) | 175/178 | 178/178 | | x86-64 under Rosetta | 3.9.6 | 175/178 | 178/178 | | arm64 | 3.14.7 | 178/178 | 178/178 | | `tools/tests` directly | 3.9.6 | 35/37 | 37/37 | | `tools/tests` directly | 3.14.7 | 37/37 | 37/37 | `python3 tools/check_conventions.py --base origin/main` passes. No Linux or Windows host was available; the change is interpreter-level and the release workflow is unchanged. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except technical debt - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's technical debt file: n/a - [x] No notes, investigation `.md` files or images added to the repository - [x] New third-party code is a submodule built from source: n/a - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
github-actions[bot] commented 2026-10-17 13:46:30 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-17T13:46:30Z.


Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
PR 6734 tools/tests/test_pr_overlap.py L303-304, L313
PR 6843 core/relinker/relinker/tests/test_linux_fixed_base.py L107

Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 674 docs/dev/BUILD.md
PR 1835 docs/dev/BUILD.md
PR 5021 docs/dev/BUILD.md
PR 6181 docs/dev/BUILD.md
PR 6413 tools/tests/test_pr_overlap.py
PR 6493 docs/dev/BUILD.md
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6234629476 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7142#issuecomment-6234629476). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-17T13:46:30Z. --- <!-- pr-overlap --> Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in **Depends on**. | Pull request | Conflicting files (lines on `main`) | Same exports | Same new files | |---|---|---|---| | [PR 6734](https://www.github.com/boykopovar/AnyPS5/pull/6734) | `tools/tests/test_pr_overlap.py` [L303-304](https://github.com/boykopovar/AnyPS5/blob/47a266cf975f00f7fba94013467d03bfa5e355e9/tools/tests/test_pr_overlap.py#L303-L304), [L313](https://github.com/boykopovar/AnyPS5/blob/47a266cf975f00f7fba94013467d03bfa5e355e9/tools/tests/test_pr_overlap.py#L313) | | | | [PR 6843](https://www.github.com/boykopovar/AnyPS5/pull/6843) | `core/relinker/relinker/tests/test_linux_fixed_base.py` [L107](https://github.com/boykopovar/AnyPS5/blob/47a266cf975f00f7fba94013467d03bfa5e355e9/core/relinker/relinker/tests/test_linux_fixed_base.py#L107) | | | Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap. | Pull request | Shared files not compared | |---|---| | [PR 674](https://www.github.com/boykopovar/AnyPS5/pull/674) | `docs/dev/BUILD.md` | | [PR 1835](https://www.github.com/boykopovar/AnyPS5/pull/1835) | `docs/dev/BUILD.md` | | [PR 5021](https://www.github.com/boykopovar/AnyPS5/pull/5021) | `docs/dev/BUILD.md` | | [PR 6181](https://www.github.com/boykopovar/AnyPS5/pull/6181) | `docs/dev/BUILD.md` | | [PR 6413](https://www.github.com/boykopovar/AnyPS5/pull/6413) | `tools/tests/test_pr_overlap.py` | | [PR 6493](https://www.github.com/boykopovar/AnyPS5/pull/6493) | `docs/dev/BUILD.md` |
MarcZX10 commented 2026-10-17 14:13:57 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-17T14:13:57Z.


Overlap follow-up: open #6843 already contains the same Python 3.9 compatibility change in test_linux_fixed_base.py (length check before ordinary zip). Your branch includes that behavior along with the release-notes and overlap-tool fixes. The two PRs edit the same test lines, so please coordinate consolidation with #6843’s maintainer; both remain open per the contributor’s instruction.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6234939248 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7142#issuecomment-6234939248). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-17T14:13:57Z. --- Overlap follow-up: open #6843 already contains the same Python 3.9 compatibility change in `test_linux_fixed_base.py` (length check before ordinary `zip`). Your branch includes that behavior along with the release-notes and overlap-tool fixes. The two PRs edit the same test lines, so please coordinate consolidation with #6843’s maintainer; both remain open per the contributor’s instruction.
Sign in to join this conversation.
No reviewers
No labels
No milestone
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.

Reference
boykopovar/AnyPS5!7142
No description provided.