https://github.com/python/cpython/commit/3000594e929aea768fe0dd2437e0722ecfa2dbdc
commit: 3000594e929aea768fe0dd2437e0722ecfa2dbdc
branch: main
author: Isuru Fernando <[email protected]>
committer: zooba <[email protected]>
date: 2025-08-06T23:05:41+01:00
summary:
gh-84683: Check `<prefix>/share/zoneinfo` for zoneinfo files on Windows
(GH-28495)
files:
A Misc/NEWS.d/next/Library/2021-09-21-17-17-29.gh-issue-84683.wDSRsG.rst
M Lib/sysconfig/__init__.py
diff --git a/Lib/sysconfig/__init__.py b/Lib/sysconfig/__init__.py
index 49e0986517ce97..c583b74ce54fc6 100644
--- a/Lib/sysconfig/__init__.py
+++ b/Lib/sysconfig/__init__.py
@@ -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
diff --git
a/Misc/NEWS.d/next/Library/2021-09-21-17-17-29.gh-issue-84683.wDSRsG.rst
b/Misc/NEWS.d/next/Library/2021-09-21-17-17-29.gh-issue-84683.wDSRsG.rst
new file mode 100644
index 00000000000000..66f76bda6ad7a7
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2021-09-21-17-17-29.gh-issue-84683.wDSRsG.rst
@@ -0,0 +1 @@
+:mod:`zoneinfo`: Check in ``<prefix>/share/zoneinfo`` for data files on Windows
_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]