Use urllib.parse.urlencode when urllib.urlencode is not available