fix urlencode for python3