Open
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'