[issue46512] filecmp.cmpfiles w/ absolute path names

bers report at bugs.python.org
Sat Jan 29 03:21:26 EST 2022


bers <bers at gmx.net> added the comment:

> Did your example work with relative paths?

Yes, it does. Just append the following to my example code:

    # actually diff the files - correctly!
    files = [f.relative_to(dir_a) for f in dir_a.glob("*")]
    (_, different, _) = filecmp.cmpfiles(dir_a, dir_b, files, shallow=False)
    print("different:", *different)

Output then is

equal: C:\Users\bers\AppData\Local\Temp\tmp1p6jh4rg\a\foo.txt
different: foo.txt

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46512>
_______________________________________


More information about the Python-bugs-list mailing list