Skip to content

FIX Use ctypes.util.dllist again on Windows and macOS - #6

Closed
cakedev0 wants to merge 1 commit into
masterfrom
fix-dllist-condition
Closed

cakedev0 wants to merge 1 commit into
masterfrom
fix-dllist-condition

Conversation

@cakedev0

Copy link
Copy Markdown
Owner

joblib#250 moved the ctypes.util.dllist import to module level and changed its condition to sys.platform != "emscripten" and (sys.platform == "linux" and sys.version_info[:2] >= (3, 15)). That is only true on Linux with Python 3.15+, so on Windows and macOS with Python 3.14+ dllist became None. Library listing fell back to the Toolhelp enumerator on Windows and _dyld_* on macOS, while 3.7.0 used dllist there (joblib#219). The comment on the condition and the description of joblib#250 only discuss Linux, so this looks unintended.

This PR restores the 3.7.0 behavior on Windows and macOS and keeps the Linux restriction from joblib#250 (no ctypes.util import before 3.15, joblib#225).

Tests:

  • New test_dllist_used_on_windows_and_macos checks that _load_libraries calls _find_libraries_with_python(dllist) on Windows and macOS with Python 3.14+. On macOS arm64 with Python 3.14.4, it fails on master and passes with this PR. It has not been run on Windows yet; CI will do that.
  • Removed the stdlib_dllist() test helper. It mirrored the 3.7.0 condition, so it silently diverged after PERF Run faster on Linux joblib/threadpoolctl#250, and as a result test_windows_library_path_exceeds_internal_limit was skipped on Windows 3.14 even though the Toolhelp path was running. The skip now reads threadpoolctl.dllist directly.

This regression was never released, so there is no changelog entry.

🤖 Generated with Claude Code

joblib#250 restricted the dllist import to Linux with Python 3.15+, so Windows
and macOS on Python 3.14+ fell back to the older listing code. Restore
the 3.7.0 behavior there and keep the Linux restriction.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cakedev0

Copy link
Copy Markdown
Owner Author

Opened upstream as joblib#288.

@cakedev0 cakedev0 closed this Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant