Bug 1749040 - manual python byte compilation is broken
Summary: manual python byte compilation is broken
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora EPEL
Classification: Fedora
Component: python-rpm-macros
Version: el6
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Miro Hrončok
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-09-04 18:25 UTC by Carl George 🤠
Modified: 2020-02-09 16:13 UTC (History)
7 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2020-02-04 14:57:25 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Carl George 🤠 2019-09-04 18:25:01 UTC
Description of problem:
The packaging guidelines say that manual python byte compilation is possible in EPEL.

https://docs.fedoraproject.org/en-US/packaging-guidelines/Python_Appendix/#_manual_byte_compilation_for_fedora_29_or_earlier_including_epel

However, it doesn't work on EL6.

https://src.fedoraproject.org/rpms/python-rpm-macros/blob/el6/f/macros.pybytecompile#_24

python_version=$(%1 -c "import sys; sys.stdout.write('{0.major}{0.minor}'.format(sys.version_info))") \

$ python -c "import sys; sys.stdout.write('{0.major}{0.minor}'.format(sys.version_info))"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
AttributeError: 'tuple' object has no attribute 'major'

sys.version_info.{major,minor} doesn't exist in EL6's Python.  This is similar to bug 1369486.

Version-Release number of selected component (if applicable):
python-rpm-macros-3-14.el6.noarch

How reproducible:
always

Comment 1 Miro Hrončok 2019-09-04 18:50:02 UTC
This should do: '{0[0]}{0[1]}'.format(sys.version_info)

However not sure if the remaining part of %py_byte_compile works with 2.6 or not. Could you test?

Comment 2 Petr Viktorin (pviktori) 2020-02-04 14:57:25 UTC
Please reopen if you have an answer.

Comment 3 Carl George 🤠 2020-02-09 16:13:12 UTC
Sorry I never got around to testing this.  I'm clearing the needsinfo because I don't intend to come back around to this before the EL6 end of life.


Note You need to log in before you can comment on or make changes to this bug.