Skip to content

gh-104533: Fix ctypes test_pointer_proto_missing_argtypes_error()#154169

Merged
vstinner merged 2 commits into
python:mainfrom
vstinner:fix_ctypes_wrap_test
Jul 19, 2026
Merged

gh-104533: Fix ctypes test_pointer_proto_missing_argtypes_error()#154169
vstinner merged 2 commits into
python:mainfrom
vstinner:fix_ctypes_wrap_test

Conversation

@vstinner

@vstinner vstinner commented Jul 19, 2026

Copy link
Copy Markdown
Member

Save/restore Py_GetVersion.argtypes, since Py_GetVersion is used in another test.

Save/restore Py_GetVersion.argtypes, since Py_GetVersion is used in
another test.
@bedevere-app bedevere-app Bot added the tests Tests in the Lib/test dir label Jul 19, 2026
@vstinner

Copy link
Copy Markdown
Member Author

This change should fix the Refleaks buildbot: https://buildbot.python.org/#/builders/320/builds/4302

This buildbot runs test_ctypes 6x in a row to check for memory leaks. test_ctypes fails at the second run.

ERROR: test_wrap_dll_function_str_ann (test.test_ctypes.test_funcptr.CFuncPtrTestCase.test_wrap_dll_function_str_ann)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/buildbot-worker/cstratak-fedora-stable-x86_64/3.x.cstratak-fedora-stable-x86_64.refleak/build/Lib/test/test_ctypes/test_funcptr.py", line 156, in test_wrap_dll_function_str_ann
    version = wrap_str_ann.Py_GetVersion()
TypeError: this function takes at least 1 argument (0 given)

@vstinner
vstinner enabled auto-merge (squash) July 19, 2026 15:57
@vstinner
vstinner merged commit da5713c into python:main Jul 19, 2026
48 checks passed
@vstinner
vstinner deleted the fix_ctypes_wrap_test branch July 19, 2026 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip news tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant