[Distutils] pkg_resources: failed require

Phillip J. Eby pje at telecommunity.com
Mon May 30 22:10:40 CEST 2005


At 02:44 PM 5/30/2005 -0500, Ian Bicking wrote:
>Maybe I was confusing this with a bug related to packages with spaces in 
>their names.  In particular, WSGIUtils: 
>http://www.owlfish.com/software/wsgiutils/downloads/WSGI%20Utils-0.5.tar.gz
>
>I suspect this doesn't work because it creates an egg 
>WSGI_Utils-0.5-py2.4.egg/, with a package name (in 
>WSGI_Utils-0.5-py2.4.egg/EGG-INFO/PKG-INFO) of "WSGI Utils"

What do you mean by "this doesn't work"?  Currently, the egg runtime never 
reads anything out of PKG-INFO except for the 'Version' field.  So, 
although the 'Name' field reads "WSGI Utils", it is still recognized as the 
'WSGI_Utils' package by 'require()'.

What it *won't* be recognized as, is 'WSGI Utils', which is a requirement 
syntax error since package names in requirement specs can't have spaces in 
them.

You're probably right, though, that the PKG-INFO file 'Name:' should match 
the actual egg name, so I've made that change and it should go out in 
0.3a3.  (The 'Name:' will read 'WSGI-Utils').

Note that egg names can currently only contain alphanumeric characters, 
'_', or '-'.  And those last two are interchangeable, as '-' is converted 
to '_' in the egg's actual filename.  Spaces in the setup(name="") argument 
are converted to '-'.

It's possible that this range could/should be expanded somewhat, but it 
seemed prudent to be conservative initially, since it's easier to add 
capability than to take it away.



More information about the Distutils-SIG mailing list