mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-08 13:12:08 +00:00
fix: hermes journey crashes on Windows due to %-d strftime directive
`_period_label()` in `learning_graph_render.py` used `%-d %b`
strftime, which is a Linux-only format — the `%-` prefix for
zero-padding suppression doesn't exist on Windows `strftime`, causing
`ValueError: Invalid format string` on `hermes journey`.
Fix by using `dt.day` directly (an integer, no zero-padding by
default) combined with `strftime('%b')` for the month. This is
cross-platform and produces identical output.
Reproduced and tested on Windows 10 with Hermes v0.18.0.
This commit is contained in:
parent
e4da3a7a52
commit
ce82b0c3cf
1 changed files with 1 additions and 1 deletions
|
|
@ -255,7 +255,7 @@ def _period_key(ts: float, granularity: str) -> tuple[int, ...]:
|
|||
def _period_label(ts: float, granularity: str) -> str:
|
||||
dt = datetime.fromtimestamp(ts, tz=timezone.utc)
|
||||
if granularity == "day":
|
||||
return dt.strftime("%-d %b")
|
||||
return f"{dt.day} {dt.strftime('%b')}"
|
||||
if granularity == "month":
|
||||
return dt.strftime("%b %Y")
|
||||
return dt.strftime("%Y")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue