Merge pull request #3 from QIN2DIM/main

fix(main): UnicodeDecodeError
This commit is contained in:
UncleCode
2024-05-23 09:29:28 +08:00
committed by GitHub
2 changed files with 3 additions and 2 deletions

View File

@@ -66,7 +66,7 @@ async def read_index(request: Request):
for filename in os.listdir(partials_dir):
if filename.endswith(".html"):
with open(os.path.join(partials_dir, filename), "r") as file:
with open(os.path.join(partials_dir, filename), "r", encoding="utf8") as file:
partials[filename[:-5]] = file.read()
return templates.TemplateResponse("index.html", {"request": request, **partials})