Replace datetime.utcfromtimestamp() with datetime.fromtimestamp(ts, UTC).replace(tzinfo=None)
ProprietaryThe datetime.utcfromtimestamp() method is deprecated in Python 3.12. Replace it with datetime.fromtimestamp(ts, UTC).replace(tzinfo=None), importing UTC from datetime where the name is not already in scope. The result is the naive UTC datetime utcfromtimestamp() returned, so it still compares with other naive values.
org. openrewrite. python. migrate. ReplaceDatetimeUtcFromTimestampmod run . --recipe= org. openrewrite. python. migrate. ReplaceDatetimeUtcFromTimestampInstall it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.