From b28b1e3ff04b7139e2b3a3b5729b91080faefe2b Mon Sep 17 00:00:00 2001 From: Bernardo Innocenti Date: Tue, 8 Jan 2008 23:09:55 +0100 Subject: [PATCH] Don't choke on directories in full text search --- geekigeeki.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/geekigeeki.py b/geekigeeki.py index a1c99a0..db11433 100755 --- a/geekigeeki.py +++ b/geekigeeki.py @@ -593,6 +593,8 @@ class Page: except IOError, er: if er.errno == errno.ENOENT: return '' # just doesn't exist, use default + if er.errno == errno.EISDIR: + return 'DIR' raise er def get_attrs(self): @@ -690,12 +692,12 @@ class Page: send_footer(self.page_name) def send_raw(self, mimetype='text/plain'): - if not self.can_read(): + if self.can_read(): + body = self.get_raw_body() + emit_header(mimetype) + print body + else: send_title(None, msg='Read access denied by ACLs', msg_type='notice') - return - body = self.get_raw_body() - emit_header(mimetype) - print body def _write_file(self, text): tmp_filename = self._tmp_filename() -- 2.25.1