Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions export_saved.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

from time import time
import argparse
import csv
import unicodecsv as csv
import logging
import sys

Expand Down Expand Up @@ -67,7 +67,7 @@ def convert(self):
ifile = open(self._html_file, 'wb')
try:
ifile.write(content)
except TypeError:
except (UnicodeEncodeError, TypeError):
ifile.write(content.encode('utf-8', 'ignore'))


Expand Down Expand Up @@ -251,7 +251,7 @@ def write_csv(csv_rows, file_name=None):
csvwriter.writerow(row)
except (UnicodeEncodeError, TypeError) as e:
with open(file_name, "w") as f:
csvwriter = csv.writer(f, delimiter=delimiter, quoting=csv.QUOTE_MINIMAL)
csvwriter = csv.writer(f, delimiter=delimiter, quoting=csv.QUOTE_MINIMAL, encoding='utf-8')
csvwriter.writerow(csv_fields)
for row in csv_rows:
try:
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
praw==4.4.0
unicodecsv==0.14.1