From: Weilin Du <1372449351@qq.com> Date: Mon, 15 Jun 2026 16:11:10 +0000 (+0800) Subject: gh-140145: Use repr of the key in `zoneinfo` "No time zone found" error (#140433) X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=585e14c7d3fbe773ff54b4038567ca1159fb295a;p=thirdparty%2FPython%2Fcpython.git gh-140145: Use repr of the key in `zoneinfo` "No time zone found" error (#140433) Co-authored-by: Stan Ulbrych --- diff --git a/Lib/zoneinfo/_common.py b/Lib/zoneinfo/_common.py index 98668c15d8bf..caa3a5b583ba 100644 --- a/Lib/zoneinfo/_common.py +++ b/Lib/zoneinfo/_common.py @@ -26,7 +26,7 @@ def load_tzdata(key): # UnicodeEncodeError: If package_name or resource_name are not UTF-8, # such as keys containing a surrogate character. # IsADirectoryError: If package_name without a resource_name specified. - raise ZoneInfoNotFoundError(f"No time zone found with key {key}") + raise ZoneInfoNotFoundError(f"No time zone found with key {key!r}") def load_data(fobj):