Wierd characters at the end of the file path when running job in ECS

  amazon-ecs, amazon-s3, amazon-sqs, linux, windows

I want in a project which involves accessing file & directories. I created a python task, which will move files from local to AWS SQS queues.

When testing locally, it works file. After deploying and running in ECS, it creates a weird path which causes FileNotFoundError. Something like this.

FileNotFoundError: [Errno 2] No such file or directory: '/temp/project1 name/images/sample with images.pdf .BEbC2Ee3

Those characters after the file extension are the weird characters.
We can’t figure it out. Why it happens!

Note: Some directories & files contain space(s).

Edit: We first move the file to a temp location and then to SQS.
The temp folder was in my machine locally(windows).

But when running from ECS, we use Linuxmachine.
I suspect the Linux machine appended these characters.

Source: Windows Questions