Skip to content

Commit 859d5d7

Browse files
Merge pull request #2531 from IFRCGo/fix/csv-file-reading-azure
fix(bulk-upload): use TextIOWrapper to read csv files
2 parents bac5a65 + 38be2bb commit 859d5d7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

local_units/bulk_upload.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ def process_row(self, data: Dict[str, Any]) -> bool:
7373
return False
7474

7575
def run(self) -> None:
76-
with self.bulk_upload.file.open("r") as file:
76+
with self.bulk_upload.file.open("rb") as csv_file:
77+
file = io.TextIOWrapper(csv_file, encoding="utf-8")
7778
csv_reader = csv.DictReader(file)
7879
fieldnames = csv_reader.fieldnames or []
7980

0 commit comments

Comments
 (0)