Comments (4)
Ahh, I see what's going on. Thanks @babu-upcomer for the link and more detailed explanation.
Yeah I think for anyone using this field and using the kwarg choices_display='WITH_GMT_OFFSET'
they probably got this error during the recent north america DST transition.
It looks like Europe will be undergoing a DST transition in a few weeks, I will plan to get this bug fixed and an update pushed to pypi before then.
from django-timezone-field.
Yeah, under the hood this field uses pytz to get metadata about timezones. If pytz doesn't recognize a string as a valid timezone, it will throw one of those NonExistentTimeError
exceptions. So it looks like that's whats happening here: the obsolete timezones are not being recognized by pytz.
If you have to support the obsolete timezones, perhaps just a standard string field with a choices
argument might suffice?
from django-timezone-field.
@mfogel Thanks for responding! I think the problem isn't with the obsolete timezones even America/Adak
is in pytz.common_timezones. I guess that it can be fixed with any one of the solutions put out here and also this exception from pytz is intentional. is_dst
needs to be sent True
or False
based on the exceptions. Since this blocks the initialization of the models and so the gunicorn workers to crash when they restart, I think this needs to be prioritized. I'm sure that everyone who is using the library in production have had bunch of errors for like an hour in the reported time.
Thanks for the work!
/Babu
from django-timezone-field.
Fix released as part of v4.1.2
from django-timezone-field.
Related Issues (20)
- Support Django 4.2 HOT 2
- Django <= 3.X defaults to using ZoneInfoBackend instead of PYTZBackend HOT 2
- use_pytz=True doesn't seem to be default on django 3.2.21 HOT 1
- Django 5.0 support HOT 4
- Using the "Factory" timezone on systems that use the system zoneinfo database can cause problems HOT 1
- sorting list of timezones on ModelForm? HOT 1
- Great
- Does not support Django5 - This blocks upgrades HOT 6
- Cannot install from sdist HOT 1
- stdlib zoneinfo support HOT 7
- 5.0 - No time zone found with key Pacific/Kanto HOT 4
- Translate list items based on current locale HOT 1
- System timezones or installed tzdata may not cover pytz.common_timezones HOT 5
- `TimeZoneSerializerField` does not handle the empty string case
- python3.10 support HOT 1
- Version 5.0 drops Django 3.1 support, but can be installed alongside it
- Help to fix 'Pacific/Fiji' timezone ValueError: Extraneous characters at end of TZ string HOT 1
- PYTZ 2022.2 Update Issues HOT 7
- KeyError: "choices" during migration after upgrading to 5.0 HOT 4
- Use `zoneinfo.available_timezones` instead of `pytz.common_timezones` converted to `ZoneInfo` HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-timezone-field.