[Python-Dev] Stdlib and timezones, again

Lennart Regebro regebro at gmail.com
Mon Oct 1 09:02:08 CEST 2012


On Mon, Oct 1, 2012 at 1:24 AM, Christian Heimes <christian at python.org>wrote:

> I like your basic approach but I'm suggesting a slightly different
> approach. Before I explain my proposal I like to get a naming convention
> straight.
>
> integrated tz database
> ----------------------
>
> A copy of the Olson database that is shipped with every version of
> Python (not just Windows). The integrated database is updated with every
> feature release of Python.
>
>
> system tz database
> ------------------
>
> That's an interface to the operating system's or platform's tz database.
> We probably have to provide multiple backends for different OSes, Java etc.
>
>
> update tz database
> ------------------
>
> A PyPI package that contains a current version of the Olson database. A
> new version of the update tz should be provided by the Python core
> developer team every time a new Olson database is available. The
> updatetz must never be distributed with the Python source code and shall
> not be installed by a distributor.
> Optionally we can include the code that creates an update tz package
> from a Olson database.
>
>
> By default Python tries to load the updatetz first, then systemtz (if
> available) and finally the integratedtz. A user can query the status and
> version of the databases, set and get the currently used database with
> three functions. The used database can also be set with an environment
> variable:
>
>  datetime.gettzdatabase() -> "integrated" or "system" or "update"
>  datetime.settzdatabase(name)
>  datetime.listtzdatabases() ->
>    {"integrated": "version",
>     "system": "???"
>     "update": "version", # only if an update tz db is installed
>    }
>  PYTHON_TZDB = "integrated" or "system" or "update"
>
> With this setup users get the full benefit of system updates but can use
> the integrated or update database if they don't like the operating
> system's data.
>

I don't want to default to a database that is guaranteed to be out of date.
I don't see the purpose. This is also why I'm skeptical at including the
data on Windows.

//Lennart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20121001/0814726b/attachment.html>


More information about the Python-Dev mailing list