15
0

- Add plistlib-Data.patch to avoid deprecated plistslib.Data

(bt#wooster/biplist#12).

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-biplist?expand=0&rev=20
This commit is contained in:
2021-05-31 12:59:02 +00:00
committed by Git OBS Bridge
parent 3805aa1d71
commit 9dfcb9cda7
3 changed files with 29 additions and 4 deletions

17
plistlib-Data.patch Normal file
View File

@@ -0,0 +1,17 @@
---
biplist/__init__.py | 154 ++++++++++++++++++++++++++--------------------------
1 file changed, 77 insertions(+), 77 deletions(-)
--- a/biplist/__init__.py
+++ b/biplist/__init__.py
@@ -150,8 +150,8 @@ def wrapDataObject(o, for_binary=False):
if isinstance(o, Data) and not for_binary:
v = sys.version_info
if not (v[0] >= 3 and v[1] >= 4):
- o = plistlib.Data(o)
- elif isinstance(o, (bytes, plistlib.Data)) and for_binary:
+ o = bytes(o)
+ elif isinstance(o, bytes) and for_binary:
if hasattr(o, 'data'):
o = Data(o.data)
elif isinstance(o, tuple):

View File

@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Mon May 31 12:48:50 UTC 2021 - Matej Cepl <mcepl@suse.com>
- Add plistlib-Data.patch to avoid deprecated plistslib.Data
(bt#wooster/biplist#12).
-------------------------------------------------------------------
Thu Apr 2 11:42:53 UTC 2020 - Paolo Stivanin <info@paolostivanin.com>

View File

@@ -1,7 +1,7 @@
#
# spec file for package python-biplist
#
# Copyright (c) 2020 SUSE LLC
# Copyright (c) 2021 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -27,6 +27,9 @@ URL: https://bitbucket.org/wooster/biplist
Source: https://files.pythonhosted.org/packages/source/b/biplist/biplist-%{version}.tar.gz
# Test on 32bit expects long==int which is true only on py3
Patch0: skip-test.patch
# PATCH-FIX-UPSTREAM plistlib-Data.patch bt#wooster/biplist#12 mcepl@suse.com
# Add plistlib-Data.patch to avoid deprecated plistslib.Data
Patch1: plistlib-Data.patch
BuildRequires: %{python_module coverage}
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
@@ -42,8 +45,7 @@ format for property lists on OS X. This is a library for generating binary
plists which can be read by OS X, iOS, or other clients.
%prep
%setup -q -n biplist-%{version}
%patch0 -p1
%autosetup -p1 -n biplist-%{version}
%build
%python_build
@@ -53,7 +55,7 @@ plists which can be read by OS X, iOS, or other clients.
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%check
%python_exec -m unittest discover -s tests -v
%pyunittest discover -s tests -v
%files %{python_files}
%license LICENSE