[Distutils] [PATCH] catch egg_base=./ foolishness ? was (distutils data_files and setuptools.pkg_resources are driving me crazy)

Robin Bryce robinbryce at gmail.com
Sat Jul 15 23:06:09 CEST 2006


On 15/07/06, Robin Bryce <robinbryce at gmail.com> wrote:
> egg_base=./ seemed to prevent the installation of console_scripts.

Oh fiddle sticks. this is because './' is not equal to os.curdir on
*any* system.

line 103: egg_info.py does the right thing: if self.egg_base !=
os.curdir. This mirrors exactly how distutils.filelist.findall does
the same gaurd on files in the current directory.

Observing that:
os.path.join('.' + os.sep, '') == os.path.join(os.curdir, '') and
os.path.join('.', '') == os.path.join(os.curdir, '')

how about this patch::

Index: setuptools/command/egg_info.py
===================================================================
--- setuptools/command/egg_info.py      (revision 85)
+++ setuptools/command/egg_info.py      (working copy)
@@ -100,7 +100,7 @@

         self.ensure_dirname('egg_base')
         self.egg_info = to_filename(self.egg_name)+'.egg-info'
-        if self.egg_base != os.curdir:
+        if os.path.join(self.egg_base, '') != os.path.join(os.curdir,''):
             self.egg_info = os.path.join(self.egg_base, self.egg_info)
         if '-' in self.egg_name: self.check_broken_egg_info()


More information about the Distutils-SIG mailing list