Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cubicweb
cubes
seda
Commits
f14dfe93073a
Commit
9e7c1930
authored
Oct 02, 2019
by
Denis Laxalde
Browse files
[py3] Decode stream before doing string comparisons
parent
33ad61a9f699
Changes
1
Hide whitespace changes
Inline
Side-by-side
cubicweb_seda/dataimport.py
View file @
f14dfe93
...
...
@@ -133,8 +133,9 @@ def lcsv_check(cnx, store, fname, scheme_uri, separator=';', **kwargs):
# 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'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment