Code review comment for lp:~dreis-pt/ocb-addons/7.0-bug1079476-dr

Revision history for this message
Stefan Rijnhart (Opener) (stefan-opener) wrote :

Hi Daniel, thanks for looking into this!

What I read on the Internet about python-ldap and unicode confirms what Olivier Dony writes on the bug report [1]. Any input that is passed on to python-ldap should be encoded as utf-8 instead of the default Python unicode. I can confirm this simply by logging on using a user name with a unicode character. This gives basically the same error as the one from the bug report. I think it would be much appreciated if you completed the mission to cover all strings passed to the LDAP server.

Code nit in l.18: given that the 'conf' dictionary comes from a raw sql query, it could be that conf['ldap_password'] is None. The following is probably safer in that case

    (conf['ldap_password'] or '').encode("utf-8")

[1] https://bugs.launchpad.net/openobject-addons/+bug/1079476/comments/5

review: Needs Fixing

« Back to merge proposal