Read README.rst and HISTORY.rst in UTF-8

Since README.rst now contains a snowman character, running setup.py on
Python 3 with a locale encoding different than UTF-8 doesn't work
anymore.

Specify the UTF-8 encoding when reading README.rst and HISTORY.rst in
setup.py to fix this issue.
This commit is contained in:
Victor Stinner
2015-06-08 14:29:35 +02:00
parent 0dc24028c5
commit cf15373058

View File

@@ -1,5 +1,6 @@
#!/usr/bin/env python
import io
import os
import sys
@@ -18,10 +19,10 @@ packages = [
'rfc3986',
]
with open('README.rst') as f:
with io.open('README.rst', encoding='utf-8') as f:
readme = f.read()
with open('HISTORY.rst') as f:
with io.open('HISTORY.rst', encoding='utf-8') as f:
history = f.read()
setup(