-
Notifications
You must be signed in to change notification settings - Fork 196
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Package not compatible with next version of tzlocal #191
Comments
Possibly related - I just updated tzlocal to version 3.0b1 and am not able to use the >>> import maya
>>> now = maya.now()
>>> now.local_datetime()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/kieran/.local/share/virtualenvs/nucypher-9CH2v_st/lib/python3.8/site-packages/maya/core.py", line 267, in local_datetime
return self.datetime(to_timezone=self.local_timezone, naive=False)
File "/home/kieran/.local/share/virtualenvs/nucypher-9CH2v_st/lib/python3.8/site-packages/maya/core.py", line 182, in local_timezone
if self._local_tz.zone in pytz.all_timezones:
AttributeError: 'backports.zoneinfo.ZoneInfo' object has no attribute 'zone' @property
def local_timezone(self):
"""Returns the name of the local timezone."""
> if self._local_tz.zone in pytz.all_timezones:
E AttributeError: 'backports.zoneinfo.ZoneInfo' object has no attribute 'zone' |
KPrasch
added a commit
to KPrasch/nucypher
that referenced
this issue
Oct 1, 2020
KPrasch
added a commit
to KPrasch/nucypher
that referenced
this issue
Oct 1, 2020
KPrasch
added a commit
to KPrasch/nucypher
that referenced
this issue
Oct 1, 2020
vepkenez
pushed a commit
to vepkenez/nucypher
that referenced
this issue
Oct 13, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The next version of
tzlocal
will switch from usingpytz
zones tozoneinfo
(which is generally a good idea), which will break this package, sincezoneinfo
zones don't have the same interface aspytz
zones.You should probably pin the version of
tzlocal
ASAP, and/or add in some logic to detectzoneinfo
zones and convert them to whatever you want.In the longer term, you should probably also migrate away from
pytz
and on tozoneinfo
. I have apytz-deprecation-shim
module that should help ease the pain (though it is not 100% backwards compatible - in the migration guide you'll find that the semantics of datetime addition are slightly different).The text was updated successfully, but these errors were encountered: