Copy_file hook

Hi, there is currently no clean way to override copy_file function. The speed of shutil.copy is really poor on linux (smb shares). I think it is a good idea to provide a core copy_file hook…

Now I’m overriding the copy func via tank_init hook (filesystem.copy_file = my_copy_file), but I think it is really not elegant way…

1 Like

What is your use case? If you control the caller, of course you can just call my_copy_file(src, dest). But if you want to change all copy behavior…
In the current situation, “monkey patching” as you do is sensible.
A hook would be nice indeed.

The main reason is very slow publishing when copying files - I know that I can use a multi-publish hook. But speeding up of all copy_file ops is preferred :slight_smile: