Re: Bug in the urljoin library

2020-04-28 Thread Peter Otten
Moro, Andrea via Python-list wrote: > Hello there, > > I believe there is a bug in the urljoin library. I believe this is a case of garbage-in garbage-out ;) Try p = urlparse(url) if not p.scheme: url = urlunparse(p._replace(scheme="http")) > > See below: &g

Bug in the urljoin library

2020-04-28 Thread Moro, Andrea via Python-list
Hello there, I believe there is a bug in the urljoin library. See below: p = urlparse(url) if p.scheme == '': url = urljoin('http://', url) Input: domain.tld/somepath Output http:///domain.tld/somepath p = urlparse(url) if p.scheme == '': url = urljoin(&#