]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-140145: Use repr of the key in `zoneinfo` "No time zone found" error (#140433)
authorWeilin Du <1372449351@qq.com>
Mon, 15 Jun 2026 16:11:10 +0000 (00:11 +0800)
committerGitHub <noreply@github.com>
Mon, 15 Jun 2026 16:11:10 +0000 (17:11 +0100)
Co-authored-by: Stan Ulbrych <stan@python.org>
Lib/zoneinfo/_common.py

index 98668c15d8bf94b67c0649a58d3f071071296efd..caa3a5b583bab3231b1b7960986b99a76e84b46e 100644 (file)
@@ -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):