From 6edcc7c970f3b7e80c9084d501abd7a2fdc32f5bed5f427bfa53ced0bb95bd09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Fri, 16 Aug 2019 09:38:16 +0000 Subject: [PATCH] Accepting request 723943 from home:buschmann23:branches:devel:languages:python fix build by adding pycountry-19.7.15-fix-reading-description.patch to fix wrong encoding when opening description files in setup.py OBS-URL: https://build.opensuse.org/request/show/723943 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pycountry?expand=0&rev=9 --- ...ntry-19.7.15-fix-reading-description.patch | 34 +++++++++++++++++++ python-pycountry.changes | 6 ++++ python-pycountry.spec | 3 ++ 3 files changed, 43 insertions(+) create mode 100644 pycountry-19.7.15-fix-reading-description.patch diff --git a/pycountry-19.7.15-fix-reading-description.patch b/pycountry-19.7.15-fix-reading-description.patch new file mode 100644 index 0000000..13ff94d --- /dev/null +++ b/pycountry-19.7.15-fix-reading-description.patch @@ -0,0 +1,34 @@ +From: Matthias Fehring +Date: 2019-08-16 08:16:00 +0200 +Subject: fix reading description files +Upstream: merged (https://bitbucket.org/flyingcircus/pycountry/pull-requests/26/read-readme-history-using-utf-8-encoding/diff) + +When reading the description in setup.py the wrong encoding will +be selected for the text files. + +--- + setup.py | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +--- a/setup.py 2019-07-15 16:35:49.000000000 +0200 ++++ b/setup.py 2019-08-16 08:12:49.493720089 +0200 +@@ -3,6 +3,8 @@ + # Copyright 2015- (c) Flying Circus Internet Operations GmbH + # See also LICENSE.txt + ++from io import open ++ + from setuptools import setup, find_packages + + +@@ -14,8 +16,8 @@ + description='ISO country, subdivision, language, currency and script ' + 'definitions and their translations', + long_description=( +- open('README.rst').read() + '\n' + +- open('HISTORY.txt').read()), ++ open('README.rst', encoding='utf-8').read() + '\n' + ++ open('HISTORY.txt', encoding='utf-8').read()), + license='LGPL 2.1', + keywords='country subdivision language currency iso 3166 639 4217 ' + '15924 3166-2', diff --git a/python-pycountry.changes b/python-pycountry.changes index a290127..cd79499 100644 --- a/python-pycountry.changes +++ b/python-pycountry.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri Aug 16 06:52:52 UTC 2019 - Matthias Fehring + +- add pycountry-19.7.15-fix-reading-description.patch to fix wrong + encoding when opening description files in setup.py + ------------------------------------------------------------------- Tue Jul 23 10:31:50 UTC 2019 - Tomáš Chvátal diff --git a/python-pycountry.spec b/python-pycountry.spec index 3083ef3..27da970 100644 --- a/python-pycountry.spec +++ b/python-pycountry.spec @@ -26,6 +26,8 @@ License: LGPL-2.1-only Group: Development/Libraries/Python URL: https://pypi.python.org/pypi/pycountry/ Source: https://pypi.io/packages/source/p/%{real_name}/%{real_name}-%{version}.tar.gz +# PATCH-FIX-UPSTREAM pycountry-19.7.15-fix-reading-description.patch buschmann23@opensuse.org -- fix wrong enconding +Patch0: pycountry-19.7.15-fix-reading-description.patch BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros @@ -45,6 +47,7 @@ Translation files for the various strings are included as well. %prep %setup -q -n %{real_name}-%{version} +%patch0 -p1 %build %python_build