Behaviour of os.path.join

Eryk Sun eryksun at gmail.com
Thu May 28 10:37:44 EDT 2020


On 5/28/20, BlindAnagram <blindanagram at nowhere.com> wrote:
>
> Thank you for making the effort to answer a number of issues raaised in
> this thread.  I much appreciate your input.

For a more practical POV, see the topic on "File System Navigation"
[1] for the C++ standard <filesystem> API. In the C++ standard
library, trailing slashes are not stripped and path
p0(L"C:/Documents") compares as less than path p1(L"C:/Documents/").

Also, regarding whether rooted paths without a drive are absolute,
you'll find that C++ is_absolute() requires has_root_name() &&
has_root_directory() in Windows. A rooted path without a drive is thus
not absolute in the C++ standard library.

[1]: https://docs.microsoft.com/en-us/cpp/standard-library/file-system-navigation?view=vs-2019
https://docs.microsoft.com/en-us/cpp/standard-library/file-system-navigation?view=vs-2019
[2]: https://docs.microsoft.com/en-us/cpp/standard-library/path-class?view=vs-2019#is_absolute


More information about the Python-list mailing list