fix urlencode and urlparse imports for python3