From 3bd823958bb2bbe651b89647202a2a1ef6875815 Mon Sep 17 00:00:00 2001 From: Ulf Magnusson Date: Wed, 18 Jul 2018 02:21:39 +0200 Subject: setup.py: Specify encoding when reading README.rst https://github.com/clearlinux-pkgs/python-kconfiglib adds a patch for this. It avoids issues on systems that use the C locale, which implies ASCII encoding and raises UnicodeDecodeError when reading README.rst. Piggyback adding 'menuconfig' as another keyword. --- setup.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'setup.py') diff --git a/setup.py b/setup.py index 621b66d..f7137d6 100644 --- a/setup.py +++ b/setup.py @@ -1,3 +1,4 @@ +import io import os import setuptools @@ -6,12 +7,20 @@ setuptools.setup( # MAJOR.MINOR.PATCH, per http://semver.org version="9.0.0", description="A flexible Python Kconfig parser", + + # Make sure that README.rst decodes on Python 3 in environments that use + # the C locale (which implies ASCII), by explicitly giving the encoding. + # + # io.open() has the 'encoding' parameter on both Python 2 and 3. open() + # doesn't have it on Python 2. This lets us to use the same code for both. long_description= - open(os.path.join(os.path.dirname(__file__), "README.rst")).read(), + io.open(os.path.join(os.path.dirname(__file__), "README.rst"), + encoding="utf-8").read(), + url="https://github.com/ulfalizer/Kconfiglib", author='Ulf "Ulfalizer" Magnusson', author_email="ulfalizer@gmail.com", - keywords="kconfig, kbuild", + keywords="kconfig, kbuild, menuconfig", license="ISC", py_modules=( -- cgit v1.2.3