Index: squid-tagger.py ================================================================== --- squid-tagger.py +++ squid-tagger.py @@ -62,15 +62,18 @@ reply = '-' for row in result: if row != None and row[0] != None: if row[1] != None: self._log.info('trying regexp "{}" versus "{}"\n'.format(row[1], url_path)) - if re.compile(row[1]).match(url_path): - reply = '302:' + row[0] - break - else: - continue + try: + if re.compile(row[1]).match(url_path): + reply = '302:' + row[0] + break + else: + continue + except: + self._log.info("can't compile regexp") else: reply = '302:' + row[0] break self.writeline('{} {}\n'.format(id, reply))