Use urlparse from our compat module so it works with Python 3