-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
Open
Labels
3.10only security fixesonly security fixes3.11only security fixesonly security fixes3.12only security fixesonly security fixesOS-windowstype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
The realpath()
docs say:
If strict is
False
, the path is resolved as far as possible and any remainder is appended without checking whether it exists.
Note the word "appended". In fact, realpath()
uses os.path.join()
to join the path segments, and as we all know/love, os.path.join()
supports resetting the drive or root, thus discarding prior parts. As a result:
>>> os.path.realpath('c:/a:b')
'a:b' # should be 'c:/a:b'
Metadata
Metadata
Assignees
Labels
3.10only security fixesonly security fixes3.11only security fixesonly security fixes3.12only security fixesonly security fixesOS-windowstype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error