Accepting request 723944 from devel:languages:python

OBS-URL: https://build.opensuse.org/request/show/723944
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-pycountry?expand=0&rev=5
This commit is contained in:
Dominique Leuenberger 2019-08-23 09:03:09 +00:00 committed by Git OBS Bridge
commit 3860a69d08
3 changed files with 43 additions and 0 deletions

View File

@ -0,0 +1,34 @@
From: Matthias Fehring <buschmann23@opensuse.org>
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',

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Fri Aug 16 06:52:52 UTC 2019 - Matthias Fehring <buschmann23@opensuse.org>
- 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 <tchvatal@suse.com>

View File

@ -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