Open
Description
Feature or enhancement
Add ability to filter out results of https://docs.python.org/3/library/shutil.html#shutil.which by https://docs.python.org/3/library/os.html#os.stat_result.st_flags
Pitch
- https://en.wikipedia.org/wiki/System_Integrity_Protection
- Impossible to passthru / set DYLD_LIBRARY_PATH on macOS pypa/hatch#701 (comment)
Basically, it is desirable to call/use a version of an installed executable that is not restricted by macOS SIP such as when modifying linker environment variables.
Previous discussion
Somewhat related #76528