[server] fix checkintegrity with pyodbc
authorJulien Cristau <julien.cristau@logilab.fr>
Tue, 29 Sep 2015 15:11:29 +0200
changeset 10625 684dbf6722ef
parent 10624 48e54aabcd55
child 10626 93f8d239c708
[server] fix checkintegrity with pyodbc "msg % row" dies with "not enough arguments for format string" if row is a pyodbc.Row.
server/checkintegrity.py
--- a/server/checkintegrity.py	Tue Sep 29 14:23:57 2015 +0200
+++ b/server/checkintegrity.py	Tue Sep 29 15:11:29 2015 +0200
@@ -207,7 +207,7 @@
                                 '  WHERE cs.eid_from=e.eid AND cs.eid_to=s.cw_eid) '
                                 'ORDER BY e.eid')
     for row in cursor.fetchall():
-        sys.stderr.write(msg % row)
+        sys.stderr.write(msg % tuple(row))
     if fix:
         cnx.system_sql('INSERT INTO is_relation (eid_from, eid_to) '
                            'SELECT e.eid, s.cw_eid FROM entities as e, cw_CWEType as s '
@@ -221,7 +221,7 @@
                                 '  WHERE cs.eid_from=e.eid AND cs.eid_to=s.cw_eid) '
                                 'ORDER BY e.eid')
     for row in cursor.fetchall():
-        sys.stderr.write(msg % row)
+        sys.stderr.write(msg % tuple(row))
     if fix:
         cnx.system_sql('INSERT INTO is_instance_of_relation (eid_from, eid_to) '
                            'SELECT e.eid, s.cw_eid FROM entities as e, cw_CWEType as s '