I'm using the repoze.who friendlyforms and sqlalchemy plugins via
TurboGears, and noticed that repoze.who keeps the login as an encoded
string (usually utf-8), while the default TurboGears user model class
stores the user name as Unicode.

This results in deprecation warnings from SQLAlchemy for ascii user
names and failures for non-ascii user names.

I'm not sure at which level the user name should be decoded to unicode -
the repoze.who documentation does not seem to specify that - but
probably as early as possible, e.g. by replacing the following lines
using paste.request in friendlyforms.py

    query = parse_dict_querystring(environ)
    form = parse_formvars(environ)

with the following lines using WebOb

    req = webob.Request(environ)
    if not req.charset:
        req.charset = 'utf-8'
    query = req.GET()
    form = req.POST()

Any better ideas?

-- Christoph
Repoze-dev mailing list

Reply via email to