Skip to content

Commit

Permalink
[PRMP-1353] - Read all files as UTF-8 encoded (#484)
Browse files Browse the repository at this point in the history
  • Loading branch information
MohammadIqbalAD-NHS authored Dec 12, 2024
1 parent 168301b commit 9db1f78
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lambdas/services/bulk_upload_metadata_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ def csv_to_staging_metadata(csv_file_path: str) -> list[StagingMetadata]:
logger.info("Parsing bulk upload metadata")

patients = {}
with open(csv_file_path, mode="r") as csv_file_handler:
with open(
csv_file_path, mode="r", encoding="utf-8", errors="replace"
) as csv_file_handler:
csv_reader: Iterable[dict] = csv.DictReader(csv_file_handler)
for row in csv_reader:
file_metadata = MetadataFile.model_validate(row)
Expand Down

0 comments on commit 9db1f78

Please sign in to comment.