Skip to content

Commit 7854328

Browse files
committed
Specify encoding="utf-8" in setup.py loaders
Fixes #304
1 parent eb73b06 commit 7854328

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

setup.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,21 @@
66
HERE = os.path.abspath(os.path.dirname(__file__))
77

88
version_ns = {}
9-
with open(os.path.join(HERE, NAME, '_version.py')) as f:
9+
10+
def _open(subpath):
11+
path = os.path.join(HERE, subpath)
12+
return open(path, encoding="utf-8")
13+
14+
with _open(NAME + '/_version.py') as f:
1015
exec(f.read(), {}, version_ns)
1116

12-
with open(os.path.join(HERE, "requirements.txt")) as f:
17+
with _open("requirements.txt") as f:
1318
base_reqs = f.read().strip().split("\n")
1419

15-
with open(os.path.join(HERE, "requirements-dev.txt")) as f:
20+
with _open("requirements-dev.txt") as f:
1621
dev_reqs = f.read().strip().split("\n")
1722

18-
with open(os.path.join(HERE, "README.md")) as f:
23+
with _open("README.md") as f:
1924
long_description = f.read()
2025

2126
setup(

0 commit comments

Comments
 (0)