From 002de46a4e1932b1bac45ffc90ca8f86129f6201 Mon Sep 17 00:00:00 2001 From: Al Date: Thu, 13 Jun 2024 15:28:20 +0200 Subject: [PATCH] fix: set explicit utf-8 encoding as part of writer invocation (#27) * fix: set explicit utf-8 encoding as part of writer invocation * chore: bump requests --- examples/__main__.py | 2 +- poetry.lock | 8 ++++---- src/algokit_client_generator/writer.py | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/__main__.py b/examples/__main__.py index 24cc41d..e4507c6 100644 --- a/examples/__main__.py +++ b/examples/__main__.py @@ -46,7 +46,7 @@ def main() -> None: logger.info(f" Building app {app.name}") app_spec = app.build() logger.info(f" Writing {example.name}/application.json") - (example / "application.json").write_text(to_json(app_spec)) + (example / "application.json").write_text(to_json(app_spec), encoding="utf-8") if __name__ == "__main__": diff --git a/poetry.lock b/poetry.lock index 27ab7d6..f81c7a6 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1584,13 +1584,13 @@ md = ["cmarkgfm (>=0.8.0)"] [[package]] name = "requests" -version = "2.31.0" +version = "2.32.3" description = "Python HTTP for Humans." optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" files = [ - {file = "requests-2.31.0-py3-none-any.whl", hash = "sha256:58cd2187c01e70e6e26505bca751777aa9f2ee0b7f4300988b709f44e013003f"}, - {file = "requests-2.31.0.tar.gz", hash = "sha256:942c5a758f98d790eaed1a29cb6eefc7ffb0d1cf7af05c3d2791656dbd6ad1e1"}, + {file = "requests-2.32.3-py3-none-any.whl", hash = "sha256:70761cfe03c773ceb22aa2f671b4757976145175cdfca038c02654d061d6dcc6"}, + {file = "requests-2.32.3.tar.gz", hash = "sha256:55365417734eb18255590a9ff9eb97e9e1da868d4ccd6402399eaf68af20a760"}, ] [package.dependencies] diff --git a/src/algokit_client_generator/writer.py b/src/algokit_client_generator/writer.py index d53ec6a..2801a63 100644 --- a/src/algokit_client_generator/writer.py +++ b/src/algokit_client_generator/writer.py @@ -19,7 +19,7 @@ def generate_client(input_path: Path, output_path: Path) -> None: context = GenerateContext(app_spec) output = render(generate(context)) - output_path.write_text(output) + output_path.write_text(output, encoding="utf-8") logger.info(f"Output typed client for {app_spec.contract.name} to {output_path}")