Opened 9 years ago

Closed 8 years ago

#26622 closed Cleanup/optimization (fixed)

Improve timezone documentation regarding requirement for pytz

Reported by: Josh Smeaton Owned by: nobody
Component: Documentation Version: dev
Severity: Normal Keywords:
Cc: josh.smeaton@… Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

While implementing tests for #25774 it was difficult to determine whether or not pytz had to be installed or not for certain timezone operations to work.

The documentation at https://docs.djangoproject.com/en/dev/topics/i18n/timezones/ mentions:

Installing pytz is highly recommended, but may not be mandatory depending on your particular database backend, operating system and time zone. If you encounter an exception querying dates or times, please try installing it before filing a bug.

I think it'd be a good idea to be more explicit with this recommendation, potentially providing a matrix of "database, operating system platform, pytz required?". We can codify this as a database feature so we can make use of it in tests, and allow 3rd party backends to define their own requirements for platform and pytz.

Alternatively we can just fully require pytz for timezone support and error early if it's not installed (on startup?).

Whoever takes this ticket will need to do some experimentation on linux and windows with all of the core databases to properly determine requirements. I can help with oracle on linux if needed.

Preliminary investigation by Tim in #25774 seems to show that all databases require pytz on Windows for the tests in 25774 at least. There may be some basic timezone operations that do not depend on pytz which would be nice to account for, but maybe not necessary.

Change History (3)

comment:1 by Tim Graham, 9 years ago

Triage Stage: UnreviewedAccepted

comment:2 by François Freitag, 8 years ago

I believe this ticket can be closed now since pytz is required?

comment:3 by Tim Graham, 8 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.
Back to Top