Re: [Python-Dev] PEP 376 - get_egginfo_files
At 05:26 PM 7/5/2009 +0100, Paul Moore wrote:
def get_distribution(name): for d in get_distributions(): if d.name == name: return d return None
Btw, this is broken code anyway, because it's not handling case-insensitivity or name canonicalization. (I've mentioned these issue previously on the distutils-sig.)
2009/7/5 P.J. Eby <pje@telecommunity.com>:
At 05:26 PM 7/5/2009 +0100, Paul Moore wrote:
def get_distribution(name): for d in get_distributions(): if d.name == name: return d return None
Btw, this is broken code anyway, because it's not handling case-insensitivity or name canonicalization. (I've mentioned these issue previously on the distutils-sig.)
Yes thanks, we need to fix that, the case-insensitivity or name canonicalization functions are present, just to be used in that function too
-- Tarek Ziadé | http://ziade.org
2009/7/5 P.J. Eby <pje@telecommunity.com>:
At 05:26 PM 7/5/2009 +0100, Paul Moore wrote:
def get_distribution(name): for d in get_distributions(): if d.name == name: return d return None
Btw, this is broken code anyway, because it's not handling case-insensitivity or name canonicalization. (I've mentioned these issue previously on the distutils-sig.)
Fair point. (Although I don't recall your distutils-sig posting, so I'm not sure what you mean by "name canonicalisation"). Note that even on case insensitive filesystems, module/package names are handled case sensitively. I would be happy to see distribution names handled the same (although I have no vested interest either way). Is there code around to handle filename matching based on the case sensitivity of the filesystem? (My understanding is that there isn't, and programs like Mercurial play fancy games to determine if a filesystem is case sensitive before doing tests). Of course, if you're OK with an inaccurate but simple choice based on OS, it would probably be OK to use os.path.normcase. Paul.
On Sun, 05 Jul 2009 11:46:58 -0700, Paul Moore <p.f.moore@gmail.com> wrote:
2009/7/5 P.J. Eby <pje@telecommunity.com>:
At 05:26 PM 7/5/2009 +0100, Paul Moore wrote:
def get_distribution(name): for d in get_distributions(): if d.name == name: return d return None
Btw, this is broken code anyway, because it's not handling case-insensitivity or name canonicalization. (I've mentioned these issue previously on the distutils-sig.) Fair point. (Although I don't recall your distutils-sig posting, so I'm not sure what you mean by "name canonicalisation").
Correct me if I'm wrong - I believe he was referring to the `safe_name` function: http://mail.python.org/pipermail/distutils-sig/2005-September/005120.html -srid
participants (4)
-
P.J. Eby
-
Paul Moore
-
Sridhar Ratnakumar
-
Tarek Ziadé