[Python-checkins] bpo-34931: [doc] clarify behavior of os.path.splitext() on paths with multiple leading periods (GH-30347) (GH-30368)

iritkatriel webhook-mailer at python.org
Mon Jan 3 15:36:50 EST 2022


https://github.com/python/cpython/commit/8184a613b93d54416b954e667951cdf3d069cc13
commit: 8184a613b93d54416b954e667951cdf3d069cc13
branch: 3.10
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: iritkatriel <1055913+iritkatriel at users.noreply.github.com>
date: 2022-01-03T20:36:41Z
summary:

bpo-34931: [doc] clarify behavior of os.path.splitext() on paths with multiple leading periods (GH-30347) (GH-30368)

(cherry picked from commit 51700bf08b0dd4baf998440b2ebfaa488a2855ba)

Co-authored-by: Irit Katriel <1055913+iritkatriel at users.noreply.github.com>

Co-authored-by: Irit Katriel <1055913+iritkatriel at users.noreply.github.com>

files:
M Doc/library/os.path.rst

diff --git a/Doc/library/os.path.rst b/Doc/library/os.path.rst
index a66b3c5a3a990..6b15a113f5450 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`.



More information about the Python-checkins mailing list