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:
I had the exact same error as @underscore but in my case the problem was that map(quoter,s) tried to look for the key u'\xe9' which was not in the _safe_map. However \xe9 was, so I solved the issue by replacing u'\xe9' by \xe9 in s.
Moreover, shouldn't the return statement be within the try/except ? I also had to change this to completely solve the problem.