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

Commit 4b318f8

Browse files
Issue python#29219: Fixed infinite recursion in the repr of uninitialized
ctypes.CDLL instances.
1 parent 3023ebb commit 4b318f8

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
@@ -327,6 +327,10 @@ class CDLL(object):
327327
"""
328328
_func_flags_ = _FUNCFLAG_CDECL
329329
_func_restype_ = c_int
330+
# default values for repr
331+
_name = '<uninitialized>'
332+
_handle = 0
333+
_FuncPtr = None
330334

331335
def __init__(self, name, mode=DEFAULT_MODE, handle=None,
332336
use_errno=False,

Misc/NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ Core and Builtins
1313
Library
1414
-------
1515

16+
- Issue #29219: Fixed infinite recursion in the repr of uninitialized
17+
ctypes.CDLL instances.
18+
1619
- Issue #28969: Fixed race condition in C implementation of functools.lru_cache.
1720
KeyError could be raised when cached function with full cache was
1821
simultaneously called from differen threads with the same uncached arguments.

0 commit comments

Comments
 (0)