summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2023-04-17 16:40:57 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2023-04-17 16:40:57 +0200
commit2b9862d29073e31cc89e807fd355a691b0d932dd (patch)
treed3599b0ac224c623a6bcf2552f22ff2f59257658
parentd1ada300766d0fb61a2a9b1a3f1bb0d36f04a548 (diff)
downloadIshtar-2b9862d29073e31cc89e807fd355a691b0d932dd.tar.bz2
Ishtar-2b9862d29073e31cc89e807fd355a691b0d932dd.zip
Fix changelog read (explicit utf8 coding on opening)
-rw-r--r--ishtar_common/context_processors.py2
-rw-r--r--ishtar_common/views.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/ishtar_common/context_processors.py b/ishtar_common/context_processors.py
index d1e088a8f..74e38efc4 100644
--- a/ishtar_common/context_processors.py
+++ b/ishtar_common/context_processors.py
@@ -53,7 +53,7 @@ def _get_changelog_version_from_file():
return "no-version"
changelog_file = os.path.join(changelog_dir, filename)
current_version = None
- with open(changelog_file, "r") as changelog:
+ with open(changelog_file, "r", encoding="utf-8") as changelog:
for line in changelog.readlines():
m = re.match(r"v(\d+)\.(\d+)\.(\d+)", line)
if not m:
diff --git a/ishtar_common/views.py b/ishtar_common/views.py
index a49dc7aee..ba205abf3 100644
--- a/ishtar_common/views.py
+++ b/ishtar_common/views.py
@@ -1191,7 +1191,7 @@ class ChangelogView(IshtarMixin, LoginRequiredMixin, TemplateView):
if not current_file:
raise Http404()
changelog_file = os.path.join(changelog_dir, current_file)
- with open(changelog_file, "r") as changelog:
+ with open(changelog_file, "r", encoding="utf-8") as changelog:
context["changelog"] = markdown(changelog.read())
if page_number > 1:
context["next"] = page_number - 1