diff options
author | Raphaël Barrois <raphael.barrois@polytechnique.org> | 2014-09-24 00:10:02 +0200 |
---|---|---|
committer | Raphaël Barrois <raphael.barrois@polytechnique.org> | 2014-09-24 00:10:02 +0200 |
commit | 79fb67f86c73092ac79dc0d2d371b9a6ab6adb79 (patch) | |
tree | f0c8c186cd4e1f6d8cc5e9a4577c471021080ad7 | |
parent | deb6dd5a19f363d78659404208186f560ead4fc3 (diff) | |
download | semantic-version-79fb67f86c73092ac79dc0d2d371b9a6ab6adb79.tar.gz |
Fix setup.py encoding issues (Closes #13).
-rwxr-xr-x | setup.py | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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: |