]> 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:39:02 +0000 (12:39 -0800)
committerGitHub <noreply@github.com>
Mon, 3 Jan 2022 20:39:02 +0000 (20:39 +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 729649200209b3c38882e4a6464420d6cff2b7d4..2fb6ea9da8e094f230bd22e07d99e73ab22ed8bb 100644 (file)
@@ -489,11 +489,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`.