From 51700bf08b0dd4baf998440b2ebfaa488a2855ba Mon Sep 17 00:00:00 2001 From: Irit Katriel <1055913+iritkatriel@users.noreply.github.com> Date: Mon, 3 Jan 2022 20:10:07 +0000 Subject: bpo-34931: [doc] clarify behavior of os.path.splitext() on paths with multiple leading periods (GH-30347) --- Doc/library/os.path.rst | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Doc/library/os.path.rst b/Doc/library/os.path.rst index a66b3c5..6b15a11 100644 --- a/Doc/library/os.path.rst +++ b/Doc/library/os.path.rst @@ -501,11 +501,16 @@ the :mod:`glob` module.) >>> splitext('foo.bar.exe') ('foo.bar', '.exe') + >>> splitext('/foo/bar.exe') + ('/foo/bar', '.exe') - Leading periods on the basename are ignored:: + Leading periods of the last component of the path are considered to + be part of the root:: >>> splitext('.cshrc') ('.cshrc', '') + >>> splitext('/foo/....jpg') + ('/foo/....jpg', '') .. versionchanged:: 3.6 Accepts a :term:`path-like object`. -- cgit v0.12