Merge pull request #199 from jfcorbett/setup-encoding

Explicitly specify utf-8 encoding when opening file in setup.py
This commit is contained in:
Eric Lapouyade 2019-05-23 15:00:30 +02:00 committed by GitHub
commit 53ad9eedc4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -29,7 +29,7 @@ News
def get_version(pkg):
path = os.path.join(os.path.dirname(__file__),pkg,'__init__.py')
with open(path) as fh:
with open(path, encoding='utf-8') as fh:
m = re.search(r'^__version__\s*=\s*[\'"]([^\'"]+)[\'"]',fh.read(),re.M)
if m:
return m.group(1)