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

(cherry picked from commit 51700bf08b)

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

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
This commit is contained in:
Miss Islington (bot) 2022-01-03 12:39:02 -08:00 committed by GitHub
parent 50da397be4
commit 4a792ca95c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View 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`.