From 585e14c7d3fbe773ff54b4038567ca1159fb295a Mon Sep 17 00:00:00 2001 From: Weilin Du <1372449351@qq.com> Date: Tue, 16 Jun 2026 00:11:10 +0800 Subject: [PATCH] gh-140145: Use repr of the key in `zoneinfo` "No time zone found" error (#140433) Co-authored-by: Stan Ulbrych --- Lib/zoneinfo/_common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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): -- 2.47.3