Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

zoneinfo.TZPATH is empty on POSIX: sysconfig TZPATH is not set

Đã đóng
#1,206 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@graemerocher đang làm issue này rồi.

Từ ngày 9/10/2026.

  • #1207 của @graemerocher — đang mở

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
15/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
python
Lĩnh vực
backend

Hướng nghiên cứu

The fallback is zoneinfo._tzpath, which reads sysconfig.get_config_var("TZPATH"). On GraalPy that value is missing from the generated _sysconfigdata and from _sysconfig._update_posix_vars. Compare with CPython's --with-tzpath default and check zoneinfo.TZPATH is non-empty on POSIX. Work is already under way in linked PR #1207, so review that rather than starting a parallel fix.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

On Linux and macOS, zoneinfo.TZPATH is empty on GraalPy, so zoneinfo.ZoneInfo("Europe/Berlin") raises ZoneInfoNotFoundError unless the tzdata package is installed or PYTHONTZPATH is set. This happens even though the system time zone database exists (/usr/share/zoneinfo on Linux and macOS, /etc/zoneinfo on NixOS).

>>> import sysconfig, zoneinfo
>>> sysconfig.get_config_var("TZPATH")   # CPython: '/usr/share/zoneinfo:/usr/lib/zoneinfo:/usr/share/lib/zoneinfo:/etc/zoneinfo'
>>> zoneinfo.TZPATH                       # CPython: ('/usr/share/zoneinfo', ...)
()

zoneinfo._tzpath falls back to sysconfig.get_config_var("TZPATH"). CPython's configure sets it to --with-tzpath, whose default is /usr/share/zoneinfo:/usr/lib/zoneinfo:/usr/share/lib/zoneinfo:/etc/zoneinfo. GraalPy's generated _sysconfigdata and _sysconfig._update_posix_vars don't define it, so the lookup returns None. On Windows, CPython uses '', which GraalPy already matches.

Reported downstream in micronaut-projects/pyronaut#333 (GraalPy embedded through the Java POSIX backend).

Ngôn ngữ chính
Python
Star
1.7k
Fork
156
Merge trung bình
8 giờ 31 phút
Pull request đã merge (30 ngày)
55

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của oracle/graalpython

Tất cả issue của oracle/graalpython

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.