Skip to content

Commit 220f4c2

Browse files
committed
update NEWS entry
1 parent 49bdcac commit 220f4c2

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

Lib/test/test_zoneinfo/test_zoneinfo.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1796,6 +1796,8 @@ def test_tzpath_type_error(self):
17961796
"/etc/zoneinfo:/usr/share/zoneinfo",
17971797
b"/etc/zoneinfo:/usr/share/zoneinfo",
17981798
0,
1799+
(b"/bytes/path", "/valid/path"),
1800+
(pathlib.Path(b"/bytes/path"),)
17991801
]
18001802

18011803
for bad_value in bad_values:
Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
:meth:`zoneinfo.reset_tzpath` will now raise ``ValueError`` if it encounters
2-
an :class:`os.PathLike` object representing a relative path, along with a
3-
more informative error message. It previously raised ``TypeError`` in this
4-
case.
1+
:meth:`zoneinfo.reset_tzpath` will now convert any :class:`os.PathLike` objects
2+
it receives into strings before adding them to ``TZPATH``. It will raise
3+
``TypeError`` if anything other than a string is found after this conversion.
4+
If given an :class:`os.PathLike` object that represents a relative path, it
5+
will now raise ``ValueError`` instead of ``TypeError``, and present a more
6+
informative error message.

0 commit comments

Comments
 (0)