-
-
Notifications
You must be signed in to change notification settings - Fork 33.8k
gh-143304: Fix ctypes.CDLL to honor handle parameter on POSIX systems #143318
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 5 commits
8634db5
bb4c92e
d8b9ed3
32eb34d
6d95eff
d3f65b6
cdb8f6e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -106,6 +106,14 @@ def test_load_without_name_and_with_handle(self): | |||||
| lib = ctypes.WinDLL(name=None, handle=handle) | ||||||
| self.assertIs(handle, lib._handle) | ||||||
|
|
||||||
| @unittest.skipIf(os.name == "nt", 'POSIX-specific test') | ||||||
| @unittest.skipIf(libc_name is None, 'could not find libc') | ||||||
| def test_load_without_name_and_with_handle_posix(self): | ||||||
| lib1 = CDLL(libc_name) | ||||||
| handle = lib1._handle | ||||||
| lib2 = CDLL(name=None, handle=handle) | ||||||
| self.assertIs(handle, lib2._handle) | ||||||
|
||||||
| self.assertIs(handle, lib2._handle) | |
| self.assertIs(lib2._handle, handle) |
Can you check whether there were tests for Python 3.12 where we had this handle? or if the tests were rewritten as well (see the PRs mentioned on the issue).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I checked the 3.12 branch source code:
Lib/ctypes/__init__.pyin 3.12 DID support thehandleparameter (it checkedif handle is None:).-
Lib/test/test_ctypes/test_loading.pyin 3.12 DID NOT have any test usingCDLL(..., handle=...)on POSIX.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok thx!
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Fix :class:`ctypes.CDLL` to honor the ``handle`` parameter on POSIX systems. |
Uh oh!
There was an error while loading. Please reload this page.