feat: calendar eco

This commit is contained in:
OpenSquared
2026-07-21 12:41:26 +02:00
parent 4c2103156e
commit 0bdf3f382d
6 changed files with 69 additions and 16 deletions

View File

@@ -1,4 +1,16 @@
import os
import sys
# Windows consoles default to a legacy codepage (cp1252/cp850) that can't encode
# the arrows/checkmarks/emojis used throughout this codebase's print() calls —
# an uncaught UnicodeEncodeError on a background thread (e.g. the calendar sync
# loop) silently kills that task with no visible error. UTF-8 + replace makes
# every print() safe regardless of console codepage.
if sys.platform == "win32":
for _stream in (sys.stdout, sys.stderr):
try:
_stream.reconfigure(encoding="utf-8", errors="replace")
except Exception:
pass
from pathlib import Path
from dotenv import load_dotenv
# Explicit path: don't rely on the process's current working directory (a systemd