Skip to content
This repository was archived by the owner on Mar 19, 2024. It is now read-only.

Commit 979d8a9

Browse files
Celebiofacebook-github-bot
authored andcommitted
fix README open with encoding issue in python 2
Summary: following pull request #834, opening the README file in python 2 fails due to a different API of the `open` function. Using `io.open` fixes the issue. Reviewed By: EdouardGrave Differential Revision: D16019456 fbshipit-source-id: 107ff1017508b282524f804bd086e712715a6be3
1 parent f374817 commit 979d8a9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import os
2020
import subprocess
2121
import platform
22+
import io
2223

2324
__version__ = '0.9'
2425
FASTTEXT_SRC = "src"
@@ -160,7 +161,7 @@ def _get_readme():
160161
Use pandoc to generate rst from md.
161162
pandoc --from=markdown --to=rst --output=python/README.rst python/README.md
162163
"""
163-
with open("python/README.rst", encoding='utf-8') as fid:
164+
with io.open("python/README.rst", encoding='utf-8') as fid:
164165
return fid.read()
165166

166167

0 commit comments

Comments
 (0)