[Zope-CVS] CVS: Products/ZCTextIndex/tests - mhindex.py:1.15
Guido van Rossum
guido@python.org
Thu, 6 Jun 2002 10:16:48 -0400
Update of /cvs-repository/Products/ZCTextIndex/tests
In directory cvs.zope.org:/tmp/cvs-serv13525
Modified Files:
mhindex.py
Log Message:
Don't die when a message can't be opened.
=== Products/ZCTextIndex/tests/mhindex.py 1.14 => 1.15 ===
print "Rank: %d Score: %d%% File: %s" % (rank, score, path)
path = os.path.join(self.mh.getpath(), path)
- fp = open(path)
+ try:
+ fp = open(path)
+ except (IOError, OSError), msg:
+ print "Can't open:", msg
+ continue
msg = mhlib.Message("<folder>", 0, fp)
for header in "From", "To", "Cc", "Bcc", "Subject", "Date":
h = msg.getheader(header)