We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent eacad9a commit f13b289Copy full SHA for f13b289
Lib/zoneinfo/_common.py
@@ -67,14 +67,14 @@ def load_data(fobj):
67
f">{timecnt}{time_type}", fobj.read(timecnt * time_size)
68
)
69
trans_idx = struct.unpack(f">{timecnt}B", fobj.read(timecnt))
70
+
71
+ if max(trans_idx) >= typecnt:
72
+ raise ValueError("Invalid transition index found while reading TZif: "
73
+ f"{max(trans_idx)}")
74
else:
75
trans_list_utc = ()
76
trans_idx = ()
77
- if trans_idx and max(trans_idx) >= typecnt:
- raise ValueError("Invalid transition index found while reading TZif: "
- f"{max(trans_idx)}")
-
78
# Read the ttinfo struct, (utoff, isdst, abbrind)
79
if typecnt:
80
utcoff, isdst, abbrind = zip(
0 commit comments