Skip to content

Commit

Permalink
Merge pull request #11675 from archesproject/jtw/close-files-i18n
Browse files Browse the repository at this point in the history
Remove memory leaks from GetFrontendI18NData
  • Loading branch information
apeters authored Dec 4, 2024
2 parents 1e23a51 + 8c8977e commit 02f2d8c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions arches/app/views/api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,8 @@ def get(self, request):
localized_strings = {}
for lang_file in language_file_path:
try:
localized_strings = (
json.load(open(lang_file))[user_language] | localized_strings
)
with open(lang_file, "r", encoding="utf-8") as f:
localized_strings = json.load(f)[user_language] | localized_strings
except FileNotFoundError:
pass

Expand Down

0 comments on commit 02f2d8c

Please sign in to comment.