To encode the URI, I used urllib.quote(\"schönefeld\")
but when some non-ascii characters exists in string, it thorws
KeyError: u\'\\xe9\'
Code:
By just converting the string to unicode I resolved the issue.
here is the snippet:
try:
unicode(mystring, "ascii")
except UnicodeError:
mystring = unicode(mystring, "utf-8")
else:
pass
Detailed description of solution can be found at http://effbot.org/pyfaq/what-does-unicodeerror-ascii-decoding-encoding-error-ordinal-not-in-range-128-mean.htm