Problem: neither urllib2.quote nor urllib.quote encode the unicode strings arguments

Rou Bao yuanhen at gmail.com
Sun Oct 5 01:00:32 EDT 2008


On 10月4日, 上午5时38分, "Valery Khamenya" <khame... at gmail.com> wrote:
> Hi all
>
> things like urllib.quote(u"пиво Müller ") fail with error message:
> <type 'exceptions.KeyError'>: u'\u043f'
>
> Similarly with urllib2.
>
> Anyone got a hint?? I need it to form the URI containing non-ascii chars.
> thanks in advance,
> best regards
> --
> Valery

don't unicode the str, just urllib.quote("пиво Müller ")



More information about the Python-list mailing list