"Using Saved Location: foo"

Martin Pool mbp at sourcefrog.net
Tue May 2 07:00:32 BST 2006


On 02/05/2006, at 3:18 PM, Jan Hudec wrote:
>

> Well, with a twist. The input url is actually 'encoded', so urlescape
> must not escape % in this case.

Right - actually I think doing it chunk-by-chunk is just going to  
complicate things.  I think the other algorithm I quoted would be  
better for handling these pseudo-URLs, since it doesn't touch things  
that might already be escaped:

   for c in pseudo_url:
     if c in url_safe_characters:
       r += c
     else:
       if isinstance(c, unicode):
         r += urlescape(c.encode('utf-8'))

-- 
Martin







More information about the bazaar mailing list