]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-114713: Revert gh-114731 (#133330)
authorKirill Podoprigora <kirill.bast9@mail.ru>
Sat, 3 May 2025 07:47:08 +0000 (08:47 +0100)
committerGitHub <noreply@github.com>
Sat, 3 May 2025 07:47:08 +0000 (07:47 +0000)
Revert "gh-114713: Handle case of an empty string passed to `zoneinfo.ZoneInfo` (#114731)"

This reverts commit 884df116d79b05d9342e05e50484d61c684ecb8b.

Lib/test/test_zoneinfo/test_zoneinfo.py
Lib/zoneinfo/_tzpath.py
Misc/NEWS.d/next/Library/2025-03-09-01-09-12.gh-issue-114713.lkq9vZ.rst [deleted file]

index b0dbd768cab7e1996ceef91e1e8c76fa83e3c92e..d2845495c7f8b69488a1622d00f34342b3eaaff8 100644 (file)
@@ -237,7 +237,6 @@ class ZoneInfoTest(TzPathUserMixin, ZoneInfoTestBase):
             "../zoneinfo/America/Los_Angeles",  # Traverses above TZPATH
             "America/../America/Los_Angeles",  # Not normalized
             "America/./Los_Angeles",
-            "",
         ]
 
         for bad_key in bad_keys:
index 990a5c8b6a9372b1b599df0ba3a99af8dbd33884..5db17bea045d8c8882601bbeb10fa2d6af850138 100644 (file)
@@ -83,11 +83,6 @@ _TEST_PATH = os.path.normpath(os.path.join("_", "_"))[:-1]
 
 
 def _validate_tzfile_path(path, _base=_TEST_PATH):
-    if not path:
-        raise ValueError(
-            "ZoneInfo key must not be an empty string"
-        )
-
     if os.path.isabs(path):
         raise ValueError(
             f"ZoneInfo keys may not be absolute paths, got: {path}"
diff --git a/Misc/NEWS.d/next/Library/2025-03-09-01-09-12.gh-issue-114713.lkq9vZ.rst b/Misc/NEWS.d/next/Library/2025-03-09-01-09-12.gh-issue-114713.lkq9vZ.rst
deleted file mode 100644 (file)
index d30975a..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Handle case of an empty string passed to :class:`zoneinfo.ZoneInfo`.