Skip to content

Commit eb282c6

Browse files
committed
Merge pull request un33k#4 from pudo/master
fix file reading in python 3
2 parents 2c338a8 + 29cac30 commit eb282c6

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎setup.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import re
66
import os
77
import sys
8+
import codecs
89

910

1011
name = 'python-slugify'
@@ -28,7 +29,7 @@ def get_version(package):
2829
"""
2930
Return package version as listed in `__version__` in `init.py`.
3031
"""
31-
init_py = open(os.path.join(package, '__init__.py')).read()
32+
init_py = codecs.open(os.path.join(package, '__init__.py'), encoding='utf-8').read()
3233
return re.search("^__version__ = ['\"]([^'\"]+)['\"]", init_py, re.MULTILINE).group(1)
3334

3435

0 commit comments

Comments
 (0)