Commit e2290bfab0
Verified · cmc
Layout: unified · split
search.py +1 −1
| @@ -18,7 +18,7 @@ def search_log(query): | ||
| 18 | 18 | print("No history file found.") |
| 19 | 19 | return |
| 20 | 20 | |
| 21 | with open(LOG_PATH, "r") as f: | |
| 21 | with open(LOG_PATH, "r", encoding="utf-8") as f: | |
| 22 | 22 | entries = f.read().split("* ")[1:] |
| 23 | 23 | |
| 24 | 24 | found = 0 |
server.py +1 −1
| @@ -51,7 +51,7 @@ def log_visit(): | ||
| 51 | 51 | favicon = data.get("favIconUrl", "") |
| 52 | 52 | timestamp = datetime.utcnow().isoformat() |
| 53 | 53 | |
| 54 | with open(LOG_PATH, "a") as f: | |
| 54 | with open(LOG_PATH, "a", encoding="utf-8") as f: | |
| 55 | 55 | f.write(f"* {title}\n") |
| 56 | 56 | f.write(":PROPERTIES:\n") |
| 57 | 57 | f.write(f":URL: {url}\n") |