- This is confusing as heck:'/world'os.path.join("hello", "/world")'hello/slash/world'os.path.join("hello", "slash/world")'hello/slash//world' Trying to formulate a general rule for what the arguments to os.path.joinos.path.join("hello", "slash//world")
are supposed to be is really hard. I can't really figure out what it would be like on a non-POSIX/non-win32 platform.
Made trickier by the similar yet different behaviour of urlparse.urljoin.
import urlparse urlparse.urljoin("hello", "/world")
It does not make sense to me that these should be different.
[Apologies to glyph for the dup; mixed up the reply-to. Still getting used to gmail.]