Skip to content

Commit

Permalink
adds warning for UnicodeEncodeErrors in save2csv
Browse files Browse the repository at this point in the history
  • Loading branch information
klinga committed Sep 27, 2024
1 parent b204a7d commit 2da4412
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion google_books/utils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import csv
from datetime import datetime
import warnings

import click

Expand All @@ -23,7 +24,7 @@ def save2csv(dst_fh, delimiter, row):
try:
out.writerow(row)
except UnicodeEncodeError:
pass
warnings.warn(f"Could not write {row[0]} to {dst_fh}")


def fh_date(fh: str) -> str:
Expand Down

0 comments on commit 2da4412

Please sign in to comment.