Rocksolid Light

Welcome to Rocksolid Light

mail  files  register  newsreader  groups  login

Message-ID:  

19 May, 2024: Line wrapping has been changed to be more consistent with Usenet standards.
 If you find that it is broken please let me know here rocksolid.nodes.help


devel / comp.lang.python / zoneinfo and tzdata

SubjectAuthor
o zoneinfo and tzdataMike Dewhirst

1
zoneinfo and tzdata

<mailman.224.1691561066.23016.python-list@python.org>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=23868&group=comp.lang.python#23868

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!fu-berlin.de!uni-berlin.de!not-for-mail
From: miked@dewhirst.com.au (Mike Dewhirst)
Newsgroups: comp.lang.python
Subject: zoneinfo and tzdata
Date: Wed, 9 Aug 2023 15:58:32 +1000
Lines: 28
Message-ID: <mailman.224.1691561066.23016.python-list@python.org>
References: <216fb9f2-413c-df1b-4d07-771fb4ccafea@dewhirst.com.au>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.uni-berlin.de xeFKzHPrZMARoiuLvXiUPAgZD+Qlpc678l8xsyUIpFlw==
Cancel-Lock: sha1:0Jz/iUrKYqILk9TpBCZe1D0K6T0= sha256:UL/H0DKA7MX5Ig3CC+LV3fi8BYHcivh/HBMb5ile4Yc=
Return-Path: <miked@dewhirst.com.au>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=none reason="no signature";
dkim-adsp=none (unprotected policy); dkim-atps=neutral
X-Spam-Status: OK 0.058
X-Spam-Evidence: '*H*': 0.89; '*S*': 0.00; 'knows': 0.04; 'django':
0.07; 'bothering': 0.09; 'obviously': 0.09; 'ubuntu': 0.09;
'from:addr:dewhirst.com.au': 0.16; 'from:addr:miked': 0.16;
'from:name:mike dewhirst': 0.16; 'generosity': 0.16; 'installed.':
0.16; 'received:webmastery.com.au': 0.16; 'timezone': 0.16;
'virtualenv': 0.16; 'installing': 0.19; 'to:addr:python-list':
0.20; 'installed': 0.23; 'to:name:python-list@python.org': 0.24;
'saying': 0.25; 'seems': 0.26; "wasn't": 0.26; "isn't": 0.27;
'bit': 0.27; 'greatly': 0.28; 'suggest': 0.28; 'asked': 0.29;
'error': 0.29; 'header:User-Agent:1': 0.30; 'attempt': 0.31;
'module': 0.31; 'raise': 0.31; 'grateful': 0.32; 'unless': 0.32;
'but': 0.32; 'there': 0.33; 'received:192.168.0': 0.33; 'windows':
0.34; 'work.': 0.34; 'trying': 0.35; 'received:au': 0.35;
'errors': 0.36; 'received:192.168': 0.37; 'read': 0.38; 'this,':
0.39; 'should': 0.40; 'kept': 0.61; 'key': 0.64; 'saw': 0.65;
'similar': 0.65; 'back': 0.67; 'currently,': 0.69; 'cheers': 0.76;
'spent': 0.81; 'assured': 0.84; 'caused.': 0.84; 'embarrassed':
0.84; 'luck.': 0.84; 'behind': 0.88; 'beneficial': 0.91;
'deliberately': 0.91; 'received:103': 0.91
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.14.0
Content-Language: en-US
X-PPP-Message-ID: <20230809055844.23253.2747@plesk01.e1.webmastery.com.au>
X-PPP-Vhost: chemintro.com
X-Content-Filtered-By: Mailman/MimeDel 2.1.39
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <216fb9f2-413c-df1b-4d07-771fb4ccafea@dewhirst.com.au>
 by: Mike Dewhirst - Wed, 9 Aug 2023 05:58 UTC

The zoneinfo module does not work on Windows unless you have installed
tzdata.

On Ubuntu that data seems to exist already. Not sure how or why but it
obviously isn't there in a Windows virtualenv unless deliberately installed.

I just spent a bit of time trying to switch from pytz to zoneinfo in
Django without luck. I then asked and greatly embarrassed ChatGPT which
kept apologizing when I fed back all the zoneinfo errors its advice caused.

It wasn't until I read the docs that I saw zoneinfo would get timezone
data from tzdata if the real info wasn't where it first looked.

As soon as I installed tzdata, ChatGPT's advice started to work. When I
reported this, it was very grateful and assured me my generosity in
bothering to correct it would be very beneficial for other users having
similar problems.

Might I suggest that if zoneinfo comes up empty-handed it should raise
an error saying no timezone information was found?

Currently, it just nominates the timezone key you attempt to use. Behind
the scenes it surely knows there are no such keys. In that case it might
suggest installing tzdata.

Cheers

Mike


devel / comp.lang.python / zoneinfo and tzdata

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor