[Distutils] Bug with bdist_rpm and version containing '-'

Phillip J. Eby pje at telecommunity.com
Sat Dec 17 03:02:37 CET 2005

At 02:18 AM 12/17/2005 +0100, Giovanni Bajo wrote:
>while using distutils shipped with Python 2.4.2, I found out a problem when
>running bdist_rpm if the version of the package contains an hyphen ('-'). The
>problem is that RPMs do not support hyphens in versions, and bdist_rpm 
>tries to
>work around this by replacing hyphens with underscores ('_'). While this 
>is the
>correct solution, it appears to be incomplete, because bdist_rpm invokes
>'sdist' to build the .tar.gz (or .tar.bz2) without notifying it of the change
>of the version string (and thus of the change of the filename that sdist will
>have to generate).

For a more direct fix (patching the bdist_rpm command to handle this 
correctly), see:


Setuptools includes a bdist_rpm subclass that implements the same fix for 
both Python 2.3 and 2.4, so using setuptools is also a workaround for this 

More information about the Distutils-SIG mailing list