From 79fb67f86c73092ac79dc0d2d371b9a6ab6adb79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Barrois?= Date: Wed, 24 Sep 2014 00:10:02 +0200 Subject: Fix setup.py encoding issues (Closes #13). --- setup.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index d95f82c..8f4a60b 100755 --- a/setup.py +++ b/setup.py @@ -2,6 +2,8 @@ # -*- coding: utf-8 -*- # Copyright (c) 2012-2014 The python-semanticversion project + +import codecs import os import re import sys @@ -14,8 +16,8 @@ root_dir = os.path.abspath(os.path.dirname(__file__)) def get_version(package_name): version_re = re.compile(r"^__version__ = [\"']([\w_.-]+)[\"']$") package_components = package_name.split('.') - path_components = package_components + ['__init__.py'] - with open(os.path.join(root_dir, *path_components)) as f: + init_path = os.path.join(root_dir, *(package_components + ['__init__.py'])) + with codecs.open(init_path, 'r', 'utf-8') as f: for line in f: match = version_re.match(line[:-1]) if match: -- cgit v1.2.1