In the unlikely event that your destination is a directory containing a '.' then this will give unexpected results. Also, we could just use `'.' in destination.rpartition(os.path.sep)[-1]` rather than counting the dots. I know this wasn't your code originally, but may be worth a cleanup.