The Surprising Behavior of urljoin

>>> from urllib.parse import urljoin
>>> urljoin('http://example.com/', '1')
'http://example.com/1'
>>> urljoin('http://example.com/', '2629:1828:4025')
'2629:1828:4025'

Better not try to urljoin anything with a colon in it!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.