From: Serhiy Storchaka Date: Fri, 13 Jan 2017 07:37:56 +0000 (+0200) Subject: Issue #29219: Fixed infinite recursion in the repr of uninitialized X-Git-Tag: v2.7.14rc1~304 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7a7e04e42c309f366d61bb453d44e7d5f268a477;p=python Issue #29219: Fixed infinite recursion in the repr of uninitialized ctypes.CDLL instances. --- diff --git a/Lib/ctypes/__init__.py b/Lib/ctypes/__init__.py index e24cfd2bed..88c85ff388 100644 --- a/Lib/ctypes/__init__.py +++ b/Lib/ctypes/__init__.py @@ -342,6 +342,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 8b5f146d11..b1d35670db 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -23,6 +23,9 @@ Extension Modules Library ------- +- Issue #29219: Fixed infinite recursion in the repr of uninitialized + ctypes.CDLL instances. + - Issue #29082: Fixed loading libraries in ctypes by unicode names on Windows. Original patch by Chi Hsuan Yen.