[ldapparser] utf-8 uri + unicode emailaddr will crash if the later is not properly encoded (closes #2508515) stable
authorAurelien Campeas <aurelien.campeas@logilab.fr>
Wed, 17 Oct 2012 15:47:12 +0200
branchstable
changeset 8575 688d108af306
parent 8572 e54b3bc39011
child 8582 b0e086f451b7
[ldapparser] utf-8 uri + unicode emailaddr will crash if the later is not properly encoded (closes #2508515)
sobjects/ldapparser.py
--- a/sobjects/ldapparser.py	Tue Oct 02 16:44:55 2012 +0200
+++ b/sobjects/ldapparser.py	Wed Oct 17 15:47:12 2012 +0200
@@ -151,7 +151,8 @@
             elif self.sourceuris:
                 # pop from sourceuris anyway, else email may be removed by the
                 # source once import is finished
-                self.sourceuris.pop(str(userdict['dn'] + '@@' + emailaddr), None)
+                uri = userdict['dn'] + '@@' + emailaddr.encode('utf-8')
+                self.sourceuris.pop(uri, None)
             # XXX else check use_email relation?
 
     @cached