On Thu, 2007-10-11 at 09:32 +0200, Thomas Guettler wrote:
> Hi,
> 
> I looked at the source of urlquote:
> 
> utils/text.py:
> 
> def urlquote(url, safe='/'):
>     """
>     A version of Python's urllib.quote() function that can operate on unicode
>     strings. The url is first UTF-8 encoded before quoting. The returned 
> string
>     can safely be used as part of an argument to a subsequent iri_to_uri() 
> call
>     without double-quoting occurring.
>     """
>     return force_unicode(urllib.quote(smart_str(url)))
> 
> 1. safe gets ignored. I created a patch:
>    http://code.djangoproject.com/ticket/5734

That's a bug.
> 
> 2. why force_unicode()?
>   urllib.quote should return a 7 bit ascii string.

No, it shouldn't. It should return a string that can be coerced to ASCII
(there's no such things as non-7-bit ASCII, so you can leave the prefix
off), but the type of the object is unicode in order to be consistent
with everything else Django returns.

Regards,
Malcolm



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to