[Python-modules-commits] [elasticsearch-curator] 02/06: Properly read unicode data from README.md for Python 3
Apollon Oikonomopoulos
apoikos at moszumanska.debian.org
Wed Sep 7 12:44:36 UTC 2016
This is an automated email from the git hooks/post-receive script.
apoikos pushed a commit to branch master
in repository elasticsearch-curator.
commit 1075a5198601f4711a836d3fed638de7167476f7
Author: Apollon Oikonomopoulos <apoikos at debian.org>
Date: Thu Oct 8 09:00:30 2015 -0700
Properly read unicode data from README.md for Python 3
README.md contains non-ASCII characters and Python 3 errors out since it was
not instructed to read unicode data from the file. Fix this by opening the
file with a utf-8 encoding for Python 3.
Forwarded: no
Last-Update: 2015-02-02
Patch-Name: setup.py-read-README-utf-8
---
setup.py | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/setup.py b/setup.py
index b3713a8..121c9ed 100644
--- a/setup.py
+++ b/setup.py
@@ -5,7 +5,11 @@ from setuptools import setup
# Utility function to read from file.
def fread(fname):
- return open(os.path.join(os.path.dirname(__file__), fname)).read()
+ try:
+ text = open(os.path.join(os.path.dirname(__file__), fname), encoding='utf-8').read()
+ except TypeError:
+ text = open(os.path.join(os.path.dirname(__file__), fname)).read()
+ return text
def get_version():
VERSIONFILE="curator/_version.py"
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/elasticsearch-curator.git
More information about the Python-modules-commits
mailing list