diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2023-12-07 10:28:26 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-07 10:28:26 (GMT) |
commit | e21a7a976a7e3368dc1eba0895e15c47cb06c810 (patch) | |
tree | 16f902177dd09513ae67618b54138fb11e562b7c /Misc | |
parent | ca11aec98c39a08da858a1270b13b7e3ae6aa53b (diff) | |
download | cpython-e21a7a976a7e3368dc1eba0895e15c47cb06c810.zip cpython-e21a7a976a7e3368dc1eba0895e15c47cb06c810.tar.gz cpython-e21a7a976a7e3368dc1eba0895e15c47cb06c810.tar.bz2 |
[3.12] gh-109981: Fix support.fd_count() on macOS 14 (GH-112797) (#112824)
gh-109981: Fix support.fd_count() on macOS 14 (GH-112797)
Use scanning "/dev/fd/" on macOS in support.fd_count(). That's both more efficient than scanning all possible file descriptors, and avoids crashing the interpreter when there are open "guarded" file descriptors.
"Guarded" file descriptors are a macOS feature where file descriptors used by system libraries are marked and cause hard crashes when used by "user" code.
(cherry picked from commit 953ee622b3901d3467e65e3484dcfa75ba6fcddf)
Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
Diffstat (limited to 'Misc')
-rw-r--r-- | Misc/NEWS.d/next/macOS/2023-12-06-12-11-13.gh-issue-109981.mOHg10.rst | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Misc/NEWS.d/next/macOS/2023-12-06-12-11-13.gh-issue-109981.mOHg10.rst b/Misc/NEWS.d/next/macOS/2023-12-06-12-11-13.gh-issue-109981.mOHg10.rst new file mode 100644 index 0000000..f86ab2c --- /dev/null +++ b/Misc/NEWS.d/next/macOS/2023-12-06-12-11-13.gh-issue-109981.mOHg10.rst @@ -0,0 +1,3 @@ +Use ``/dev/fd`` on 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. |