• Kai Willadsen's avatar
    dirdiff: Fix display of encoding errors when scanning folders (#235) · 924ac31d
    Kai Willadsen authored
    The existing handling was Python 2 era. In the current code, we'll
    always have a `str`-type root for our `os.listdir()` call, so the
    entries will always be `str`s. This patch handles the Python 3 path
    handling situation of getting surrogate escaped paths (in the case of a
    bad file name vs. filesystem encoding) by just checking for a valid
    re-encode and treating any failure as an encoding error.
    924ac31d
dirdiff.py 64.4 KB