fix: use msg.path instead of nonexistent msg.relpath in fsreport

FileEntry namedtuple has (path, mtime, size), not relpath.
Crashes with AttributeError when --mdir flag is used.
This commit is contained in:
Alex V.
2026-02-07 16:28:42 +03:00
committed by j4n
parent 2e38c61ca2
commit b128935940

View File

@@ -68,7 +68,7 @@ class Report:
for size in self.message_buckets:
for msg in mailbox.messages:
if msg.size >= size:
if self.mdir and not msg.relpath.startswith(self.mdir):
if self.mdir and f"/{self.mdir}/" not in msg.path:
continue
self.message_buckets[size] += msg.size