From 4b318f8be941ee75d00aa86d1a61a2ebc4992215 Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Fri, 13 Jan 2017 09:37:56 +0200 Subject: [PATCH] Issue #29219: Fixed infinite recursion in the repr of uninitialized ctypes.CDLL instances. --- Lib/ctypes/__init__.py | 4 ++++ Misc/NEWS | 3 +++ 2 files changed, 7 insertions(+) diff --git a/Lib/ctypes/__init__.py b/Lib/ctypes/__init__.py index 0d860784bc..1469b8bade 100644 --- a/Lib/ctypes/__init__.py +++ b/Lib/ctypes/__init__.py @@ -327,6 +327,10 @@ class CDLL(object): """ _func_flags_ = _FUNCFLAG_CDECL _func_restype_ = c_int + # default values for repr + _name = '' + _handle = 0 + _FuncPtr = None def __init__(self, name, mode=DEFAULT_MODE, handle=None, use_errno=False, diff --git a/Misc/NEWS b/Misc/NEWS index e1ae98f6c0..159b2255da 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -13,6 +13,9 @@ Core and Builtins Library ------- +- Issue #29219: Fixed infinite recursion in the repr of uninitialized + ctypes.CDLL instances. + - Issue #28969: Fixed race condition in C implementation of functools.lru_cache. KeyError could be raised when cached function with full cache was simultaneously called from differen threads with the same uncached arguments. -- 2.40.0