Skip to content

bpo-40503: Check in <prefix>/share/zoneinfo for zoneinfo files on windows #28495

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion Lib/sysconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
check_tzpath = os.path.join(vars['prefix'], 'share', 'zoneinfo')
# 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
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Check in <prefix>/share/zoneinfo for zoneinfo files on windows