cpython icon indicating copy to clipboard operation
cpython copied to clipboard

gh-143304: Fix ctypes.CDLL to honor handle parameter on POSIX systems

Open Koolvansh07 opened this issue 2 weeks ago • 4 comments

The handle parameter was being ignored in the POSIX implementation of CDLL._load_library(), causing it to always call _dlopen() even when a valid handle was provided. This was a regression introduced in recent refactoring.

This PR adds the missing handle check to match the Windows implementation behavior, and includes a regression test.

Fixes gh-143304

Koolvansh07 avatar Dec 31 '25 23:12 Koolvansh07

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

bedevere-app[bot] avatar Dec 31 '25 23:12 bedevere-app[bot]

All commit authors signed the Contributor License Agreement.

CLA signed

python-cla-bot[bot] avatar Dec 31 '25 23:12 python-cla-bot[bot]

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

bedevere-app[bot] avatar Jan 01 '26 00:01 bedevere-app[bot]

LGTM Thanks for your contribution @Koolvansh07

your welcome

Koolvansh07 avatar Jan 01 '26 14:01 Koolvansh07