Commits

Anonymous committed f8b369b Merge

merge dance

Comments (0)

Files changed (5)

 0.6.5
 -----
 
+* When run from within buildout, no attempt is made to modify an existing
+  setuptools egg, whether in a shared egg directory or a system setuptools.
+
+* Fixed a hole in sandboxing allowing builtin file to write outside of
+  the sandbox.
 
 -----
 0.6.4
 recursive-include setuptools *.py *.txt *.exe
 recursive-include tests *.py *.c *.pyx *.txt
-recursive-include docs *.py *.txt Makefile
+recursive-include docs *.py *.txt *.conf *.css *.css_t Makefile
 include *.py
 include *.txt
 include MANIFEST.in
   and make all distributions that depend on Setuptools work as
   before, but with less bugs and behaviorial issues.
 
-  This work is done in the 0.6.x series
+  This work is done in the 0.6.x series.
 
   Starting with version 0.6.2, Distribute supports Python 3.
   Installing and using distribute for Python 3 code works exactly
 distribute_setup.py
 ===================
 
-Download ``distribute_setup.py`` and execute it, using the Python interpreter of
-your choice.
+Download
+`distribute_setup.py <http://python-distribute.org/distribute_setup.py>`_
+and execute it, using the Python interpreter of your choice.
 
 If your shell has the ``curl`` program you can do::
 
-    $ curl -O http://nightly.ziade.org/distribute_setup.py
+    $ curl -O http://python-distribute.org/distribute_setup.py
     $ python distribute_setup.py
 
-If you are under Python 3, use ``distribute_setup_3k.py``::
+If you are under Python 3, use
+`distribute_setup_3k.py <http://python-distribute.org/distribute_setup_3k.py>`_::
 
-    $ curl -O http://nightly.ziade.org/distribute_setup_3k.py
+    $ curl -O http://python-distribute.org/distribute_setup_3k.py
     $ python distribute_setup_3k.py
 
 Notice that both files are provided in the source release.
   You can use Distribute in your zc.buildout.
 
   Although you have to run a specific `bootstrap.py` file that is available
-  at `http://nightly.ziade.org/bootstrap.py`. The code is located at
+  at `http://python-distribute.org/bootstrap.py`. The code is located at
   `http://bitbucket.org/tarek/buildout-distribute`.
 
   Beware that if you use a shared eggs folder with buildout, you need to 
 VERSION = "0.6.5"
 
 from setuptools import setup, find_packages
+import os
 import sys
 scripts = []
 
     return (len(sys.argv) == 5 and sys.argv[2] == 'bdist_egg' and
             sys.argv[3] == '--dist-dir' and 'egg-dist-tmp-' in sys.argv[-1])
 
+def _buildout_marker():
+    command = os.environ.get('_')
+    if command:
+        return 'buildout' in os.path.basename(command)
+
 def _being_installed():
+    if _buildout_marker():
+        # Installed by buildout, don't mess with a global setuptools.
+        return False
     # easy_install marker
     return 'install' in sys.argv[1:] or _easy_install_marker()
 

setuptools/sandbox.py

     def _violation(self, operation, *args, **kw):
         raise SandboxViolation(operation, args, kw)
 
+    if _file:
+        def _file(self, path, mode='r', *args, **kw):
+            if mode not in ('r', 'rt', 'rb', 'rU', 'U') and not self._ok(path):
+                self._violation("file", path, mode, *args, **kw)
+            return _file(path,mode,*args,**kw)
+
     def _open(self, path, mode='r', *args, **kw):
         if mode not in ('r', 'rt', 'rb', 'rU', 'U') and not self._ok(path):
             self._violation("open", path, mode, *args, **kw)