Skip to content

Commit

Permalink
Explicitly decode files as utf-8. (#7)
Browse files Browse the repository at this point in the history
* Explicitly decode files as utf-8.

Both README and _version.py seem to contain non-ascii characters, and this code fails when ascii encoding is used.

* exec does not need decoding

_version file has utf-8 stanza at the top

* Use open encoding param.

Co-authored-by: Can Güney Aksakalli <[email protected]>

* Revert "Use open encoding param."

This reverts commit 51740fc.

Co-authored-by: Can Güney Aksakalli <[email protected]>
  • Loading branch information
glukasiknuro and aksakalli authored May 20, 2020
1 parent 46316f4 commit d7fae00
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
if sys.version_info[0] == 2:
install_requires = ["enum34", "typing"]

with open("README.md") as f:
readme = f.read()
with open("README.md", "rb") as f:
readme = f.read().decode("utf-8")

about = {}
with open("openlr/_version.py") as f:
with open("openlr/_version.py", "rb") as f:
exec(f.read(), about)

setup(
Expand Down

0 comments on commit d7fae00

Please sign in to comment.