diff options
-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))) |