Skip to content

Commit

Permalink
Refactor file encoding in socketio_events.py
Browse files Browse the repository at this point in the history
  • Loading branch information
JakubAndrysek committed Sep 27, 2024
1 parent c106049 commit eb3043a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ForrestHub-app/app/socketio_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def handle_get_page_html(json: dict) -> dict:
if not page_path.exists():
return {"status": "error", "message": "Tuhle stránku hry nemám k editaci"}

with open(page_path, "r") as f:
with open(page_path, "r", encoding="utf-8") as f:
content = f.read()
return {"status": "ok", "content": content}

Expand Down Expand Up @@ -188,6 +188,6 @@ def handle_set_page_html(json: dict) -> dict:
if not page_path.exists():
return {"status": "error", "message": "Page does not exist"}

with open(page_path, "w") as f:
with open(page_path, "w", encoding="utf-8") as f:
f.write(page_content)
return {"status": "ok"}

0 comments on commit eb3043a

Please sign in to comment.