Python broken?

Hi all,

I have this python program that I’ve been running every day for over a year now.

It is called via shell script:

#!/bin/bash
python3 /config/solax/compute_pv_schedule.py $1 $2 $3 $4 $5 $6

Today for the first time the script returned an error, which appears in the log like this:

2024-03-07 22:59:48.982 DEBUG (MainThread) [homeassistant.components.shell_command] Stderr of command:
`/config/solax/compute_pv_schedule.sh {{ weather }} {{ bat_time }} {{ chg_cost }} {{ bev_time }} {{ exit_time }} {{ omie_discount }}`, return code: 1:b'Traceback (most recent call last):
 File "/config/solax/compute_pv_schedule.py", line 331, in <module>
 v_sunrise_hour = int(v_sun.get_sunrise_time().strftime(\'%H\'))
 ^^^^^^^^^^^^^^^^^^^^^^^^
 File "/usr/local/lib/python3.12/site-packages/suntime/suntime.py", line 34, in get_sunrise_time
 time_delta = self.get_sun_timedelta(at_date, time_zone=time_zone, is_rise_time=True)
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "/usr/local/lib/python3.12/site-packages/suntime/suntime.py", line 131, in get_sun_timedelta
 UT += time_zone.utcoffset(at_date).total_seconds() / 3600
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: utcoffset(dt) argument must be a datetime instance or None, not datetime.date
'

The offending lines on the python program could not be simpler, and as previously said have been working without any issue for over a year till today:

v_sun          = Sun(k_latitude, k_longitude)
v_sunrise_hour = int(v_sun.get_sunrise_time().strftime('%H'))  ## <<<< offending line
v_sunset_hour  = int(v_sun.get_sunset_time().strftime('%H'))

As anyone seen this behavior as well?
It seems like something is broken in the underlying python libs, does it not?

Can anyone help here, some suggestion on how to fix this?
Or maybe we need a bug to be open on github?

Any feedback would be greatly appreciated.

Cheers,
-jprates