summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaphaël Barrois <raphael.barrois@polytechnique.org>2014-09-24 00:10:02 +0200
committerRaphaël Barrois <raphael.barrois@polytechnique.org>2014-09-24 00:10:02 +0200
commit79fb67f86c73092ac79dc0d2d371b9a6ab6adb79 (patch)
treef0c8c186cd4e1f6d8cc5e9a4577c471021080ad7
parentdeb6dd5a19f363d78659404208186f560ead4fc3 (diff)
downloadsemantic-version-79fb67f86c73092ac79dc0d2d371b9a6ab6adb79.tar.gz
Fix setup.py encoding issues (Closes #13).
-rwxr-xr-xsetup.py6
1 files 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: