Bug 1240325 - Missing python 3 support in python-cpio
Summary: Missing python 3 support in python-cpio
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: python-cpio
Version: 23
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: José Matos
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 1239752
TreeView+ depends on / blocked
 
Reported: 2015-07-06 14:56 UTC by Vratislav Podzimek
Modified: 2016-12-20 14:14 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-12-20 14:14:19 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Patch to support simultaneously python 2 and 3 (1.05 KB, patch)
2015-08-14 15:36 UTC, José Matos
no flags Details | Diff

Description Vratislav Podzimek 2015-07-06 14:56:25 UTC
Description of problem:
While Fedora is moving to Python 3, there's no python3-cpio package that would provide the Python 3 compatible version of the module.

Version-Release number of selected component (if applicable):
python-cpio-0.1-18.fc23

Actual results:
no python3-cpio package available

Expected results:
python3-cpio package available

Additional info:
This blocks the oscap-anaconda-addon to be built for F23 because it requires both anaconda (which is python 3) and python-cpio.

Comment 1 Abdel Gadiel Martínez Lassonde 2015-08-12 21:12:41 UTC
I'll fork the python-cpio project and port it to Python 3. Secondly, package it for Fedora as a new package called python3-cpio. Regards!

Comment 2 José Matos 2015-08-12 22:55:07 UTC
If your code supports both python 2.7 and python 3 (3.3+ being a nice/achievable  goal) from a single source code I will use it to replace the present code. :-)

Comment 3 Abdel Gadiel Martínez Lassonde 2015-08-13 12:43:52 UTC
Jose, thank you for your quick response :-) . Please review the source code I propose. Here is the link: https://github.com/ampotty/python3-cpio

Comment 4 José Matos 2015-08-14 15:36:18 UTC
Created attachment 1063070 [details]
Patch to support simultaneously python 2 and 3

Comment 5 José Matos 2015-08-14 15:41:46 UTC
I have several comments to your changes:

* I would only import from __future__ after the license text, there is no need to change the order, I can understand that as a personal style 

* why do you import object from builtins? That does not work in python 2, and as it is the class derived from object works both for python 2 and 3.

* There is no need to replace the next method, in order to support both version 2 and 3 it should be enough to to create another method __next__ that calls the next method.

I have attached the patch with my proposed changes.

Comment 6 Fedora Update System 2015-08-14 17:05:51 UTC
python-cpio-0.1-19.fc23 has been submitted as an update for Fedora 23.
https://admin.fedoraproject.org/updates/python-cpio-0.1-19.fc23

Comment 7 Fedora Update System 2015-08-18 05:13:30 UTC
Package python-cpio-0.1-19.fc23:
* should fix your issue,
* was pushed to the Fedora 23 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing python-cpio-0.1-19.fc23'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2015-13538/python-cpio-0.1-19.fc23
then log in and leave karma (feedback).

Comment 8 Vratislav Podzimek 2015-08-18 10:00:00 UTC
(In reply to Fedora Update System from comment #6)
> python-cpio-0.1-19.fc23 has been submitted as an update for Fedora 23.
> https://admin.fedoraproject.org/updates/python-cpio-0.1-19.fc23

Doesn't work for me. Simple testing results in a traceback:
$ python -c 'import cpioarchive; archive = cpioarchive.CpioArchive("python3-cpio.cpio"); print([entry.name for entry in archive])'
['./usr/lib/python3.4/site-packages/cpioarchive.py', './usr/lib/python3.4/site-packages/python_cpio-0.1-py3.4.egg-info', './usr/share/doc/python3-cpio', './usr/share/doc/python3-cpio/AUTHORS', './usr/share/doc/python3-cpio/ChangeLog', './usr/share/doc/python3-cpio/README', './usr/share/doc/python3-cpio/TODO', './usr/share/licenses/python3-cpio', './usr/share/licenses/python3-cpio/COPYING.lib', './usr/lib/python3.4/site-packages/__pycache__/cpioarchive.cpython-34.pyc', './usr/lib/python3.4/site-packages/__pycache__/cpioarchive.cpython-34.pyo']

$ python3 -c 'import cpioarchive; archive = cpioarchive.CpioArchive("python3-cpio.cpio"); print([entry.name for entry in archive])'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python3.4/site-packages/cpioarchive.py", line 125, in __init__
    self._readfile(name)
  File "/usr/lib/python3.4/site-packages/cpioarchive.py", line 162, in _readfile
    self._readobj(open(name, 'rb'))
  File "/usr/lib/python3.4/site-packages/cpioarchive.py", line 172, in _readobj
    ce=CpioEntry(text, self, istart)
  File "/usr/lib/python3.4/site-packages/cpioarchive.py", line 29, in __init__
    if not hdr.startswith('070701'):
TypeError: startswith first arg must be bytes or a tuple of bytes, not str

Comment 9 Fedora End Of Life 2016-11-24 12:10:13 UTC
This message is a reminder that Fedora 23 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 23. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '23'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 23 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 10 Vratislav Podzimek 2016-12-12 08:14:50 UTC
Still doesn't work, even in F24.

Comment 11 Fedora End Of Life 2016-12-20 14:14:19 UTC
Fedora 23 changed to end-of-life (EOL) status on 2016-12-20. Fedora 23 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


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