MCPcopy Index your code
hub / github.com/python/cpython / valid_key

Function valid_key

Lib/zoneinfo/_tzpath.py:143–148  ·  view source on GitHub ↗
(fpath)

Source from the content-addressed store, hash-verified

141 pass
142
143 def valid_key(fpath):
144 try:
145 with open(fpath, "rb") as f:
146 return f.read(4) == b"TZif"
147 except Exception: # pragma: nocover
148 return False
149
150 for tz_root in TZPATH:
151 if not os.path.exists(tz_root):

Callers 1

available_timezonesFunction · 0.70

Calls 2

openFunction · 0.50
readMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…