Я пытаюсь соединить два пути, второй начинается с косой черты.
Код: Выделить всё
from pathlib import Path
path = Path('/first', '/second')
# outputs WindowsPath('/second')
# expecting WindowsPath('/first/second')
print(path)
While it's not a big deal to use something like removeprefix('/'), I'm curious to know why it's behaving this way. Is there is a builtin way to change this behaviour?
Источник: https://stackoverflow.com/questions/772 ... h-together