Skip to content

Commit

Permalink
fix: row encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
rachmadaniHaryono committed May 10, 2017
1 parent c8cca7e commit dbe00b0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions export_saved.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ def write_csv(csv_rows, file_name=None):
try:
csvwriter.writerow(row)
except UnicodeEncodeError:
csvwriter.writerow(row.encode('utf8', 'ignore'))
csvwriter.writerow([x.encode('utf8', 'ignore') for x in row])
except TypeError:
with open(file_name, "w") as f:
csvwriter = csv.writer(f, delimiter=delimiter, quoting=csv.QUOTE_MINIMAL)
Expand All @@ -262,7 +262,7 @@ def write_csv(csv_rows, file_name=None):
try:
csvwriter.writerow(row)
except UnicodeEncodeError:
csvwriter.writerow(row.encode('utf-8', 'ignore'))
csvwriter.writerow([x.encode('utf8', 'ignore') for x in row])


def process(reddit, seq, file_name, folder_name):
Expand Down

0 comments on commit dbe00b0

Please sign in to comment.