Fix Windows crash: add tzdata dependency, harden timezone fallback
On Windows, Python's zoneinfo module has no system timezone database.
Without the tzdata package, ZoneInfo('UTC') raises ZoneInfoNotFoundError,
crashing both /api/points/today and /api/nutrition/today (Home and Keto
pages show 'failed to load').
Two fixes:
1. Add tzdata>=2024.1 to pyproject.toml dependencies so pip install
pulls it automatically
2. Harden dates.py with _safe_tz() that falls back to datetime.timezone.utc
(always available, no tzdata needed) as the ultimate fallback
This commit is contained in:
parent
3beca1ca2f
commit
aeb0b438cc
2 changed files with 20 additions and 15 deletions
|
|
@ -34,6 +34,7 @@ dependencies = [
|
|||
"bcrypt>=4.2.0",
|
||||
"httpx>=0.27.0",
|
||||
"python-multipart>=0.0.18",
|
||||
"tzdata>=2024.1",
|
||||
]
|
||||
|
||||
[project.optional-dependencies]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue