Skip to content

Commit

Permalink
Specify encoding when opening plugin json file
Browse files Browse the repository at this point in the history
  • Loading branch information
phw committed Jan 20, 2024
1 parent 71c3d1c commit 8d5408d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions website/frontend/views/plugins.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from collections import OrderedDict
import os
import json
from flask import current_app, Blueprint, render_template
from website.plugin_utils import plugins_json_file
Expand All @@ -13,7 +12,7 @@ def show_plugins():
for version, build_version in sorted([(key, versions[key]['title']) for key in versions]):
ordered_plugins = OrderedDict()
build_json_file = plugins_json_file(current_app, build_version)
with open(build_json_file, "r") as fp:
with open(build_json_file, "r", encoding='utf-8') as fp:
plugins = json.loads(fp.read())['plugins']
for key in sorted(plugins, key=lambda k: plugins[k]['name'].lower()):
ordered_plugins[key] = plugins[key]
Expand Down

0 comments on commit 8d5408d

Please sign in to comment.