From a07338e3031b4f11af1cdb1113ed3995db32c87a Mon Sep 17 00:00:00 2001 From: Jiachen Yang Date: Mon, 19 Dec 2016 18:50:13 +0900 Subject: [PATCH 1/2] Set setup.py open file encoding to UTF-8 Package building environments usually differ with a working environment where locale settings are tricky. This change enforce using UTF-8 to open files in setup.py in order to avoid possible encoding errors when reading README and changelog files when they contain non-ASCII chars. --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index e69080f5..cd77727c 100755 --- a/setup.py +++ b/setup.py @@ -17,8 +17,8 @@ entry_points = { ] } -README = open('README.rst').read() -CHANGELOG = open('docs/changelog.rst').read() +README = open('README.rst', 'r', encoding='utf-8').read() +CHANGELOG = open('docs/changelog.rst', 'r', encoding='utf-8').read() setup( name='pelican', From 7a026f548c1e2257998aa5cbd30494403c14a3d2 Mon Sep 17 00:00:00 2001 From: Jiachen Yang Date: Mon, 19 Dec 2016 19:00:20 +0900 Subject: [PATCH 2/2] Fix open(,encoding=) under python2 Use open in io for encoding under python2 --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index cd77727c..9ab4d26c 100755 --- a/setup.py +++ b/setup.py @@ -1,6 +1,7 @@ #!/usr/bin/env python from os import walk from os.path import join, relpath +from io import open from setuptools import setup