Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.

Bug 1705558

Summary: python-libarchive-c FTBFS with python 3.8
Product: [Fedora] Fedora Reporter: Miro Hrončok <mhroncok>
Component: python-libarchive-cAssignee: Zbigniew Jędrzejewski-Szmek <zbyszek>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: rawhideCC: zbyszek
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-libarchive-c-2.8-5.fc31 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-05-04 16:23:12 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:
Bug Depends On:    
Bug Blocks: 1686977    
Attachments:
Description Flags
Full log from Copr none

Description Miro Hrončok 2019-05-02 13:33:16 UTC
Created attachment 1561640 [details]
Full log from Copr

python-libarchive-c 2.8-5.fc31 fails %check on Python 3.8:

=================================== FAILURES ===================================
___________________ test_check_ArchiveEntry_against_TarInfo ____________________

    def test_check_ArchiveEntry_against_TarInfo():
        for name in ('special.tar', 'tar_relative.tar'):
            path = join(data_dir, name)
>           tarinfos = list(get_tarinfos(path))

tests/test_entry.py:55: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

location = '/builddir/build/BUILD/python-libarchive-c-2.8/tests/data/special.tar'

    def get_tarinfos(location):
        """
        Using the tar archive file at `location`, return an iterable of
        name->value mappings for each tarfile.TarInfo objects essential
        attributes.
        Paths are base64-encoded because JSON is UTF-8 and cannot handle
        arbitrary binary pathdata.
        """
        with closing(tarfile.open(location)) as tar:
            for entry in tar:
                path = surrogate_decode(entry.path or '')
                if entry.isdir() and not path.endswith('/'):
                    path += '/'
                # libarchive introduces prefixes such as h prefix for
                # hardlinks: tarfile does not, so we ignore the first char
>               mode = tarfile.filemode(entry.mode)[1:]
E               AttributeError: module 'tarfile' has no attribute 'filemode'

tests/__init__.py:86: AttributeError
===================== 1 failed, 28 passed in 0.47 seconds ======================

(Full log attached.)


This has really changed:

$ python3.7 -c 'import tarfile; tarfile.filemode'
$ python3.8 -c 'import tarfile; tarfile.filemode'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
AttributeError: module 'tarfile' has no attribute 'filemode'

$ python3.7 -c 'import tarfile; help(tarfile.filemode)'
Help on function filemode in module tarfile:

filemode(mode)
    Deprecated in this location; use stat.filemode.

Comment 1 Miro Hrončok 2019-05-02 13:34:36 UTC
(I'm drafting an upstream fix.)

Comment 3 Zbigniew Jędrzejewski-Szmek 2019-05-04 16:23:12 UTC
Built in rawhide