From a658e14e8b7f578d55102b981ce8828b906b432f Mon Sep 17 00:00:00 2001 From: Ben Firshman Date: Mon, 28 Nov 2016 14:37:34 +0000 Subject: [PATCH] Specify encoding when loading readme Loading readme fails when system locale is not utf-8. Potentially replaces #1313 Signed-off-by: Ben Firshman --- setup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 89c97c87..2d1bfdbb 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,5 @@ #!/usr/bin/env python +import codecs import os import sys @@ -35,7 +36,7 @@ with open('./test-requirements.txt') as test_reqs_txt: long_description = '' try: - with open('./README.rst') as readme_rst: + with codecs.open('./README.rst', encoding='utf-8') as readme_rst: long_description = readme_rst.read() except IOError: # README.rst is only generated on release. Its absence should not prevent