diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2015-12-13 10:48:20 -0500 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2015-12-13 10:48:20 -0500 |
commit | 264b5dc6b9cf48b22bd2263d426026d7b8f45608 (patch) | |
tree | 48ebb0902442b5154ee24059e0410c8f7bbe7c37 | |
parent | bf8331685d1d5bb88cc6cf09236601f0dbe62330 (diff) | |
download | external_python_setuptools-264b5dc6b9cf48b22bd2263d426026d7b8f45608.tar.gz external_python_setuptools-264b5dc6b9cf48b22bd2263d426026d7b8f45608.tar.bz2 external_python_setuptools-264b5dc6b9cf48b22bd2263d426026d7b8f45608.zip |
Prevent infinite recursion when UnpickleableException occurs in a sandbox context. Fixes #440.
-rw-r--r-- | CHANGES.txt | 9 | ||||
-rwxr-xr-x | setuptools/sandbox.py | 6 |
2 files changed, 13 insertions, 2 deletions
diff --git a/CHANGES.txt b/CHANGES.txt index cb9bb02d..ff31275a 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -3,6 +3,15 @@ CHANGES ======= +------ +18.8.1 +------ + +* Issue #440: Prevent infinite recursion when a SandboxViolation + or other UnpickleableException occurs in a sandbox context + with setuptools hidden. Fixes regression introduced in Setuptools + 12.0. + ---- 18.8 ---- diff --git a/setuptools/sandbox.py b/setuptools/sandbox.py index 213cebff..b8b1bac1 100755 --- a/setuptools/sandbox.py +++ b/setuptools/sandbox.py @@ -98,8 +98,8 @@ class UnpickleableException(Exception): """ An exception representing another Exception that could not be pickled. """ - @classmethod - def dump(cls, type, exc): + @staticmethod + def dump(type, exc): """ Always return a dumped (pickled) type and exc. If exc can't be pickled, wrap it in UnpickleableException first. @@ -107,6 +107,8 @@ class UnpickleableException(Exception): try: return pickle.dumps(type), pickle.dumps(exc) except Exception: + # get UnpickleableException inside the sandbox + from setuptools.sandbox import UnpickleableException as cls return cls.dump(cls, cls(repr(exc))) |