https://github.com/python/cpython/commit/c9c0beb00d993cffa914e43fc57905b173006489
commit: c9c0beb00d993cffa914e43fc57905b173006489
branch: 3.13
author: Miss Islington (bot) <31488909+miss-isling...@users.noreply.github.com>
committer: Eclips4 <kirill.ba...@mail.ru>
date: 2025-05-03T08:09:54Z
summary:

[3.13] gh-114713: Revert gh-114731 (GH-133330) (#133331)

gh-114713: Revert gh-114731 (GH-133330)

Revert "gh-114713: Handle case of an empty string passed to `zoneinfo.ZoneInfo` 
(GH-114731)"

This reverts commit 884df116d79b05d9342e05e50484d61c684ecb8b.
(cherry picked from commit fe44fc4f4351bb4b457c01d94b4ae8b9eda501aa)

Co-authored-by: Kirill Podoprigora <kirill.ba...@mail.ru>

files:
D Misc/NEWS.d/next/Library/2025-03-09-01-09-12.gh-issue-114713.lkq9vZ.rst
M Lib/test/test_zoneinfo/test_zoneinfo.py
M Lib/zoneinfo/_tzpath.py

diff --git a/Lib/test/test_zoneinfo/test_zoneinfo.py 
b/Lib/test/test_zoneinfo/test_zoneinfo.py
index e4eb4e1fe3778e..8bcd6d2e9951b9 100644
--- a/Lib/test/test_zoneinfo/test_zoneinfo.py
+++ b/Lib/test/test_zoneinfo/test_zoneinfo.py
@@ -235,7 +235,6 @@ def test_bad_keys_paths(self):
             "../zoneinfo/America/Los_Angeles",  # Traverses above TZPATH
             "America/../America/Los_Angeles",  # Not normalized
             "America/./Los_Angeles",
-            "",
         ]
 
         for bad_key in bad_keys:
diff --git a/Lib/zoneinfo/_tzpath.py b/Lib/zoneinfo/_tzpath.py
index 990a5c8b6a9372..5db17bea045d8c 100644
--- a/Lib/zoneinfo/_tzpath.py
+++ b/Lib/zoneinfo/_tzpath.py
@@ -83,11 +83,6 @@ def find_tzfile(key):
 
 
 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
index d30975a8a5115b..00000000000000
--- a/Misc/NEWS.d/next/Library/2025-03-09-01-09-12.gh-issue-114713.lkq9vZ.rst
+++ /dev/null
@@ -1 +0,0 @@
-Handle case of an empty string passed to :class:`zoneinfo.ZoneInfo`.

_______________________________________________
Python-checkins mailing list -- python-checkins@python.org
To unsubscribe send an email to python-checkins-le...@python.org
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: arch...@mail-archive.com

Reply via email to