From 8b3fdb24c0004f29431eb39207ae046d3a4863fd Mon Sep 17 00:00:00 2001 From: Ken Kroenlein <51962276+kroenlein@users.noreply.github.com> Date: Tue, 14 May 2024 09:56:54 -0600 Subject: [PATCH] Fix package import encoding issues (#216) --- gemd/__version__.py | 2 +- gemd/demo/strehlow_and_cook.py | 2 +- gemd/units/impl.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gemd/__version__.py b/gemd/__version__.py index e835b9d..df4be5e 100644 --- a/gemd/__version__.py +++ b/gemd/__version__.py @@ -1 +1 @@ -__version__ = "2.1.3" +__version__ = "2.1.4" diff --git a/gemd/demo/strehlow_and_cook.py b/gemd/demo/strehlow_and_cook.py index 1bd5dad..11e1035 100644 --- a/gemd/demo/strehlow_and_cook.py +++ b/gemd/demo/strehlow_and_cook.py @@ -48,7 +48,7 @@ def import_table(filename=SMALL_TABLE): from importlib_resources import files import json - return json.loads(files("gemd.demo").joinpath(filename).read_text()) + return json.loads(files("gemd.demo").joinpath(filename).read_text(encoding='utf-8')) def _fingerprint(row): diff --git a/gemd/units/impl.py b/gemd/units/impl.py index 7c3c801..7622343 100644 --- a/gemd/units/impl.py +++ b/gemd/units/impl.py @@ -35,7 +35,7 @@ def _deploy_default_files() -> Tuple[Path, Path]: target_paths = tuple(target_dir / f for f in ("citrine_en.txt", "constants_en.txt")) for target in target_paths: source = resources.joinpath(target.name) - target.write_text(source.read_text(), encoding="utf-8") + target.write_bytes(source.read_bytes()) return target_paths