From 324594a89d8552917b196b212766d0a9e8820832 Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Tue, 21 Sep 2021 12:12:45 -0500 Subject: [PATCH 1/5] bpo-40503: Check in /share/zoneinfo for zoneinfo files on windows --- Lib/sysconfig.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py index 95b48f6429d5f8..99ffe15b55d28f 100644 --- a/Lib/sysconfig.py +++ b/Lib/sysconfig.py @@ -489,7 +489,11 @@ 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'] = '' + check_tzpath = os.path.join(vars['prefix'], 'share', 'zoneinfo') + if os.path.exists(check_tzpath): + vars['TZPATH'] = check_tzpath + else: + vars['TZPATH'] = '' # # public APIs From 7daaa5b24e24ad94dfb656727272d303f1446069 Mon Sep 17 00:00:00 2001 From: "blurb-it[bot]" <43283697+blurb-it[bot]@users.noreply.github.com> Date: Tue, 21 Sep 2021 17:17:30 +0000 Subject: [PATCH 2/5] =?UTF-8?q?=F0=9F=93=9C=F0=9F=A4=96=20Added=20by=20blu?= =?UTF-8?q?rb=5Fit.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../NEWS.d/next/Windows/2021-09-21-17-17-29.bpo-40503.wDSRsG.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 Misc/NEWS.d/next/Windows/2021-09-21-17-17-29.bpo-40503.wDSRsG.rst diff --git a/Misc/NEWS.d/next/Windows/2021-09-21-17-17-29.bpo-40503.wDSRsG.rst b/Misc/NEWS.d/next/Windows/2021-09-21-17-17-29.bpo-40503.wDSRsG.rst new file mode 100644 index 00000000000000..501f2ec991f7e5 --- /dev/null +++ b/Misc/NEWS.d/next/Windows/2021-09-21-17-17-29.bpo-40503.wDSRsG.rst @@ -0,0 +1 @@ +Check in /share/zoneinfo for zoneinfo files on windows \ No newline at end of file From 0d6edbc30f64b3080d9ce99906510997cf3c976f Mon Sep 17 00:00:00 2001 From: Stan Ulbrych Date: Tue, 8 Jul 2025 09:42:13 +0100 Subject: [PATCH 3/5] Move, update blurb, apply suggestions --- Lib/sysconfig/__init__.py | 8 +++++++- .../next/Library/2021-09-21-17-17-29.gh-84683.wDSRsG.rst | 1 + .../next/Windows/2021-09-21-17-17-29.bpo-40503.wDSRsG.rst | 1 - 3 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 Misc/NEWS.d/next/Library/2021-09-21-17-17-29.gh-84683.wDSRsG.rst delete mode 100644 Misc/NEWS.d/next/Windows/2021-09-21-17-17-29.bpo-40503.wDSRsG.rst 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-84683.wDSRsG.rst b/Misc/NEWS.d/next/Library/2021-09-21-17-17-29.gh-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-84683.wDSRsG.rst @@ -0,0 +1 @@ +:mod:`zoneinfo`: Check in ``/share/zoneinfo`` for data files on Windows diff --git a/Misc/NEWS.d/next/Windows/2021-09-21-17-17-29.bpo-40503.wDSRsG.rst b/Misc/NEWS.d/next/Windows/2021-09-21-17-17-29.bpo-40503.wDSRsG.rst deleted file mode 100644 index 501f2ec991f7e5..00000000000000 --- a/Misc/NEWS.d/next/Windows/2021-09-21-17-17-29.bpo-40503.wDSRsG.rst +++ /dev/null @@ -1 +0,0 @@ -Check in /share/zoneinfo for zoneinfo files on windows \ No newline at end of file From f40ba4852bd90c4948ef3257369c027311d2a539 Mon Sep 17 00:00:00 2001 From: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com> Date: Tue, 8 Jul 2025 09:43:34 +0100 Subject: [PATCH 4/5] Delete accidental leftover from merge --- Lib/sysconfig.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 Lib/sysconfig.py diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py deleted file mode 100644 index e69de29bb2d1d6..00000000000000 From c4128b0119e08c3f3a68e5eba90d1215d6f23503 Mon Sep 17 00:00:00 2001 From: Stan Ulbrych Date: Tue, 8 Jul 2025 09:44:53 +0100 Subject: [PATCH 5/5] !fixup blurb name --- ...3.wDSRsG.rst => 2021-09-21-17-17-29.gh-issue-84683.wDSRsG.rst} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Misc/NEWS.d/next/Library/{2021-09-21-17-17-29.gh-84683.wDSRsG.rst => 2021-09-21-17-17-29.gh-issue-84683.wDSRsG.rst} (100%) diff --git a/Misc/NEWS.d/next/Library/2021-09-21-17-17-29.gh-84683.wDSRsG.rst b/Misc/NEWS.d/next/Library/2021-09-21-17-17-29.gh-issue-84683.wDSRsG.rst similarity index 100% rename from Misc/NEWS.d/next/Library/2021-09-21-17-17-29.gh-84683.wDSRsG.rst rename to Misc/NEWS.d/next/Library/2021-09-21-17-17-29.gh-issue-84683.wDSRsG.rst