Skip to content
This repository has been archived by the owner on May 23, 2023. It is now read-only.

bugfix:-utf-8-BOM-header #389

Merged
merged 1 commit into from
Jan 12, 2022
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: 3 additions & 1 deletion iast/views/sca_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,9 @@ def get(self, request):
fileuuid = uuid.uuid1()
i18n_headers = zh_headers if get_language() == 'zh' else headers
filename = '组件报告' if get_language() == 'zh' else 'SCA REPORT'
with open(f'/tmp/{fileuuid}.csv', 'w') as csv_file:
with open(f'/tmp/{fileuuid}.csv', 'wb') as csv_file:
csv_file.write(b'\xEF\xBB\xBF')
with open(f'/tmp/{fileuuid}.csv', 'a') as csv_file:
writer = csv.writer(csv_file, delimiter=',')
writer.writerow(i18n_headers)
for row in rows:
Expand Down