From 6e5e40e7e46e34179bedace2abc39f6e01107bd0 Mon Sep 17 00:00:00 2001 From: Hendrik Wiese Date: Sun, 9 Jun 2024 10:58:34 +0200 Subject: [PATCH] fix: use resources.files... read_text is deprecated Co-authored-by: chayleaf --- maubot/cli/commands/init.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/maubot/cli/commands/init.py b/maubot/cli/commands/init.py index 4105d9c..a65b76b 100644 --- a/maubot/cli/commands/init.py +++ b/maubot/cli/commands/init.py @@ -33,9 +33,9 @@ def load_templates(): global mod_template, meta_template, base_config, loaded if loaded: return - meta_template = Template(resources.read_text("maubot.cli", "res/maubot.yaml.j2")) - mod_template = Template(resources.read_text("maubot.cli", "res/plugin.py.j2")) - base_config = resources.read_text("maubot.cli", "res/config.yaml") + meta_template = Template(resources.files("maubot.cli").joinpath("res/maubot.yaml.j2").read_text(encoding="utf-8")) + mod_template = Template(resources.files("maubot.cli").joinpath("res/plugin.py.j2").read_text(encoding="utf-8")) + base_config = resources.files("maubot.cli").joinpath("res/config.yaml").read_text(encoding="utf-8") loaded = True