From 1acdb5d553ef3d8dbe3e586d17d7af8baf7fba4e Mon Sep 17 00:00:00 2001 From: Felix Krull Date: Tue, 24 May 2016 16:04:20 +0200 Subject: [PATCH 1/4] Open file to read version as UTF-8. --- setup.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index b9e683f..1521fef 100644 --- a/setup.py +++ b/setup.py @@ -1,10 +1,12 @@ from setuptools import setup, find_packages +from io import open from os import path import re VERSION = re.search("VERSION = '([^']+)'", open( - path.join(path.dirname(__file__), 'webencodings', '__init__.py') + path.join(path.dirname(__file__), 'webencodings', '__init__.py'), + encoding='utf-8' ).read().strip()).group(1) LONG_DESCRIPTION = open(path.join(path.dirname(__file__), 'README.rst')).read() From f4db4bfd024897a39bc79c8b3ea9ff6ccc5415c3 Mon Sep 17 00:00:00 2001 From: Felix Krull Date: Tue, 24 May 2016 16:04:45 +0200 Subject: [PATCH 2/4] Replace unnecessary non-ASCII characters. --- webencodings/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webencodings/__init__.py b/webencodings/__init__.py index 1ddec05..96171f0 100644 --- a/webencodings/__init__.py +++ b/webencodings/__init__.py @@ -185,7 +185,7 @@ def encode(input, encoding=UTF8, errors='strict'): def iter_decode(input, fallback_encoding, errors='replace'): """ - “Pull”-based decoder. + "Pull"-based decoder. :param input: An iterable of byte strings. From 09579c89f6f765c19939d782d6f8dc97774d86d4 Mon Sep 17 00:00:00 2001 From: Felix Krull Date: Wed, 25 May 2016 16:28:38 +0200 Subject: [PATCH 3/4] Use io.open explicitly. --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 1521fef..3df0d84 100644 --- a/setup.py +++ b/setup.py @@ -1,10 +1,10 @@ from setuptools import setup, find_packages -from io import open +import io from os import path import re -VERSION = re.search("VERSION = '([^']+)'", open( +VERSION = re.search("VERSION = '([^']+)'", io.open( path.join(path.dirname(__file__), 'webencodings', '__init__.py'), encoding='utf-8' ).read().strip()).group(1) From 6fb5d1cee73b3a7a2373502c60605100a9a6d153 Mon Sep 17 00:00:00 2001 From: Felix Krull Date: Wed, 25 May 2016 16:29:55 +0200 Subject: [PATCH 4/4] Also specify encoding when opening README.rst. --- setup.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 3df0d84..541163a 100644 --- a/setup.py +++ b/setup.py @@ -9,7 +9,10 @@ encoding='utf-8' ).read().strip()).group(1) -LONG_DESCRIPTION = open(path.join(path.dirname(__file__), 'README.rst')).read() +LONG_DESCRIPTION = io.open( + path.join(path.dirname(__file__), 'README.rst'), + encoding='utf-8' +).read() setup(