Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1177613

Summary: setup.py bdist_rpm NameError: global name 'get_python_version' is not defined
Product: Red Hat Enterprise Linux 7 Reporter: daryl herzmann <akrherz>
Component: pythonAssignee: Matej Stuchlik <mstuchli>
Status: CLOSED ERRATA QA Contact: Filip Holec <fholec>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.0CC: bkabrda, fholec, isenfeld, jberan, mstuchli, psplicha
Target Milestone: rcKeywords: EasyFix, Patch
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-2.7.5-22.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-11-19 12:43:07 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description daryl herzmann 2014-12-29 13:06:05 UTC
Description of problem:
Running the bdist_rpm setup.py target results in:
Traceback (most recent call last):
  File "setup.py", line 73, in <module>
    main(sys.argv[1:])
  File "setup.py", line 68, in main
    setup(**setup_args)
  File "./twisted/python/dist.py", line 81, in setup
    return core.setup(**get_setup_args(**kw))
  File "/usr/lib64/python2.7/distutils/core.py", line 152, in setup
    dist.run_commands()
  File "/usr/lib64/python2.7/distutils/dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "/usr/lib64/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "/usr/lib/python2.7/site-packages/setuptools/command/bdist_rpm.py", line 28, in run
    _bdist_rpm.run(self)
  File "/usr/lib64/python2.7/distutils/command/bdist_rpm.py", line 383, in run
    pyversion = get_python_version()
NameError: global name 'get_python_version' is not defined


Version-Release number of selected component (if applicable):
$ rpm -qf /usr/lib64/python2.7/distutils/command/bdist_rpm.py
python-libs-2.7.5-16.el7.x86_64


How reproducible: 100%


Steps to Reproduce:
1. python setup.py bdist_rpm

Actual results:
traceback

Expected results:
I get a fancy RPM

Additional info:
Fedora's bug: https://bugzilla.redhat.com/show_bug.cgi?id=1029082
Python: http://bugs.python.org/issue18045
Patch: https://hg.python.org/cpython/rev/677327810121/

Comment 2 Bohuslav "Slavek" Kabrda 2015-01-05 12:34:01 UTC
dev_ack+ (for rhel 7.2, it's too late for 7.1 now), this can easily be fixed with the referenced upstream commit.

Comment 4 daryl herzmann 2015-05-01 21:07:00 UTC
Sorry to be a bother, but just wanted to confirm that this bug is on the RADAR for RHEL 7.2 release?

Comment 5 Bohuslav "Slavek" Kabrda 2015-05-04 09:32:39 UTC
(In reply to Daryl Herzmann from comment #4)
> Sorry to be a bother, but just wanted to confirm that this bug is on the
> RADAR for RHEL 7.2 release?

Yes, it is on the radar for RHEL 7.2.

Comment 8 errata-xmlrpc 2015-11-19 12:43:07 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHSA-2015-2101.html