Replaces datetime.utcnow() with datetime.now(timezone.utc).replace(tzinfo=None) to replace the deprecated function[0] and keep the current code behaviour.
I decided to use .replace(tzinfo=None) and leave the date variables "timezone naive" to maintain compatibility with the rest of the variables. Another option was to change other variables to be "timezone aware", but external communication already uses datetime objects without timezone information. changing this would mean changing some tests too.
This reduces the number of warnings on py312 from 47 to 5.
Replaces
datetime.utcnow()withdatetime.now(timezone.utc).replace(tzinfo=None)to replace the deprecated function[0] and keep the current code behaviour.I decided to use
.replace(tzinfo=None)and leave the date variables "timezone naive" to maintain compatibility with the rest of the variables. Another option was to change other variables to be "timezone aware", but external communication already uses datetime objects without timezone information. changing this would mean changing some tests too.This reduces the number of warnings on py312 from 47 to 5.
[0] https://docs.python.org/3/library/datetime.html#datetime.datetime.utcnow