Upload of CycloneDX file fails when dependency file path contains non-English characters

Summary

When the path for the dependency file such as requirements.txt contains non-English characters, uploading the CycloneDX file fails after the Gemnasium scan successfully completes.

Steps to reproduce

Create the following directory structure

Project-root
├"non-English directory name" (For example, "日本語" )
│ └requirements.txt
└.gitlab-ci.yml

Example Project

Project: https://gitlab.com/kkamiya_gl/issue-replication-20240919

Failed job: https://gitlab.com/kkamiya_gl/issue-replication-20240919/-/jobs/7863439819

What is the current bug behavior?

Artifact (CycloneDX file) can not be uploaded like this job: https://gitlab.com/kkamiya_gl/issue-replication-20240919/-/jobs/7863439819

What is the expected correct behavior?

Artifact (CycloneDX file) can be uploaded like this job: https://gitlab.com/kkamiya_gl/issue-replication-20240919/-/jobs/7863454078

Relevant logs and/or screenshots

Uploading artifacts...
**/gl-sbom-*.cdx.json: found 1 matching artifact files and directories 
ERROR: Uploading artifacts as "cyclonedx" to coordinator... error  error=couldn't execute POST against https://us-east1-c.ci-gateway.int.gprd.gitlab.net:8989/api/v4/jobs/7863439819/artifacts?artifact_format=gzip&artifact_type=cyclonedx: Post "https://us-east1-c.ci-gateway.int.gprd.gitlab.net:8989/api/v4/jobs/7863439819/artifacts?artifact_format=gzip&artifact_type=cyclonedx": gzip.Write: non-Latin-1 header string id=7863439819 token=glcbt-66
WARNING: Retrying...                                context=artifacts-uploader error=invalid argument
ERROR: Uploading artifacts as "cyclonedx" to coordinator... error  error=couldn't execute POST against https://us-east1-c.ci-gateway.int.gprd.gitlab.net:8989/api/v4/jobs/7863439819/artifacts?artifact_format=gzip&artifact_type=cyclonedx: Post "https://us-east1-c.ci-gateway.int.gprd.gitlab.net:8989/api/v4/jobs/7863439819/artifacts?artifact_format=gzip&artifact_type=cyclonedx": gzip.Write: non-Latin-1 header string id=7863439819 token=glcbt-66
WARNING: Retrying...                                context=artifacts-uploader error=invalid argument
ERROR: Uploading artifacts as "cyclonedx" to coordinator... error  error=couldn't execute POST against https://us-east1-c.ci-gateway.int.gprd.gitlab.net:8989/api/v4/jobs/7863439819/artifacts?artifact_format=gzip&artifact_type=cyclonedx: Post "https://us-east1-c.ci-gateway.int.gprd.gitlab.net:8989/api/v4/jobs/7863439819/artifacts?artifact_format=gzip&artifact_type=cyclonedx": gzip.Write: non-Latin-1 header string id=7863439819 token=glcbt-66
FATAL: invalid argumen

Output of checks

This bug happens on GitLab.com

Possible fixes