[New-bugs-announce] [issue18045] get_python_version is not import in bdist_rpm.py

Matt Mao report at bugs.python.org
Fri May 24 02:37:22 CEST 2013

New submission from Matt Mao:

Python version : 2.7.5
OS             : CentOS 6.3

When I tried to build a rpm with "python ./setup.py bdist_rpm", I get the following error :

Traceback (most recent call last):
  File "setup.py", line 221, in <module>
    ...  and much more ;)"""
  File "/usr/local/python2.7/lib/python2.7/distutils/core.py", line 152, in setup
  File "/usr/local/python2.7/lib/python2.7/distutils/dist.py", line 953, in run_commands
  File "/usr/local/python2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
  File "/usr/local/python2.7/lib/python2.7/python2.7/distutils/command/bdist_rpm.py", line 383, in run
    pyversion = get_python_version()
NameError: global name 'get_python_version' is not defined

I find that we do not import function get_python_version in python2.7/distutils/command/bdist_rpm.py.
I think we need to add “from distutils.sysconfig import get_python_version” in this file.

assignee: eric.araujo
components: Distutils
messages: 189888
nosy: eric.araujo, maoliping455, tarek
priority: normal
severity: normal
status: open
title: get_python_version is not import in bdist_rpm.py
versions: Python 2.7

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list