I am trying to join a relative path to an absolute one. I am confused as to this behavior:
from pathlib import Path
path = Path("/an/absolute/path/test")
path.joinpath("/../relative/path", "some_suffixes")
gives
PosixPath('/../relative/path/some_suffixes')
Why does this drop the first part of the path? What I expect is
PosixPath('/an/absolute/path/test/../relative/path/some_suffixes')
Seems like your problem is the relative path string you provide. You should remove the front forward slash and you should be good to go.
path.joinpath("../relative/path", "some_suffixes")