Hello,
I've inherited a little authentication module which uses
python-ldap (v1.92, 2005/11/03). For the most of it, it works
fine, but when a user has decided to use non-ascii characters
in their password, they will be blocked access and the
authentication log shows a message such as:
2010-08-27 11:02:50,398 DEBUG Exception: 'ascii' codec can't encode character u'\xdf' in position 5: ordinal not in range(128)
As I'm not entirely comfortable yet working with Python, I'm
wondering if people here could advise on the best way to
resolve this issue.
Some questions and doubts are:
- is this a known problem that has been addressed in a later version? If so, would any compatibility issues be expected between the two
versions?
- It should be possible to work around the issue by escaping the non-ascii characters in the password, replacing them with a backslash followed by one or more 2-digit hex codes representing the bytes that make up the character. Would it be necessary to do this in the python-ldap module, or would it be safe to do it before calling simple_bind?
Best regards,
Marc Brevoort
|