Python 3 urlparse library compatibility