]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-34931: [doc] clarify behavior of os.path.splitext() on paths with multiple leadin...
authorIrit Katriel <1055913+iritkatriel@users.noreply.github.com>
Mon, 3 Jan 2022 20:10:07 +0000 (20:10 +0000)
committerGitHub <noreply@github.com>
Mon, 3 Jan 2022 20:10:07 +0000 (20:10 +0000)
Doc/library/os.path.rst

index a66b3c5a3a990239d269618c20e277351675607d..6b15a113f545065b0406bb587b0cd3edbed04965 100644 (file)
@@ -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`.