Fixing version decoding issue (#88)

This commit is contained in:
Anshuman Goel 2020-10-07 07:04:47 -07:00 committed by GitHub
parent 4071794de1
commit 4b87bdd769
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -16,8 +16,8 @@ from .__version__ import __version__
def read_local_file(filename: str) -> str:
path = os.path.join(os.path.dirname(os.path.realpath(__file__)), filename)
if os.path.exists(path):
with open(path, "r") as handle:
return handle.read().strip()
with open(path, "rb") as handle:
return handle.read().strip().decode("utf-16")
else:
return "UNKNOWN"