From cf153730584853e003f71a3efb9aa1aef4d2d3c7 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Mon, 8 Jun 2015 14:29:35 +0200 Subject: [PATCH] Read README.rst and HISTORY.rst in UTF-8 Since README.rst now contains a snowman character, running setup.py on Python 3 with a locale encoding different than UTF-8 doesn't work anymore. Specify the UTF-8 encoding when reading README.rst and HISTORY.rst in setup.py to fix this issue. --- setup.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 28a4e26..b84deac 100755 --- a/setup.py +++ b/setup.py @@ -1,5 +1,6 @@ #!/usr/bin/env python +import io import os import sys @@ -18,10 +19,10 @@ 'rfc3986', ] -with open('README.rst') as f: +with io.open('README.rst', encoding='utf-8') as f: readme = f.read() -with open('HISTORY.rst') as f: +with io.open('HISTORY.rst', encoding='utf-8') as f: history = f.read() setup(