using  os path  operations on urls is bad form it assumes that the path separator is which is the sort of monkey business that  os path exists to prevent put another way a url is  not  a filesystem path  and cannot reliably be manipulated as such 