summaryrefslogtreecommitdiffstats
path: root/Lib/mailbox.py
diff options
context:
space:
mode:
authorZackery Spytz <zspytz@gmail.com>2023-12-25 15:07:51 (GMT)
committerGitHub <noreply@github.com>2023-12-25 15:07:51 (GMT)
commit3f5eb3e6c75b874db1a83c9d53e824e56fcad02e (patch)
tree03b86133f14368d15e48bb25568e14dbe50291f3 /Lib/mailbox.py
parentf7c5a7a0f9f8186a7fdc8b721468d022fe310b04 (diff)
downloadcpython-3f5eb3e6c75b874db1a83c9d53e824e56fcad02e.zip
cpython-3f5eb3e6c75b874db1a83c9d53e824e56fcad02e.tar.gz
cpython-3f5eb3e6c75b874db1a83c9d53e824e56fcad02e.tar.bz2
bpo-21360: mailbox.Maildir now ignores files with a leading dot (GH-11833)
The maildir format specification states that files with a leading dot should be ignored. Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Diffstat (limited to 'Lib/mailbox.py')
-rw-r--r--Lib/mailbox.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/mailbox.py b/Lib/mailbox.py
index 36afade..574c014 100644
--- a/Lib/mailbox.py
+++ b/Lib/mailbox.py
@@ -590,6 +590,8 @@ class Maildir(Mailbox):
for subdir in self._toc_mtimes:
path = self._paths[subdir]
for entry in os.listdir(path):
+ if entry.startswith('.'):
+ continue
p = os.path.join(path, entry)
if os.path.isdir(p):
continue