AcademySoftwareFoundation / rez

An integrated package configuration, build and deployment system for software
https://rez.readthedocs.io
Apache License 2.0
920 stars 329 forks source link

Handle race condition caused by AppleDouble files when removing a directory tree #1716

Open cfxegbert opened 3 months ago

cfxegbert commented 3 months ago

Handle race condition caused by AppleDouble files when removing a directory tree

JeanChristopheMorinPerso commented 3 months ago

Hi @cfxegbert, can you explain a little bit more what this is about and also describe the problem more in-depth please?

When creating pull requests (or issues), please provide as much details as possible.

cfxegbert commented 3 months ago

Sorry about that. From a comment in the code.

On Mac OSX files may consist of a data fork and a resource fork. On a foreign file system these files are stored as AppleDouble files. The data fork is stored as "filename" and the resource fork is stored as "._filename". When the data fork is removed the corresponding resource fork is also removed. This results in a FileNotFoundError when shutil.rmtree tries to remove the resource fork. This is addressed in Python 13.3 for another situation not related to AppleDouble files https://github.com/python/cpython/pull/14064