Skip to content

Commit f0f1c68

Browse files
Juuso "Linda" Lapinlampidaviddrysdale
authored andcommitted
setup.py: Read README.md as a UTF-8 file
open()'s encoding is platform-dependent. Building from source would fail on OpenBSD (FTBFS), where the encoding defaults to ascii and not UTF-8. Fixup to commit ef5608d.
1 parent 8bfcc87 commit f0f1c68

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

python/setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
# limitations under the License.
1717

1818
import distutils.core
19+
import io
1920
import sys
2021
# Importing setuptools adds some features like "setup.py test", but
2122
# it's optional so swallow the error if it's not there.
@@ -44,7 +45,7 @@
4445
except ImportError:
4546
lite = True
4647

47-
with open("README.md", "r") as readme:
48+
with io.open("README.md", mode="r", encoding="utf-8") as readme:
4849
long_description = readme.read()
4950

5051
# Various parameters depend on whether we are the lite package or not

0 commit comments

Comments
 (0)