[Python-Dev] Stdlib and timezones, again

Antoine Pitrou solipsis at pitrou.net
Sun Sep 30 15:03:45 CEST 2012

On Sun, 30 Sep 2012 14:47:28 +0200
Lennart Regebro <regebro at gmail.com> wrote:
> With 3.3 out, it's time to bring up something for 3.4. And it's about pytz
> and stdlib, basically. And we have been over that again, but I have a
> proposal anyway.
> The problem with including pytz in the stdlib is that it contains the
> tz/zoneinfo/Olson database, and it updates much more often than Python
> does. I propose to solve this problem in the following way:
> 1. Merge the functionality of pytz into the stdlib datetime module. That
> means extending datetime.tzinfo with the localize() function and and adding
> a top-level datetime.timezone() function. any other extra functionality
> pytz has.
> 2. The datetime.timezone() function will work as the pytz.timezone()
> function, ie return a tzinfo object from the tz database.
> 3. However, Python will not include the database. Instead it will use the
> one that the OS provides, if it provides one (ie Unices, including OS X if
> I remember correctly).
> 4. On any other OS, datetime.timezone() will return an error explaining
> that no tz database can be found, but that it is available in the module
> 'pytzdata' which then will need to be created. If this module is installed,
> the datetime.timezone() function will prefer that database before the OS
> database.

Can't we simply include the Olson database in Windows installers?



Software development and contracting: http://pro.pitrou.net

More information about the Python-Dev mailing list