urlencode patch for python 2.7 issue http://bugs.python.org/issue13866