From b128935940a93b89ca68ae74949d8e8b2b4c5d9e Mon Sep 17 00:00:00 2001 From: "Alex V." <119082209+Retengart@users.noreply.github.com> Date: Sat, 7 Feb 2026 16:28:42 +0300 Subject: [PATCH] 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. --- chatmaild/src/chatmaild/fsreport.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chatmaild/src/chatmaild/fsreport.py b/chatmaild/src/chatmaild/fsreport.py index 375800f8..0b9a68ca 100644 --- a/chatmaild/src/chatmaild/fsreport.py +++ b/chatmaild/src/chatmaild/fsreport.py @@ -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