New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Why everything is decoded to unicode instead of handling as bytestrings? #16
Comments
It would be possible to fix this by defining a config flag whether to encode/decode transparently in node.ext.ldap or not. |
Agreed. Actually, it was not so hard *) after all to remove all encoding/decoding, so adding flag instead should be doable. |
@rnixx What would be a proper place in node.ext.ldap for a such flag? |
I'd say on LDAPServerProperties here: And remembered on root node here: |
python-ldap in python 3 by default handles everything but attribute values as unicode. Theres a B/C mode for python 2 which is is used in latest master now. |
It looked like a good idea that node.ext.ldap makes sure that all incoming bytestrings are decoded into unicode, but then I got profiling from Zope:
(That was from listing a group of 100 users, after spending a few days in optimizing LDAP queries in node.ext.ldap and switching bda.cache to use pylibmc instead of python-memcached. The called
decode
is node.utils:decode.)How insane it would be to handle all strings as bytestrings (assuming utf-8 as defined by LDAP spec) and handle decoding on the layer on top of node.ext.ldap?
I assume that this is WONTFIX, because it would break any app using node.ext.ldap.
Does the dependencies of node.ext.ldap assume require unicode strings, or would it be enough for me to fork node.ext.ldap and pas.plugins.ldap to only do encoding/decoding in pas.plugins.ldap?
The text was updated successfully, but these errors were encountered: