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
I'm running into an error when using Delorean within a Django app context. This only happens when the Django app is loaded. For example, in the interpreter setup by django:
Traceback (most recent call last):
File "<console>", line 1, in <module>
File ".../lib/python3.9/site-packages/delorean/interface.py", line 87, in parse
do = Delorean(dt, timezone=tz)
File ".../lib/python3.9/site-packages/delorean/dates.py", line 202, in __init__self._dt = localize(datetime, self._tzinfo)
File ".../lib/python3.9/site-packages/delorean/dates.py", line 157, in localizereturn tz.localize(dt)
AttributeError: 'zoneinfo.ZoneInfo' object has no attribute 'localize'
The same procedure done outside of django results in a successful parsing of the datetime.
There was an api change in tzinfo starting with version 3 it no longer returns a pytz object but rather a zoneinfo object. Delorean will either need to update to handle the new object or limit tzlocal to <= 2.1
I just ran into this issue. Friday afternoon is always a great time to debug issues 😄
I'm running into an error when using Delorean within a Django app context. This only happens when the Django app is loaded. For example, in the interpreter setup by django:
This results in:
The same procedure done outside of django results in a successful parsing of the datetime.
Note, it's the same environment, just not within the django shell setup.
AFAICT, the only difference is that Django is using a
zoneinfo
timezone instance, while pure python is finding any using apytz
timezone instance.The text was updated successfully, but these errors were encountered: