summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorUlf Magnusson <ulfalizer@gmail.com>2018-07-18 02:21:39 +0200
committerUlf Magnusson <ulfalizer@gmail.com>2018-07-18 02:27:49 +0200
commit3bd823958bb2bbe651b89647202a2a1ef6875815 (patch)
tree7fc172a1b2b7be14856e97892658a63ec08e94d6 /setup.py
parentedffe870f25d2f594bc2dbc918db97bee5774efa (diff)
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.
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py13
1 files changed, 11 insertions, 2 deletions
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=(