r23301 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r23300‎ | r23301 | r23302 >
Date:19:22, 23 June 2007
Author:Mark Bergsma
Status:old
Tags:
Comment:
Ignore permission denieds on listdir()s
Modified paths:
  • /trunk/wmfmailadmin/mbcleanup.py (modified) (history)

Diff [purge]

Index: trunk/wmfmailadmin/mbcleanup.py
@@ -28,10 +28,13 @@
2929 for domain in os.listdir(mbroot):
3030 domaindir = os.path.join(mbroot, domain)
3131 if not domain.startswith('.') and os.path.isdir(domaindir):
32 - for localpart in os.listdir(domaindir):
33 - if not localpart.startswith('.') and not localpart.find('@') and \
34 - os.path.isdir(os.path.join(domaindir, localpart)):
35 - mailboxes.add((unicode(domain), unicode(localpart)))
 32+ try:
 33+ for localpart in os.listdir(domaindir):
 34+ if not localpart.startswith('.') and not localpart.find('@') and \
 35+ os.path.isdir(os.path.join(domaindir, localpart)):
 36+ mailboxes.add((unicode(domain), unicode(localpart)))
 37+ except OSError, e:
 38+ if e.errno != 13: raise
3639
3740 return mailboxes
3841

Status & tagging log