Commit a56e2e6
pythongh-109981: Fix support.fd_count() on macOS 14 (python#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.
Co-authored-by: Victor Stinner <[email protected]>1 parent 37e5f1e commit a56e2e6
File tree
2 files changed
+12
-2
lines changed- Lib/test/support
- Misc/NEWS.d/next/macOS
2 files changed
+12
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
592 | 592 | | |
593 | 593 | | |
594 | 594 | | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
595 | 602 | | |
596 | | - | |
| 603 | + | |
597 | 604 | | |
598 | | - | |
| 605 | + | |
599 | 606 | | |
600 | 607 | | |
601 | 608 | | |
| |||
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
0 commit comments