From d30d526eb40a4855a3589d895aac75900aedfc44 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 7 Dec 2013 12:36:45 -0500 Subject: Exempt lib2to3 pickled grammars from the DirectorySandboxing. Fixes #121. --HG-- extra : histedit_source : 6cd9a3c6003d3f6de2f8e676b61589db4dffafb0 --- CHANGES.txt | 1 + setuptools/sandbox.py | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index f04f5b91..90e2aaa8 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -6,6 +6,7 @@ CHANGES 2.0 --- +* Issue #121: Exempt lib2to3 pickled grammars from DirectorySandbox. * Issue #41: Dropped support for Python 2.4 and Python 2.5. Clients requiring setuptools for those versions of Python should use setuptools 1.x. * Removed ``setuptools.command.easy_install.HAS_USER_SITE``. Clients diff --git a/setuptools/sandbox.py b/setuptools/sandbox.py index 26960846..042c5958 100755 --- a/setuptools/sandbox.py +++ b/setuptools/sandbox.py @@ -199,8 +199,11 @@ class DirectorySandbox(AbstractSandbox): "utime", "lchown", "chroot", "mkfifo", "mknod", "tempnam", ]) - _exception_patterns = [] - "allow writing to paths that match the pattern" + _exception_patterns = [ + # Allow lib2to3 to attempt to save a pickled grammar object (#121) + '.*lib2to3.*\.pickle$', + ] + "exempt writing to paths that match the pattern" def __init__(self, sandbox, exceptions=_EXCEPTIONS): self._sandbox = os.path.normcase(os.path.realpath(sandbox)) -- cgit v1.2.3