Skip to content
This repository was archived by the owner on Feb 13, 2025. It is now read-only.

Commit 4c4ff5f

Browse files
Issue python#29219: Fixed infinite recursion in the repr of uninitialized
ctypes.CDLL instances.
2 parents a675842 + 4b318f8 commit 4c4ff5f

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

Lib/ctypes/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,10 @@ class CDLL(object):
324324
"""
325325
_func_flags_ = _FUNCFLAG_CDECL
326326
_func_restype_ = c_int
327+
# default values for repr
328+
_name = '<uninitialized>'
329+
_handle = 0
330+
_FuncPtr = None
327331

328332
def __init__(self, name, mode=DEFAULT_MODE, handle=None,
329333
use_errno=False,

Misc/NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ Core and Builtins
4444
Library
4545
-------
4646

47+
- Issue #29219: Fixed infinite recursion in the repr of uninitialized
48+
ctypes.CDLL instances.
49+
4750
- Issue #28969: Fixed race condition in C implementation of functools.lru_cache.
4851
KeyError could be raised when cached function with full cache was
4952
simultaneously called from differen threads with the same uncached arguments.

0 commit comments

Comments
 (0)