This should use URLobject since it's a much nicer (as in easier to understand) API for URL manipulation: https://urlobject.readthedocs.org/ We added the dependency as part of the search feature.