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 eb3043a commit 99e05a0
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 @@ -161,7 +161,7 @@ def handle_get_page_html(json: dict) -> dict:
return {"status": "error", "message": "Tuhle stránku hry nemám k editaci"}

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

# set_page_html - set html content of page
Expand Down Expand Up @@ -189,5 +189,5 @@ def handle_set_page_html(json: dict) -> dict:
return {"status": "error", "message": "Page does not exist"}

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

0 comments on commit 99e05a0

Please sign in to comment.