]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-34931: [doc] clarify behavior of os.path.splitext() on paths with multiple leadin...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Mon, 3 Jan 2022 20:36:41 +0000 (12:36 -0800)
committerGitHub <noreply@github.com>
Mon, 3 Jan 2022 20:36:41 +0000 (20:36 +0000)
(cherry picked from commit 51700bf08b0dd4baf998440b2ebfaa488a2855ba)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
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`.