diff --git a/7480fcdc8c6585d3f8ac67fe9a4dff0ebb0e479e.patch b/7480fcdc8c6585d3f8ac67fe9a4dff0ebb0e479e.patch new file mode 100644 index 0000000..4db0ffa --- /dev/null +++ b/7480fcdc8c6585d3f8ac67fe9a4dff0ebb0e479e.patch @@ -0,0 +1,48 @@ +From 7480fcdc8c6585d3f8ac67fe9a4dff0ebb0e479e Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= +Date: Thu, 2 May 2019 15:39:00 +0200 +Subject: [PATCH] Python 3.8: tarfile.filemode is gone, use stat.filemode if + available + + > mode = tarfile.filemode(entry.mode)[1:] + E AttributeError: module 'tarfile' has no attribute 'filemode' +--- + tests/__init__.py | 6 +++++- + tox.ini | 2 +- + 2 files changed, 6 insertions(+), 2 deletions(-) + +diff --git a/tests/__init__.py b/tests/__init__.py +index 7e922aa..bfca007 100644 +--- a/tests/__init__.py ++++ b/tests/__init__.py +@@ -6,6 +6,10 @@ + from os.path import abspath, dirname, join + from stat import S_ISREG + import tarfile ++try: ++ from stat import filemode ++except ImportError: # Python 2 ++ filemode = tarfile.filemode + + from libarchive import file_reader + +@@ -83,7 +87,7 @@ def get_tarinfos(location): + 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:] ++ mode = filemode(entry.mode)[1:] + yield { + 'path': path, + 'mtime': entry.mtime, +diff --git a/tox.ini b/tox.ini +index 8973837..1f6b04f 100644 +--- a/tox.ini ++++ b/tox.ini +@@ -1,5 +1,5 @@ + [tox] +-envlist=py27,py34,py35,py36 ++envlist=py27,py34,py35,py36,py37,py38 + skipsdist=True + + [testenv] diff --git a/python-libarchive-c.spec b/python-libarchive-c.spec index a199cbb..8d8c0de 100644 --- a/python-libarchive-c.spec +++ b/python-libarchive-c.spec @@ -1,10 +1,12 @@ Name: python-libarchive-c Version: 2.8 -Release: 4%{?dist} +Release: 5%{?dist} Summary: Python interface to libarchive License: CC0 URL: https://github.com/Changaco/python-libarchive-c Source0: https://github.com/Changaco/python-libarchive-c/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz +Patch1: https://github.com/Changaco/python-libarchive-c/commit/7480fcdc8c6585d3f8ac67fe9a4dff0ebb0e479e.patch + BuildRequires: libarchive-devel BuildArch: noarch @@ -41,7 +43,7 @@ Requires: libarchive %{_fixperms} %{buildroot} %check -LC_ALL=C.utf8 py.test-%{python3_version} -s -vv tests +pytest-%{python3_version} -s -vv tests %global _docdir_fmt %{name} @@ -51,6 +53,9 @@ LC_ALL=C.utf8 py.test-%{python3_version} -s -vv tests %{python3_sitelib}/libarchive* %changelog +* Sat May 4 2019 Zbigniew Jędrzejewski-Szmek - 2.8-5 +- Fix compatibility with python3.8 (#1705558) + * Sat Feb 02 2019 Fedora Release Engineering - 2.8-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild