[Distutils] use of '_' in package name causing version parsing issue?

P.J. Eby pje at telecommunity.com
Fri Mar 12 18:00:18 CET 2010


At 11:42 AM 3/12/2010 +0530, Baiju M wrote:
>On Thu, Mar 11, 2010 at 9:13 PM, P.J. Eby <pje at telecommunity.com> wrote:
> > At 12:38 PM 3/11/2010 +0530, Baiju M wrote:
> >>
> >> On Thu, Mar 11, 2010 at 11:05 AM, Baiju M <mbaiju at zeomega.com> wrote:
> >> > If "_" is a valid project_name identifier, why it is replaces with "-" ?
> >
> > In order to have a canonicalized name form which can be escaped 
> in filenames
> > for unambiguous identification of an egg's project and version.
> >
> > Egg filenames use '-' as a separator between name, version, python version,
> > and platform.  A '-' in any of these components is escaped as '_', so that
> > the '-' remains a viable and unambiguous separator.  This means that '_'
> > gets turned back into a '-' when unescaped, so the mapping between '_' and
> > '-' is part of the safe_name canonical form.
>
>Sorry, I confused.
>
>Then, why "_" was added as a valid project name identifier ?

It's a valid project name character; what it's not is a *canonical* 
project name character.



More information about the Distutils-SIG mailing list