[Python-checkins] cpython (merge 3.5 -> 3.6): Issue #29219: Fixed infinite recursion in the repr of uninitialized

serhiy.storchaka python-checkins at python.org
Fri Jan 13 02:44:48 EST 2017


https://hg.python.org/cpython/rev/17ca7c4dd583
changeset:   106129:17ca7c4dd583
branch:      3.6
parent:      106122:7f7f1cbbf608
parent:      106127:d9a64d00a439
user:        Serhiy Storchaka <storchaka at gmail.com>
date:        Fri Jan 13 09:42:17 2017 +0200
summary:
  Issue #29219: Fixed infinite recursion in the repr of uninitialized
ctypes.CDLL instances.

files:
  Lib/ctypes/__init__.py |  4 ++++
  Misc/NEWS              |  3 +++
  2 files changed, 7 insertions(+), 0 deletions(-)


diff --git a/Lib/ctypes/__init__.py b/Lib/ctypes/__init__.py
--- a/Lib/ctypes/__init__.py
+++ b/Lib/ctypes/__init__.py
@@ -324,6 +324,10 @@
     """
     _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,
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -44,6 +44,9 @@
 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.

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list