From 9dfcb9cda7a6d116cc1637b7de030c784caea53452ee1a4e8d1b3f1afc14f89c Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Mon, 31 May 2021 12:59:02 +0000 Subject: [PATCH] - 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 --- plistlib-Data.patch | 17 +++++++++++++++++ python-biplist.changes | 6 ++++++ python-biplist.spec | 10 ++++++---- 3 files changed, 29 insertions(+), 4 deletions(-) create mode 100644 plistlib-Data.patch diff --git a/plistlib-Data.patch b/plistlib-Data.patch new file mode 100644 index 0000000..1b0ea9b --- /dev/null +++ b/plistlib-Data.patch @@ -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): diff --git a/python-biplist.changes b/python-biplist.changes index 61b8f5f..11338b6 100644 --- a/python-biplist.changes +++ b/python-biplist.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon May 31 12:48:50 UTC 2021 - Matej Cepl + +- Add plistlib-Data.patch to avoid deprecated plistslib.Data + (bt#wooster/biplist#12). + ------------------------------------------------------------------- Thu Apr 2 11:42:53 UTC 2020 - Paolo Stivanin diff --git a/python-biplist.spec b/python-biplist.spec index ded5eff..e0f74c7 100644 --- a/python-biplist.spec +++ b/python-biplist.spec @@ -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