# HG changeset patch # User Marcin Kuzminski # Date 1283335983 -7200 # Node ID c59c4d4323e7ba54d5728233c149f48b13560562 # Parent 9fe5ca6d72f606337ad509423d2664b1e456dc56 added support for broken symlinks in whoosh indexer diff -r 9fe5ca6d72f6 -r c59c4d4323e7 pylons_app/lib/indexers/daemon.py --- a/pylons_app/lib/indexers/daemon.py Mon Aug 30 17:51:36 2010 +0200 +++ b/pylons_app/lib/indexers/daemon.py Wed Sep 01 12:13:03 2010 +0200 @@ -86,13 +86,24 @@ log.debug(' >> %s' % path) #just index file name without it's content u_content = u'' - - writer.add_document(owner=unicode(repo.contact), + + + + try: + os.stat(path) + writer.add_document(owner=unicode(repo.contact), repository=u"%s" % repo.name, path=u"%s" % path, content=u_content, modtime=os.path.getmtime(path), - extension=ext) + extension=ext) + except OSError, e: + import errno + if e.errno == errno.ENOENT: + log.debug('path %s does not exist or is a broken symlink' % path) + else: + raise e + def build_index(self): if os.path.exists(IDX_LOCATION):