Skip to content

Commit 14d8c71

Browse files
authored
HOTFIX
/node rename_instance did not use utf-8 on writing
1 parent 85ebdf7 commit 14d8c71

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

core/data/impl/nodeimpl.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1163,13 +1163,16 @@ def change_instance_in_path(data):
11631163
for plugin in Path(os.path.join(self.config_dir, 'plugins')).glob('*.yaml'):
11641164
data = yaml.load(plugin.read_text(encoding='utf-8'))
11651165
change_instance_in_config(data)
1166-
yaml.dump(data, plugin)
1166+
with plugin.open('w', encoding='utf-8') as outfile:
1167+
yaml.dump(data, outfile)
11671168

11681169
# rename service configs
11691170
for service in Path(os.path.join(self.config_dir, 'services')).glob('*.yaml'):
11701171
data = yaml.load(service.read_text(encoding='utf-8'))
11711172
change_instance_in_config(data)
1172-
yaml.dump(data, service)
1173+
with service.open('w', encoding='utf-8') as outfile:
1174+
yaml.dump(data, outfile)
1175+
11731176

11741177
# restart all services but the bot
11751178
tasks = []

0 commit comments

Comments
 (0)