[Checkins] SVN: ldapadapter/trunk/src/ldapadapter/ restore the "DN can be unicode and is encoded to UTF-8 automatically behaviour"

Kevin Teague kevin at bud.ca
Thu Jun 12 16:31:18 EDT 2008


Log message for revision 87350:
  restore the "DN can be unicode and is encoded to UTF-8 automatically behaviour"

Changed:
  _U  ldapadapter/trunk/src/ldapadapter/
  _U  ldapadapter/trunk/src/ldapadapter/tests/
  U   ldapadapter/trunk/src/ldapadapter/utility.py

-=-

Property changes on: ldapadapter/trunk/src/ldapadapter
___________________________________________________________________
Name: svn:ignore
   + *.pyc



Property changes on: ldapadapter/trunk/src/ldapadapter/tests
___________________________________________________________________
Name: svn:ignore
   + *.pyc


Modified: ldapadapter/trunk/src/ldapadapter/utility.py
===================================================================
--- ldapadapter/trunk/src/ldapadapter/utility.py	2008-06-12 19:30:58 UTC (rev 87349)
+++ ldapadapter/trunk/src/ldapadapter/utility.py	2008-06-12 20:31:16 UTC (rev 87350)
@@ -57,6 +57,10 @@
             # are then not utf-8 encoded (charset is implicit (?))
             raise Exception("Server should be LDAP v3")
         # TODO: conn.set_option(OPT_REFERRALS, 1)
+        
+        # if dn is unicode, automatically convert dn to UTF-8 byte string
+        if isinstance(dn, unicode):
+            dn = dn.encode('utf-8')
 
         # Bind the connection to the dn
         if dn is None:



More information about the Checkins mailing list