Skip to content

Commit

Permalink
Read README.rst and HISTORY.rst in UTF-8
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
vstinner committed Jun 8, 2015
1 parent 0dc2402 commit cf15373
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env python

import io
import os
import sys

Expand All @@ -18,10 +19,10 @@
'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(
Expand Down

0 comments on commit cf15373

Please sign in to comment.