diff options
author | Mike Gilbert <floppym@gentoo.org> | 2013-12-25 10:42:26 -0500 |
---|---|---|
committer | Mike Gilbert <floppym@gentoo.org> | 2013-12-25 10:42:26 -0500 |
commit | 414ba660bccd3eed60f63cc8a1d117740065126f (patch) | |
tree | 991b0322df8ccc3bf81cdd3b573b5a45ebddbefc | |
parent | 9f9cbaa20fe644112daf0b6a2bbd39cf95d27f9d (diff) | |
download | routes-414ba660bccd3eed60f63cc8a1d117740065126f.tar.gz |
Specify encoding when opening files in setup.py
This resolves a UnicodeDecodeError when setup.py is invoked with a
non-utf8 locale.
https://bugs.gentoo.org/show_bug.cgi?id=495118
-rw-r--r-- | setup.py | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -1,12 +1,14 @@ __version__ = '2.0' -import os, sys +import io, os, sys from setuptools import setup, find_packages here = os.path.abspath(os.path.dirname(__file__)) -README = open(os.path.join(here, 'README.rst')).read() -CHANGES = open(os.path.join(here, 'CHANGELOG.rst')).read() +with io.open(os.path.join(here, 'README.rst'), encoding='utf8') as f: + README = f.read() +with io.open(os.path.join(here, 'CHANGELOG.rst'), encoding='utf8') as f: + CHANGES = f.read() PY3 = sys.version_info[0] == 3 extra_options = { |