crowdin-api-client-python icon indicating copy to clipboard operation
crowdin-api-client-python copied to clipboard

File upload fails when filename contains non-ASCII characters

Open modestman opened this issue 2 months ago • 0 comments

When using StoragesResource.add_storage(file) to upload a file with Cyrillic characters in its name, the upload fails.

According to the API documentation, the filename is passed in the Crowdin-API-FileName HTTP header and must be URL-encoded.

However, in crowdin_api/requester.py (line 116), URL encoding is not applied:

headers["Crowdin-API-FileName"] = os.path.basename(file.name)

Expected behavior:

from urllib.parse import quote
headers["Crowdin-API-FileName"] = quote(os.path.basename(file.name))

Could you please fix this?

modestman avatar Dec 02 '25 16:12 modestman