From a9857e396aab83b6539792628fe37cdd9cebf82a Mon Sep 17 00:00:00 2001 From: John Zhou Date: Tue, 22 Apr 2025 21:01:42 -0500 Subject: [PATCH 1/4] test: Resolve situation on iOS regarding fd_count. macOS Sonoma seems to have issues with support.fd_count, at gh-109981. However, after experimenting using macOS Sonoma on an attempt to support visionOS unofficially through another project, the simulator is hard-crashing, leading to the con- clusion that this probably applies on all Apple platforms. Hence this patch. --- Lib/test/support/os_helper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/test/support/os_helper.py b/Lib/test/support/os_helper.py index d82093e375c8b1..2c45fe2369ec36 100644 --- a/Lib/test/support/os_helper.py +++ b/Lib/test/support/os_helper.py @@ -657,7 +657,7 @@ def fd_count(): """ if sys.platform.startswith(('linux', 'android', 'freebsd', 'emscripten')): fd_path = "/proc/self/fd" - elif sys.platform == "darwin": + elif support.is_apple: fd_path = "/dev/fd" else: fd_path = None From 41ebe710ee89388a6ccbe41ff9a541d2d42d7ace Mon Sep 17 00:00:00 2001 From: John Zhou Date: Tue, 22 Apr 2025 21:20:41 -0500 Subject: [PATCH 2/4] trigger ci From 2ba9225898c7ff20b716d9a58f36089dd731d769 Mon Sep 17 00:00:00 2001 From: "blurb-it[bot]" <43283697+blurb-it[bot]@users.noreply.github.com> Date: Wed, 23 Apr 2025 02:23:38 +0000 Subject: [PATCH 3/4] =?UTF-8?q?=F0=9F=93=9C=F0=9F=A4=96=20Added=20by=20blu?= =?UTF-8?q?rb=5Fit.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Tests/2025-04-23-02-23-37.gh-issue-109981.IX3k8p.rst | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 Misc/NEWS.d/next/Tests/2025-04-23-02-23-37.gh-issue-109981.IX3k8p.rst diff --git a/Misc/NEWS.d/next/Tests/2025-04-23-02-23-37.gh-issue-109981.IX3k8p.rst b/Misc/NEWS.d/next/Tests/2025-04-23-02-23-37.gh-issue-109981.IX3k8p.rst new file mode 100644 index 00000000000000..216cfd78f5fcd7 --- /dev/null +++ b/Misc/NEWS.d/next/Tests/2025-04-23-02-23-37.gh-issue-109981.IX3k8p.rst @@ -0,0 +1,5 @@ +Use ``/dev/fd`` on other Apple platforms, in addition to macOS, to determine +the number of open files in ``test.support.os_helper.fd_count`` to avoid a crash +with "guarded" file descriptors when probing for open files. + +The text for this entry is adapted from the previous one fixing the issue for macOS. From 909c332ffbbc0c4d8a76f19dc25028dab416fc8e Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Wed, 23 Apr 2025 10:58:02 +0800 Subject: [PATCH 4/4] Small tweak to release note. --- .../Tests/2025-04-23-02-23-37.gh-issue-109981.IX3k8p.rst | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Misc/NEWS.d/next/Tests/2025-04-23-02-23-37.gh-issue-109981.IX3k8p.rst b/Misc/NEWS.d/next/Tests/2025-04-23-02-23-37.gh-issue-109981.IX3k8p.rst index 216cfd78f5fcd7..175615258303bd 100644 --- a/Misc/NEWS.d/next/Tests/2025-04-23-02-23-37.gh-issue-109981.IX3k8p.rst +++ b/Misc/NEWS.d/next/Tests/2025-04-23-02-23-37.gh-issue-109981.IX3k8p.rst @@ -1,5 +1,3 @@ -Use ``/dev/fd`` on other Apple platforms, in addition to macOS, to determine -the number of open files in ``test.support.os_helper.fd_count`` to avoid a crash -with "guarded" file descriptors when probing for open files. - -The text for this entry is adapted from the previous one fixing the issue for macOS. +The test helper that counts the list of open file descriptors now uses the +optimised ``/dev/fd`` approach on all Apple platforms, not just macOS. +This avoids crashes caused by guarded file descriptors.