Asana / python-asana

Official Python client library for the Asana API v1
MIT License
299 stars 103 forks source link

Attachment file name encoding #161

Open ivasilop opened 1 year ago

ivasilop commented 1 year ago

There seems to be an issue with the file name encoding using the create_attachment_for_task function.

python-asana library version = 3.0.0

Giving the param file_name some greek characters, the filename of the attachment file uploaded to Asana has wrong encoding.

Example Request:

client.attachments.create_attachment_for_task(
    task_id=data['task_id'],
    file_content=attachment,
    file_name='τεστ συνημμένο',
    file_content_type=attachment.content_type,
    opt_pretty=True
)

Asana attachment filename stored:

τεστ συνημμένο

Note that posting the same request using Postman, the attachment filename is stored with the correct encoding in the Asana task.