[syncschema] hashlib.md5() wants bytes
authorJulien Cristau <julien.cristau@logilab.fr>
Mon, 19 Oct 2015 14:28:30 +0200
changeset 10816 d4a26e94f54a
parent 10815 bc679f7e96d8
child 10817 7b154e0fa194
[syncschema] hashlib.md5() wants bytes
hooks/syncschema.py
--- a/hooks/syncschema.py	Mon Oct 19 14:27:04 2015 +0200
+++ b/hooks/syncschema.py	Mon Oct 19 14:28:30 2015 +0200
@@ -718,8 +718,8 @@
             syssource.update_rdef_unique(cnx, rdef)
             self.unique_changed = True
         if cstrtype in ('BoundaryConstraint', 'IntervalBoundConstraint', 'StaticVocabularyConstraint'):
-            cstrname = 'cstr' + md5(rdef.subject.type + rdef.rtype.type + cstrtype +
-                                    (self.oldcstr.serialize() or '')).hexdigest()
+            cstrname = 'cstr' + md5((rdef.subject.type + rdef.rtype.type + cstrtype +
+                                     (self.oldcstr.serialize() or '')).encode('utf-8')).hexdigest()
             cnx.system_sql('ALTER TABLE %s%s DROP CONSTRAINT %s' % (SQL_PREFIX, rdef.subject.type, cstrname))
 
     def revertprecommit_event(self):