Appending trailing slashes to paths

I was rather talking about the implementation, not the API. For example,

os.path.abspath() simplifies “…” path components without resolving symlinks first

https://www.python.org/dev/peps/pep-0428/#sane-behaviour

But if you don’t look at os.path implementation (or emulation is perfect such that Julia copied the bug) I guess there is no problem.

I’m not sure I agree that not resolving symlinks is broken. There’s not exactly a lot of analysis of why that’s wrong, mostly just an assertion.

Because otherwise you’d get something different from read(path) and read(abspath(path))?

$ mkdir -p c/d
$ ln -s c/d a
$ echo "./b" > b
$ echo "./c/b" > c/b
$ cat a/../b
./c/b
$ julia -e 'write(stdout, read("a/../b"), read(abspath("a/../b")), read(realpath("a/../b")))'
./c/b
./b
./c/b
1 Like

Please show example using pathlib.Path.home()

You may be posting in the wrong forum. This is Julia.

2 Likes