[PATCH 07 of 17 seda] [py3] Decode stream before doing string comparisons

Denis Laxalde denis.laxalde at logilab.fr
Wed Oct 2 16:06:35 CEST 2019


diff --git a/cubicweb_seda/dataimport.py b/cubicweb_seda/dataimport.py
index 1a8be77..a16b918 100644
--- a/cubicweb_seda/dataimport.py
+++ b/cubicweb_seda/dataimport.py
@@ -133,8 +133,9 @@ def lcsv_check(cnx, store, fname, scheme
 
         # also check there are the expected number of separator for each line
         stream.seek(0)
-        expected_separators = stream.readline().count(separator)
+        expected_separators = stream.readline().decode('utf-8').count(separator)
         for i, line in enumerate(stream):
+            line = line.decode('utf-8')
             if line.count(separator) != expected_separators:
                 linenum = i + 2
                 raise AssertionError('Got %s %s on line %s of %s, %s where expected'



More information about the saem-devel mailing list