#6183 closed defect (fixed)
LdapPlugin - Error with trac 0.12
Reported by: | anonymous | Owned by: | Emmanuel Blot |
---|---|---|---|
Priority: | high | Component: | LdapPlugin |
Severity: | major | Keywords: | ldap, ldapplugin, 0.12 |
Cc: | ilias@… | Trac Release: | 0.12 |
Description
Might stem from the python version, and doc on the web seems to point towards incompatibilities with unicode strings. I'm using the trunk "Trac-0.12dev_r0-py2.6.egg" with the latest Ldapplugin built for 0.11 with python 2.6 on Ubuntu 9.10,
Traceback (most recent call last): File "/usr/local/lib/python2.6/dist-packages/Trac-0.12dev_r0-py2.6.egg/trac/web/api.py", line 393, in send_error 'text/html') File "/usr/local/lib/python2.6/dist-packages/Trac-0.12dev_r0-py2.6.egg/trac/web/chrome.py", line 758, in render_template data = self.populate_data(req, data) File "/usr/local/lib/python2.6/dist-packages/Trac-0.12dev_r0-py2.6.egg/trac/web/chrome.py", line 649, in populate_data d['chrome'].update(req.chrome) File "/usr/local/lib/python2.6/dist-packages/Trac-0.12dev_r0-py2.6.egg/trac/web/api.py", line 209, in __getattr__ value = self.callbacks[name](self) File "/usr/local/lib/python2.6/dist-packages/Trac-0.12dev_r0-py2.6.egg/trac/web/chrome.py", line 499, in prepare_request contributor.get_navigation_items(req): File "/usr/local/lib/python2.6/dist-packages/Trac-0.12dev_r0-py2.6.egg/trac/ticket/web_ui.py", line 168, in get_navigation_items if 'TICKET_CREATE' in req.perm: File "/usr/local/lib/python2.6/dist-packages/Trac-0.12dev_r0-py2.6.egg/trac/perm.py", line 527, in has_permission return self._has_permission(action, resource) File "/usr/local/lib/python2.6/dist-packages/Trac-0.12dev_r0-py2.6.egg/trac/perm.py", line 541, in _has_permission check_permission(action, perm.username, resource, perm) File "/usr/local/lib/python2.6/dist-packages/Trac-0.12dev_r0-py2.6.egg/trac/perm.py", line 428, in check_permission perm) File "/usr/local/lib/python2.6/dist-packages/Trac-0.12dev_r0-py2.6.egg/trac/perm.py", line 285, in check_permission get_user_permissions(username) File "/usr/local/lib/python2.6/dist-packages/Trac-0.12dev_r0-py2.6.egg/trac/perm.py", line 360, in get_user_permissions for perm in self.store.get_user_permissions(username): File "/usr/local/lib/python2.6/dist-packages/Trac-0.12dev_r0-py2.6.egg/trac/perm.py", line 175, in get_user_permissions subjects.update(provider.get_permission_groups(username)) File "build/bdist.linux-x86_64/egg/ldapplugin/api.py", line 106, in get_permission_groups self._ldap = LdapConnection(self.env.log, bind, **self._ldapcfg) TypeError: __init__() keywords must be strings
Attachments (1)
Change History (14)
comment:1 follow-up: 2 Changed 15 years ago by
comment:2 follow-up: 3 Changed 15 years ago by
Replying to tiagoaoa@cos.ufrj.br:
A workaround is to change:
self._ldapcfg[name] = valueto
self._ldapcfg[str(name)] = str(value)
Thx for this change in the source code ! It works fine with me for the trac v0.11.6!
comment:3 Changed 15 years ago by
Replying to heiv@reseau-js.com:
Replying to tiagoaoa@cos.ufrj.br:
A workaround is to change:
self._ldapcfg[name] = valueto
self._ldapcfg[str(name)] = str(value)Thx for this change in the source code ! It works fine with me for the trac v0.11.6!
This works for me as well on v0.11.6
I came looking to make a ticket with that fix, found one already existed.
Note: There are two places where this change should be made: once in LdapPermissionGroupProvider
and again in LdapPermissionStore
-
ldapplugin/api.py
62 62 self._ldapcfg = {} 63 63 for name,value in self.config.options('ldap'): 64 64 if name in LDAP_DIRECTORY_PARAMS: 65 self._ldapcfg[ name] = value65 self._ldapcfg[str(name)] = value 66 66 # user entry local cache 67 67 self._cache = {} 68 68 # max time to live for a cache entry … … 178 178 self._ldapcfg = {} 179 179 for name,value in self.config.options('ldap'): 180 180 if name in LDAP_DIRECTORY_PARAMS: 181 self._ldapcfg[ name] = value181 self._ldapcfg[str(name)] = value 182 182 # user entry local cache 183 183 self._cache = {} 184 184 # max time to live for a cache entry
comment:4 Changed 15 years ago by
Trac 0.11.6 also has the same problem. But LdapPlugin works fine after I modified api.py based on above code.
comment:5 Changed 13 years ago by
Cc: | ilias@… added; anonymous removed |
---|
comment:6 follow-up: 7 Changed 13 years ago by
Can someone with commit-rights please update the repository with a 0.7.0 version fro trac 0.12, which contains the above patches?
I've made a temporary 0.7.0 version here:
https://github.com/lazaridis-com/ldaptrac/tree/master/0.12
But would like to use the official repo.
comment:7 Changed 13 years ago by
Replying to ilias@lazaridis.com:
But would like to use the official repo.
Can you attach the patch file to this ticket?
Changed 13 years ago by
Attachment: | v070trac012.diff added |
---|
Patch to create version 0.7.0 for trac 0.12
comment:8 follow-up: 11 Changed 13 years ago by
(please let me know if I can do anything else on my side)
comment:10 Changed 13 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:11 Changed 13 years ago by
Replying to lazaridis_com:
(please let me know if I can do anything else on my side)
If you can test the delivery, it would be nice as I have no spare time for now. Thanks.
comment:12 Changed 13 years ago by
Will keep "test the deliver" in mind.
updated doc:
https://trac-hacks.org/wiki/LdapPlugin?action=diff&version=54
comment:13 Changed 11 years ago by
Thanks, seems to be working on trac v0.11.6 also, with the French language package.
Regards,
Pierre-André, Genève
A workaround is to change:
to