# HG changeset patch # User Denis Laxalde # Date 1465557834 -7200 # Node ID 6eeb7abda47a98984f4b91b8074b76aa3513a593 # Parent c655e19cbc35e057661c58db37180e88352e1af2 [pkg] Use io.open with utf-8 encoding to read long description from README This forces decoding so that this is consistent between Python 2 and 3 as, in Python 3, decoding which would occur anyways and may fail depending on the environment locale settings. diff -r c655e19cbc35 -r 6eeb7abda47a setup.py --- a/setup.py Tue Jun 07 10:05:30 2016 +0200 +++ b/setup.py Fri Jun 10 13:23:54 2016 +0200 @@ -21,6 +21,7 @@ """Generic Setup script, takes package info from __pkginfo__.py file """ +import io import os import sys import shutil @@ -53,7 +54,8 @@ author = __pkginfo__['author'] author_email = __pkginfo__['author_email'] -long_description = open('README').read() +with io.open('README', encoding='utf-8') as f: + long_description = f.read() # import optional features if USE_SETUPTOOLS: