There was a traceback when setting permissions on a directory tree when there were broken symlinks inside of the tree and follow=true. chmod -R ignores broken symlinks inside of the tree so we've fixed the file module to do the same. Fixes #39456