-
Notifications
You must be signed in to change notification settings - Fork 397
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
'backports.zoneinfo.ZoneInfo' object has no attribute 'localize' #522
Comments
I'm also running into the same issue, @Shavinder have you found a workaround? |
I ve decided to use django swingtime. Its code is easier to understand.
Plus it has a demo.
…On Mon., Jan. 10, 2022, 6:33 a.m. Jeroen van der Laan < ***@***.***> wrote:
I'm also running into the same issue,
@Shavinder <https://github.com/Shavinder> have you found a workaround?
—
Reply to this email directly, view it on GitHub
<#522 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAKYKTMY4LS27JIKRQWYFADUVLU43ANCNFSM5KYTIOBQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
I have the same issue on python 3.8 |
This is related to changes in python 3.8. It can be mitigated using: |
@raffael-mnhn thanks for the suggestion. I'm working on a fix, however, the current fix has some DST regressions. |
Please check branch: 522-fix-backports-zoneinfo-ZoneInfo |
@llazzaro I just tried this out by removing django-scheduler from my requirements.txt and substituting it with Thanks for the fix! |
Good to hear! |
Here is my traceback:
Environment:
Request Method: GET
Request URL: http://127.0.0.1:8000/schedule/calendar/tri_month/example/
Django Version: 4.0
Python Version: 3.8.2
Installed Applications:
('django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.humanize',
'django.contrib.admin',
'debug_toolbar',
'djangobower',
'schedule',
'project_sample')
Installed Middleware:
['django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'debug_toolbar.middleware.DebugToolbarMiddleware']
Traceback (most recent call last):
File "C:\Users\sh\source\repos\django-scheduler-sample-master\venv\lib\site-packages\django\core\handlers\exception.py", line 47, in inner
response = get_response(request)
File "C:\Users\sh\source\repos\django-scheduler-sample-master\venv\lib\site-packages\django\core\handlers\base.py", line 181, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "C:\Users\sh\source\repos\django-scheduler-sample-master\venv\lib\site-packages\schedule\utils.py", line 221, in decorator
return function(request, *args, **kwargs)
File "C:\Users\sh\source\repos\django-scheduler-sample-master\venv\lib\site-packages\django\views\generic\base.py", line 69, in view
return self.dispatch(request, *args, **kwargs)
File "C:\Users\sh\source\repos\django-scheduler-sample-master\venv\lib\site-packages\django\views\generic\base.py", line 101, in dispatch
return handler(request, *args, **kwargs)
File "C:\Users\sh\source\repos\django-scheduler-sample-master\venv\lib\site-packages\django\views\generic\detail.py", line 107, in get
context = self.get_context_data(object=self.object)
File "C:\Users\sh\source\repos\django-scheduler-sample-master\venv\lib\site-packages\schedule\views.py", line 124, in get_context_data
period = period_class(event_list, date, tzinfo=local_timezone)
File "C:\Users\sh\source\repos\django-scheduler-sample-master\venv\lib\site-packages\schedule\periods.py", line 259, in init
start, end = self._get_month_range(date)
File "C:\Users\sh\source\repos\django-scheduler-sample-master\venv\lib\site-packages\schedule\periods.py", line 322, in _get_month_range
local_start = self.tzinfo.localize(naive_start)
Exception Type: AttributeError at /schedule/calendar/tri_month/example/
Exception Value: 'backports.zoneinfo.ZoneInfo' object has no attribute 'localize'
The text was updated successfully, but these errors were encountered: