You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
AttributeError: 'NoneType' object has no attribute 'convert' with ZoneInfo #646
I have searched the issues of this repo and believe that this is not a duplicate.
OS version and name: 4.19.128-microsoft-standard Linux
Pendulum version: 2.1.2
Issue
Reproducible example
import pendulum
from zoneinfo import ZoneInfo
tz = ZoneInfo("Europe/London")
my_datetime = pendulum.now()
my_datetime.astimezone(tz) # AttributeError: 'NoneType' object has no attribute 'convert'
Description
The above error seems to be thrown when calling pendulum.astimezone() with a ZoneInfo timezone. We are in the process of migrating a project from pytz to zoneinfo. The above example works perfectly if pendulum is replaced with datetime.datetime.
Thanks for reading and looking into this!
Expected behaviour
For pendulum.astimezone() to successfully convert a datetime object with a ZoneInfo timezone.
this happens also when upgrading Django 3.x to 4.x since Django 4.x is using zoneinfo as default timezone implementation.
just following this to know when its fixed
Activity
thinkwelltwd commentedon Aug 29, 2022
I stubbed by toes hard on this bug, and here it's been fixed for 8 months. Would be supremely grateful for a new release. 🙇♂️
muhamadBrew commentedon Jul 3, 2023
this happens also when upgrading Django 3.x to 4.x since Django 4.x is using zoneinfo as default timezone implementation.
just following this to know when its fixed