users_ldap: Unable to connect to Active Directory containing non-ASCII characters
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
Odoo Addons (MOVED TO GITHUB) |
Confirmed
|
Medium
|
OpenERP R&D Addons Team 1 | |||
OpenERP Community Backports (Addons) | Status tracked in 7.0 | |||||
7.0 |
In Progress
|
Medium
|
OpenERP Community Backports |
Bug Description
When connecting to Active Directory containing non-ASCII characters, the following errors occurs ...
Server Traceback (most recent call last):
File "/opt/openerp/
result = openerp.
File "/opt/openerp/
result = ExportService.
File "/opt/openerp/
return fn(*params)
File "/opt/openerp/
return res_users.
File "/opt/openerp/
uid = self.login(db, login, password)
File "/opt/openerp/
entry = ldap_obj.
File "/opt/openerp/
results = self.query(conf, filter)
File "/opt/openerp/
filter, retrieve_
File "/usr/lib/
return self.search_
File "/usr/lib/
msgid = self.search_
File "/usr/lib/
timeout,
File "/usr/lib/
result = func(*args,
UnicodeEncodeError: 'ascii' codec can't encode characters in position 3-4: ordinal not in range(128)
This behaviour happens in both 6.1 and 7.0.
In my case, the ldap_base string contains non-ascii characters and I used "encode('utf-8')" as a quick fix.
Original code in users_ldap.py
results = conn.search_
Modified code in users_ldap.py
results = conn.search_
This fix only works for 6.1.
Using this fix for 7.0, a different error relating to database insertion (creating new user) occurs.
Related branches
- Stefan Rijnhart (Opener): Needs Fixing
- OpenERP Community Backports: Pending requested
-
Diff: 21 lines (+2/-2)1 file modifiedauth_ldap/users_ldap.py (+2/-2)
Changed in ocb-addons: | |
importance: | Undecided → Medium |
Changed in ocb-addons: | |
assignee: | nobody → OpenERP Community Backports Team (ocb) |
status: | New → Confirmed |
The same fix is also working for 7.0 now ... not sure why it didn't work initially.