Replaced urlparse with six.moves.urllib.parse