From: Mathias Behrle Date: Tue, 12 May 2015 12:49:22 +0000 (+0200) Subject: Fixing UnicodeDecodeError in setup.py (issue22). X-Git-Tag: 1.3.1~9^2 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e75addd999cdd702675fdb27c9eaefe51fe68e06;p=cached-property.git Fixing UnicodeDecodeError in setup.py (issue22). --- diff --git a/setup.py b/setup.py index a3855b6..c26ef9b 100755 --- a/setup.py +++ b/setup.py @@ -3,6 +3,7 @@ import os import sys +import codecs try: from setuptools import setup @@ -11,8 +12,13 @@ except ImportError: __version__ = '1.2.0' -readme = open('README.rst').read() -history = open('HISTORY.rst').read().replace('.. :changelog:', '') + +def read(fname): + return codecs.open( + os.path.join(os.path.dirname(__file__), fname), 'r', 'utf-8').read() + +readme = read('README.rst') +history = read('HISTORY.rst').replace('.. :changelog:', '') if sys.argv[-1] == 'publish': os.system('python setup.py sdist bdist_wheel upload')