Bug 1705558 - python-libarchive-c FTBFS with python 3.8
Summary: python-libarchive-c FTBFS with python 3.8
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: python-libarchive-c
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
Assignee: Zbigniew Jędrzejewski-Szmek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON38
TreeView+ depends on / blocked
 
Reported: 2019-05-02 13:33 UTC by Miro Hrončok
Modified: 2019-05-04 16:23 UTC (History)
1 user (show)

Fixed In Version: python-libarchive-c-2.8-5.fc31
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-05-04 16:23:12 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Full log from Copr (95.52 KB, text/plain)
2019-05-02 13:33 UTC, Miro Hrončok
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Github Changaco python-libarchive-c pull 88 0 None None None 2019-05-02 13:40:50 UTC

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


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