Skip to content

Commit

Permalink
Specify encoding="utf-8" in setup.py loaders
Browse files Browse the repository at this point in the history
Fixes #304
  • Loading branch information
jsvine committed Nov 13, 2020
1 parent eb73b06 commit 7854328
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,21 @@
HERE = os.path.abspath(os.path.dirname(__file__))

version_ns = {}
with open(os.path.join(HERE, NAME, '_version.py')) as f:

def _open(subpath):
path = os.path.join(HERE, subpath)
return open(path, encoding="utf-8")

with _open(NAME + '/_version.py') as f:
exec(f.read(), {}, version_ns)

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

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

with open(os.path.join(HERE, "README.md")) as f:
with _open("README.md") as f:
long_description = f.read()

setup(
Expand Down

0 comments on commit 7854328

Please sign in to comment.