picnixz · GitHub

Bug report

Bug description:

In filecmp.cmpfiles, when the path is not stat-able, it will be put in the "fancy" files. This should include paths that would raise ValueError.

Note that filecmp.cmp should not be protected against that since it already ignores an OSError possibly raised by os.stat.

Similarly, filecmp.dircmp should not suppress OSError or ValueError when listing the directory contents. It should however silence ValueError when checking the common files since it already silence an OSError.

TL;DR: Only protect against ValueError if the current code is already protecting against OSError.

CPython versions tested on:

CPython main branch

Operating systems tested on:

No response

Linked PRs

Read the original on github.com ↗