def _binary_replace(old, new):
    old_isbin = not salt.utils.istextfile(old)
    new_isbin = not salt.utils.istextfile(new)
    if any((old_isbin, new_isbin)):
        if all((old_isbin, new_isbin)):
            return 'Replace binary file'
        elif old_isbin:
            return 'Replace binary file with text file'
        elif new_isbin:
            return 'Replace text file with binary file'
    return ''
This function does NOT do any diffing, it just checks the old and new files
dataset/ETHPy150Open saltstack/salt/salt/modules/file.py/_binary_replace