File tree 2 files changed +9
-0
lines changed
2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -340,6 +340,14 @@ the :mod:`glob` module.)
340
340
that contains symbolic links. On Windows, it converts forward slashes to
341
341
backward slashes. To normalize case, use :func: `normcase `.
342
342
343
+ .. note ::
344
+ On POSIX systems, in accordance with `IEEE Std 1003.1 2013 Edition; 4.13
345
+ Pathname Resolution <http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_13> `_,
346
+ if a pathname begins with exactly two slashes, the first component
347
+ following the leading characters may be interpreted in an implementation-defined
348
+ manner, although more than two leading characters shall be treated as a
349
+ single character.
350
+
343
351
.. versionchanged :: 3.6
344
352
Accepts a :term: `path-like object `.
345
353
Original file line number Diff line number Diff line change @@ -352,6 +352,7 @@ def normpath(path):
352
352
initial_slashes = path .startswith (sep )
353
353
# POSIX allows one or two initial slashes, but treats three or more
354
354
# as single slash.
355
+ # (see http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_13)
355
356
if (initial_slashes and
356
357
path .startswith (sep * 2 ) and not path .startswith (sep * 3 )):
357
358
initial_slashes = 2
You can’t perform that action at this time.
0 commit comments