Content-Length: 281126 | pFad | http://github.com/python/cpython/pull/136878/commits/ab5aaa5f96f89522f6fcf12ba25de961b3f147f1

35 gh-83424: Allow empty name if handle is non-null when create ctypes.CDLL by aisk · Pull Request #136878 · python/cpython · GitHub
Skip to content

gh-83424: Allow empty name if handle is non-null when create ctypes.CDLL #136878

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add test
  • Loading branch information
aisk committed Jul 20, 2025
commit ab5aaa5f96f89522f6fcf12ba25de961b3f147f1
6 changes: 6 additions & 0 deletions Lib/test/test_ctypes/test_loading.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,12 @@ def test_load_ordinal_functions(self):

self.assertRaises(AttributeError, dll.__getitem__, 1234)

@unittest.skipUnless(os.name == "nt", 'Windows-specific test')
def test_load_without_name_and_with_handle(self):
handle = ctypes.windll.kernel32._handle
lib = ctypes.WinDLL(name=None, handle=handle)
self.assertIs(handle, lib._handle)

@unittest.skipUnless(os.name == "nt", 'Windows-specific test')
def test_1703286_A(self):
# On winXP 64-bit, advapi32 loads at an address that does
Expand Down
Loading








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/python/cpython/pull/136878/commits/ab5aaa5f96f89522f6fcf12ba25de961b3f147f1

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy