Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update to open file as binary #434

Merged
merged 1 commit into from
Sep 20, 2024
Merged
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
4 changes: 2 additions & 2 deletions python/src/functions/generate_treasury_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ def process_event(payload: ProjectLambdaPayload, logger: structlog.stdlib.BoundL

### 5) Save data
# Output XLSX file
with tempfile.NamedTemporaryFile("r+") as new_output_file:
with tempfile.NamedTemporaryFile("rb+") as new_output_file:
output_workbook.save(new_output_file.name)
upload_generated_file_to_s3(
client=s3_client,
Expand All @@ -229,7 +229,7 @@ def process_event(payload: ProjectLambdaPayload, logger: structlog.stdlib.BoundL
file=new_output_file,
)
# Output CSV file for treasury
with tempfile.NamedTemporaryFile("r+") as csv_file:
with tempfile.NamedTemporaryFile("rb+") as csv_file:
convert_xlsx_to_csv(csv_file, output_workbook, highest_row_num)
upload_generated_file_to_s3(
client=s3_client,
Expand Down
Loading