[Python-checkins] r65939 - sandbox/trunk/setuptools/pkg_resources.py
phillip.eby
python-checkins at python.org
Thu Aug 21 19:42:05 CEST 2008
Author: phillip.eby
Date: Thu Aug 21 19:42:05 2008
New Revision: 65939
Log:
Fix for http://bugs.python.org/setuptools/issue23
Modified:
sandbox/trunk/setuptools/pkg_resources.py
Modified: sandbox/trunk/setuptools/pkg_resources.py
==============================================================================
--- sandbox/trunk/setuptools/pkg_resources.py (original)
+++ sandbox/trunk/setuptools/pkg_resources.py Thu Aug 21 19:42:05 2008
@@ -20,17 +20,17 @@
except NameError:
from sets import ImmutableSet as frozenset
-from os import utime, rename, unlink # capture these to bypass sandboxing
+# capture these to bypass sandboxing
+from os import utime, rename, unlink, mkdir
from os import open as os_open
+from os.path import isdir, split
-
-
-
-
-
-
-
-
+def _bypass_ensure_directory(name, mode=0777):
+ # Sandbox-bypassing version of ensure_directory()
+ dirname, filename = split(name)
+ if dirname and filename and not isdir(dirname):
+ _bypass_ensure_directory(dirname)
+ mkdir(dirname, mode)
@@ -916,7 +916,7 @@
extract_path = self.extraction_path or get_default_cache()
target_path = os.path.join(extract_path, archive_name+'-tmp', *names)
try:
- ensure_directory(target_path)
+ _bypass_ensure_directory(target_path)
except:
self.extraction_error()
More information about the Python-checkins
mailing list