gh-84683: Check <prefix>/share/zoneinfo for zoneinfo files on Windows (GH-28495)

This commit is contained in:
Isuru Fernando 2025-08-06 17:05:41 -05:00 committed by GitHub
parent c653fba016
commit 3000594e92
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 1 deletions

View file

@ -412,7 +412,13 @@ def _init_non_posix(vars):
vars['EXE'] = '.exe'
vars['VERSION'] = _PY_VERSION_SHORT_NO_DOT
vars['BINDIR'] = os.path.dirname(_safe_realpath(sys.executable))
vars['TZPATH'] = ''
# No standard path exists on Windows for this, but we'll check
# whether someone is imitating a POSIX-like layout
check_tzpath = os.path.join(vars['prefix'], 'share', 'zoneinfo')
if os.path.exists(check_tzpath):
vars['TZPATH'] = check_tzpath
else:
vars['TZPATH'] = ''
#
# public APIs

View file

@ -0,0 +1 @@
:mod:`zoneinfo`: Check in ``<prefix>/share/zoneinfo`` for data files on Windows