Open
Description
-
I am on the latest Pendulum version.
-
I have searched the issues of this repo and believe that this is not a duplicate.
-
OS version and name: Ubuntu 22.04.3 LTS (running in WSL2)
-
Pendulum version: 3.0.0
Issue
When a naive pendulum.DateTime calls diff
with a stdlib datetime object the input is converted to a pendulum instance, but it defaults to having a timezone of UTC, causing a TypeError
TypeError: can't compare offset-naive and offset-aware datetimes
Repro
from datetime import datetime
import pendulum
pendulum_today = pendulum.today().naive()
stdlib_today = datetime.today()
print(pendulum_today.tzinfo)
print(stdlib_today.tzinfo)
pendulum_today.diff(stdlib_today)
Metadata
Metadata
Assignees
Labels
No labels