aioshutil icon indicating copy to clipboard operation
aioshutil copied to clipboard

aioshutil.make_archive sometimes return FileNotFoundError when concurrent request

Open mydu27 opened this issue 2 years ago • 1 comments

Actually I have a restful API, it will compress folder to zip and return zip file. But if I concurrent request many different folder to compress, some request will return error like this: image

My code is: image

mydu27 avatar Nov 24 '22 04:11 mydu27

I have the same exact issue, this is due to the underlying shutil implementation, which calls os.chdir multiple times Wrapping this in a thread assumes the caller is the only one manipulating the current directory, and that is not the case when awaiting the wrapped task

federicocagnola avatar Jul 10 '24 14:07 federicocagnola