# HG changeset patch # User Franz Glasner # Date 1736170687 -3600 # Node ID 481cc9b26861278b0f6b042b9042b4920e6f29a8 # Parent bf74ce3c968d6cd4a4227a6efac11dc211187339 Calculate "stat()" for directories also in a WalkDirEntry diff -r bf74ce3c968d -r 481cc9b26861 cutils/treesum.py --- a/cutils/treesum.py Mon Jan 06 13:39:12 2025 +0100 +++ b/cutils/treesum.py Mon Jan 06 14:38:07 2025 +0100 @@ -312,6 +312,8 @@ follow_symlinks=follow_directory_symlinks): dir_dgst = algorithm[0]() for fso in fsobjects: + # print("NNNNNNNN", fso.name, fso.stat, + # "%o (%o)" % (fso.stat.st_mode, stat.S_IMODE(fso.stat.st_mode))) if fso.is_dir: if fso.is_symlink and not follow_directory_symlinks: linktgt = util.fsencode(os.readlink(fso.path)) diff -r bf74ce3c968d -r 481cc9b26861 cutils/util/walk.py --- a/cutils/util/walk.py Mon Jan 06 13:39:12 2025 +0100 +++ b/cutils/util/walk.py Mon Jan 06 14:38:07 2025 +0100 @@ -109,9 +109,8 @@ # is not a symbolic link, same behaviour than os.path.islink(). # w._is_symlink = False - if not w._is_dir: - # Do not supress errors here and (consistently) follow symlinks - w._stat_result = entry.stat(follow_symlinks=True) + # Do not supress errors here and (consistently) follow symlinks + w._stat_result = entry.stat(follow_symlinks=True) return w @staticmethod