]> granicus.if.org Git - python/commitdiff
Issue #29219: Fixed infinite recursion in the repr of uninitialized
authorSerhiy Storchaka <storchaka@gmail.com>
Fri, 13 Jan 2017 07:37:56 +0000 (09:37 +0200)
committerSerhiy Storchaka <storchaka@gmail.com>
Fri, 13 Jan 2017 07:37:56 +0000 (09:37 +0200)
ctypes.CDLL instances.

Lib/ctypes/__init__.py
Misc/NEWS

index 0d860784bc87d11ce9593a5dc8372ffa03fb41c3..1469b8bade072003fa9071d1b5e2962e9fe9ed83 100644 (file)
@@ -327,6 +327,10 @@ class CDLL(object):
     """
     _func_flags_ = _FUNCFLAG_CDECL
     _func_restype_ = c_int
+    # default values for repr
+    _name = '<uninitialized>'
+    _handle = 0
+    _FuncPtr = None
 
     def __init__(self, name, mode=DEFAULT_MODE, handle=None,
                  use_errno=False,
index e1ae98f6c02d19bf538ce01dcc2887692016cdd1..159b2255da6d7b5ef230f898b3a45e8194453311 100644 (file)
--- 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.