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

Function get_zoneinfo_path

Lib/test/test_zoneinfo/data/update_test_data.py:42–49  ·  view source on GitHub ↗

Get the first zoneinfo directory on TZPATH containing the "UTC" zone.

()

Source from the content-addressed store, hash-verified

40
41@functools.lru_cache(maxsize=None)
42def get_zoneinfo_path() -> pathlib.Path:
43 """Get the first zoneinfo directory on TZPATH containing the "UTC" zone."""
44 key = "UTC"
45 for path in map(pathlib.Path, zoneinfo.TZPATH):
46 if (path / key).exists():
47 return path
48 else:
49 raise OSError("Cannot find time zone data.")
50
51
52def get_zoneinfo_metadata() -> typing.Dict[str, str]:

Callers 2

get_zoneinfo_metadataFunction · 0.85
get_zoneinfoFunction · 0.85

Calls 1

existsMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…