Raphael Slinckx schrieb:
> There seems to be a problem, but i don't know where to ask so i give
> it a shot here.
> ...
> In any case it breaks authentication for any username using non-ascii
> user_names, and the quickstart template in TG2 uses Unicode for
> user_name so it is bound to happen sometime. Any thoughts on how to
> fix this ?

I can reproduce the problem and your analysis seems to be correct.

I think this should be fixed in paste.request. The parse_formvars should 
return unicode instead of encoded strings. I saw that it simply ignores 
the charset (anything specified after a semicolon) in the content_type. 
Instead, it should analyze the content_type for an explicitly defined 
charset (assuming utf-8 if nothing is specified), and then it should 
decode the content using that charset.

Even in Python 2, we should learn to follow the Python 3 paradigm of 
keeping everything that can potentially be non-ascii in unicode and 
convert things immediately at the i/o boundaries. In this case, this is 
IMHO the duty of the parse_formvars function.

-- Christoph

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

Reply via email to