diff options
author | Irit Katriel <1055913+iritkatriel@users.noreply.github.com> | 2022-01-03 20:10:07 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-03 20:10:07 (GMT) |
commit | 51700bf08b0dd4baf998440b2ebfaa488a2855ba (patch) | |
tree | c50775894edd180312a7163557866887f13f30ac /Doc | |
parent | dd6c35761a4cd417e126a2d51dd0b89c8a30e5de (diff) | |
download | cpython-51700bf08b0dd4baf998440b2ebfaa488a2855ba.zip cpython-51700bf08b0dd4baf998440b2ebfaa488a2855ba.tar.gz cpython-51700bf08b0dd4baf998440b2ebfaa488a2855ba.tar.bz2 |
bpo-34931: [doc] clarify behavior of os.path.splitext() on paths with multiple leading periods (GH-30347)
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/os.path.rst | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Doc/library/os.path.rst b/Doc/library/os.path.rst index a66b3c5..6b15a11 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`. |