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

Commit

Permalink
Merge pull request #389 from Bidaya0/bugfix--utf-8-BOM-header
Browse files Browse the repository at this point in the history
bugfix:-utf-8-BOM-header
  • Loading branch information
Bidaya0 authored Jan 12, 2022
2 parents 8ac721c + 0d92484 commit c89fafe
Showing 1 changed file with 3 additions and 1 deletion.
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

0 comments on commit c89fafe

Please sign in to comment.