From 8ad77853abd08486647b569836874cb319eea2ce Mon Sep 17 00:00:00 2001 From: Zach Nation Date: Tue, 13 Feb 2018 20:55:58 -0800 Subject: [PATCH] Use binary mode to read README.rst (#282) Then decode utf-8 explicitly. For some reason, otherwise we get: ``` + VERSION_NUMBER=4.1.1 + /builds/turi/turicreate-build/scripts/../deps/env/bin/python setup.py bdist_wheel Traceback (most recent call last): File "setup.py", line 127, in long_description = f.read() File "/builds/turi/turicreate-build/scripts/../deps/env/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 106: ordinal not in range(128) ``` --- src/unity/python/setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/unity/python/setup.py b/src/unity/python/setup.py index ddbb611728..0babc853ff 100644 --- a/src/unity/python/setup.py +++ b/src/unity/python/setup.py @@ -123,8 +123,8 @@ def run(self): sys.stderr.write(msg) sys.exit(1) - with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as f: - long_description = f.read() + with open(os.path.join(os.path.dirname(__file__), 'README.rst'), 'rb') as f: + long_description = f.read().decode('utf-8') setup( name="turicreate",