[Python-checkins] r46564 - in sandbox/branches/setuptools-0.6: EasyInstall.txt setuptools/command/easy_install.py

phillip.eby python-checkins at python.org
Tue May 30 19:58:48 CEST 2006


Author: phillip.eby
Date: Tue May 30 19:58:47 2006
New Revision: 46564

Modified:
   sandbox/branches/setuptools-0.6/EasyInstall.txt
   sandbox/branches/setuptools-0.6/setuptools/command/easy_install.py
Log:
Construct ``.pth`` file paths in such a way that installing an egg whose
name begins with ``import`` doesn't cause a syntax error.


Modified: sandbox/branches/setuptools-0.6/EasyInstall.txt
==============================================================================
--- sandbox/branches/setuptools-0.6/EasyInstall.txt	(original)
+++ sandbox/branches/setuptools-0.6/EasyInstall.txt	Tue May 30 19:58:47 2006
@@ -1100,6 +1100,9 @@
    ``PYTHONPATH`` directory with ``--multi-version``, unless an
    ``easy-install.pth`` file is already in use there.
 
+ * Construct ``.pth`` file paths in such a way that installing an egg whose
+   name begins with ``import`` doesn't cause a syntax error.
+
 0.6b1
  * Better ambiguity management: accept ``#egg`` name/version even if processing
    what appears to be a correctly-named distutils file, and ignore ``.egg``

Modified: sandbox/branches/setuptools-0.6/setuptools/command/easy_install.py
==============================================================================
--- sandbox/branches/setuptools-0.6/setuptools/command/easy_install.py	(original)
+++ sandbox/branches/setuptools-0.6/setuptools/command/easy_install.py	Tue May 30 19:58:47 2006
@@ -1355,7 +1355,7 @@
         """Write changed .pth file back to disk"""
         if not self.dirty:
             return
-            
+
         data = '\n'.join(map(self.make_relative,self.paths))
         if data:
             log.debug("Saving %s", self.filename)
@@ -1394,7 +1394,7 @@
 
     def make_relative(self,path):
         if normalize_path(os.path.dirname(path))==self.basedir:
-            return os.path.basename(path)
+            return os.path.join(os.curdir, os.path.basename(path))
         return path
 
 
@@ -1432,7 +1432,7 @@
                 del zdc[p]
                 return
 
-    
+
 def get_script_args(dist, executable=sys_executable):
     """Yield write_script() argument tuples for a distribution's entrypoints"""
     spec = str(dist.as_requirement())


More information about the Python-checkins mailing list