From 55f444179305fa96d2727ed0a233fd5d263d1183 Mon Sep 17 00:00:00 2001 From: Bilal Amarni Date: Fri, 1 Jun 2018 11:48:29 +0200 Subject: [PATCH] Pass utf-8 encoding when opening the README This was causing an error on my setup where LC_ALL wasn't set to UTF-8. ``` Traceback (most recent call last): File "", line 1, in File "/private/var/folders/pz/w736zydx5pxdjbn0l0h_28_80000gr/T/pip-install-9c1pe10m/click-spinner/setup.py", line 6, in readme = f.read() File "/Users/user/.pyenv/versions/3.5.5/Python.framework/Versions/3.5/lib/python3.5/encodings/ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 373: ordinal not in range(128) ``` Even though this usually happens on wrongly configured environments I think it makes sense to enforce it. --- setup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index b0e86f6..402f649 100644 --- a/setup.py +++ b/setup.py @@ -1,8 +1,9 @@ +from io import open from setuptools import setup import versioneer -with open('README.md') as f: +with open('README.md', encoding="utf8") as f: readme = f.read() setup(