Skip to content

Commit 8dfccf4

Browse files
committed
Use 'replace' for encoding errors
Signed-off-by: Chin Yeung Li <[email protected]>
1 parent f163a77 commit 8dfccf4

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/attributecode/util.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -259,16 +259,14 @@ def load_csv(location):
259259
for each row.
260260
"""
261261
results = []
262-
# FIXME: why ignore encoding errors here?
263262
with codecs.open(location, mode='rb', encoding='utf-8-sig',
264-
errors='ignore') as csvfile:
263+
errors='replace') as csvfile:
265264
for row in csv.DictReader(csvfile):
266265
# convert all the column keys to lower case
267266
updated_row = {key.lower(): value for key, value in row.items()}
268267
results.append(updated_row)
269268
return results
270269

271-
272270
def load_json(location):
273271
"""
274272
Read JSON file at `location` and return a list of ordered dicts, one for

0 commit comments

Comments
 (0)