filecmp.cmp() ignoring differing os.stat() signatures?
The Python 2 docs for filecmp() say: Unless shallow is given and is false, files with identical os.stat() signatures are taken to be equal. Which sounds like two files which are identical except for their os.stat() signature will be considered unequal, however this does not seem to be the case, as illustrated by running the following code snippet: import filecmp import os import shutil import time with open('test_file_1', 'w') as f: f.write('file contents') shutil.copy('test_file_1', 'test_file_2') time.sleep(5) # pause to get a different time-stamp os.utime('test_file_2', None) # change