[Python-modules-commits] [django-oauth-toolkit] 08/12: Use io.open to read UTF-8 encoded files.

Michael Fladischer fladi at moszumanska.debian.org
Wed Dec 7 19:43:49 UTC 2016


This is an automated email from the git hooks/post-receive script.

fladi pushed a commit to branch master
in repository django-oauth-toolkit.

commit 32081b61f7ea91b548abadc53c8210e907ef6c20
Author: Michael Fladischer <FladischerMichael at fladi.at>
Date:   Wed Dec 7 17:14:14 2016 +0100

    Use io.open to read UTF-8 encoded files.
---
 setup.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/setup.py b/setup.py
index 309c526..89e8d6b 100644
--- a/setup.py
+++ b/setup.py
@@ -2,6 +2,7 @@
 # -*- coding: utf-8 -*-
 
 from setuptools import setup, find_packages
+import io
 import os
 import re
 
@@ -10,14 +11,14 @@ def get_version(package):
     """
     Return package version as listed in `__version__` in `init.py`.
     """
-    init_py = open(os.path.join(package, '__init__.py')).read()
+    init_py = io.open(os.path.join(package, '__init__.py'), encoding='utf-8').read()
     return re.match("__version__ = ['\"]([^'\"]+)['\"]", init_py).group(1)
 
 
 version = get_version('oauth2_provider')
 
 
-LONG_DESCRIPTION = open('README.rst').read()
+LONG_DESCRIPTION = io.open('README.rst', encoding='utf-8').read()
 
 setup(
     name="django-oauth-toolkit",

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/django-oauth-toolkit.git



More information about the Python-modules-commits mailing list