summaryrefslogtreecommitdiffstats
path: root/Misc
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2017-09-27 06:34:44 (GMT)
committerGitHub <noreply@github.com>2017-09-27 06:34:44 (GMT)
commit02c3cdcef84edd8c71e9fe189873dea216acfc1d (patch)
treee633c37492d35a475f8e224369948d602d633e3d /Misc
parent680429b133660d170269565413f4c9e36e68def6 (diff)
downloadcpython-02c3cdcef84edd8c71e9fe189873dea216acfc1d.zip
cpython-02c3cdcef84edd8c71e9fe189873dea216acfc1d.tar.gz
cpython-02c3cdcef84edd8c71e9fe189873dea216acfc1d.tar.bz2
[3.6] bpo-25532: Protect against infinite loops in inspect.unwrap() (GH-1717) (#3778)
Some objects (like test mocks) auto-generate new objects on attribute access, which can lead to an infinite loop in inspect.unwrap(). Ensuring references are retained to otherwise temporary objects and capping the size of the memo dict turns this case into a conventional exception instead.. (cherry picked from commit f9169ce6b48c7cc7cc62d9eb5e4ee1ac7066d14b)
Diffstat (limited to 'Misc')
-rw-r--r--Misc/NEWS.d/next/Library/2017-09-27-08-11-38.bpo-25532.ey4Yez.rst3
1 files changed, 3 insertions, 0 deletions
diff --git a/Misc/NEWS.d/next/Library/2017-09-27-08-11-38.bpo-25532.ey4Yez.rst b/Misc/NEWS.d/next/Library/2017-09-27-08-11-38.bpo-25532.ey4Yez.rst
new file mode 100644
index 0000000..8146dcd
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2017-09-27-08-11-38.bpo-25532.ey4Yez.rst
@@ -0,0 +1,3 @@
+inspect.unwrap() will now only try to unwrap an object
+sys.getrecursionlimit() times, to protect against objects which create a new
+object on every attribute access.