<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.5583" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT face=Arial size=2><SPAN class=619335417-27032009>I think I've found a
bug in the way that setuptools selects whether an egg specified by file:// url
should be installed over an existing (identical) egg:</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=619335417-27032009></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=619335417-27032009>To re-create the
fault:</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=619335417-27032009></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=619335417-27032009>* Install the egg of
your choice.</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=619335417-27032009>* make two local
"egg repositories", one with a very long path (e.g. c:/a/) and one with a
very long path</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=619335417-27032009>* In each of the egg
repositories place a copy of the egg you just installed, along with an HTML file
containing a link to that egg... just it's filename.</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=619335417-27032009>* Try to
easy_install the egg with the options "-mv" and set "-f" to either one of the
repositories</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=619335417-27032009></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=619335417-27032009>When you select a
short path for the repository you will notice that the egg in your site_packages
folder is always replaced, you see something like this:</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=619335417-27032009><FONT
size=2></FONT></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=619335417-27032009><FONT
size=2>"Removing
d:\devtools\python24\lib\site-packages\calyon-1.0_r2009_03_12-py2.4-win32.egg"</FONT></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=619335417-27032009><FONT
size=2></FONT></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=619335417-27032009><FONT size=2>When
you select a very long path for the repository you will not see this message,
this is because easy_install leaves the egg
unmodified.</FONT></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=619335417-27032009><FONT
size=2></FONT></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=619335417-27032009><FONT size=2>I've
found out why this happens: The pkg_resources.Environment uses a hash-tuple to
work out the order in which to consider packages to install. If you are trying
to install two identical eggs, the 4th element of the tuple -len(self.location
or '') becomes significant... longer URLs get preference to shorter URLs.
</FONT></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=619335417-27032009><FONT
size=2></FONT></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=619335417-27032009><FONT size=2>That on
it's own might not seem too bad, but consider the the 2nd value of the
hash-tuple (precedence) is given an identical value of 3 both for a package
which is already installed in pkg_resources and a package which can already be
downloaded from a file:// link. I think a better default behaviour would be for
it to give stuff that is already installed a higher precedence than stuff which
could potentially be installed. </FONT></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=619335417-27032009><FONT
size=2></FONT></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=619335417-27032009><FONT size=2>Hope
all of this makes sense!</FONT></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=619335417-27032009><FONT
size=2></FONT></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=619335417-27032009><FONT
size=2>Sal</DIV></FONT></SPAN></FONT></BODY></HTML>