if 'n' in request.GET:
try:
limit = int(request.GET['n'])
- except:
+ except Exception:
limit = 0
else:
limit = 50
return None
try:
return hide_reasons[self.hiddenstatus]
- except:
+ except Exception:
# Weird value
return 'This message has been hidden.'
'names': request.POST['ln'].split(','),
})
lists = [x for x, in curs.fetchall()]
- except:
+ except Exception:
# If failing to parse list of lists, just search all
lists = None
else:
try:
x = msg.as_string(unixfrom=True)
f.write(x)
- except UnicodeEncodeError as e:
+ except UnicodeEncodeError:
print("Not including {0}, unicode error".format(msg['message-id']))
except Exception as e:
print("Not including {0}, exception {1}".format(msg['message-id'], e))
cfg.read(os.path.join(os.path.realpath(os.path.dirname(sys.argv[0])), 'archives.ini'))
try:
connstr = cfg.get('db', 'connstr')
- except:
+ except Exception:
connstr = 'need_connstr'
conn = psycopg2.connect(connstr)
cfg.read('%s/archives.ini' % os.path.realpath(os.path.dirname(sys.argv[0])))
try:
connstr = cfg.get('db', 'connstr')
- except:
+ except Exception:
connstr = 'need_connstr'
conn = psycopg2.connect(connstr)
else:
try:
print("Hiding message for reason: %s" % reasons[reason])
- except:
+ except Exception:
continue
break
if previous == reason:
try:
if self.clean_messageid(self.decode_mime_header(self.get_mandatory('Message-ID'))) == msgid:
return True
- except Exception as e:
+ except Exception:
return False
def analyze(self, date_override=None):
try:
return " ".join([self._maybe_decode(s, charset) for s, charset in decode_header(hdr)])
- except HeaderParseError as e:
+ except HeaderParseError:
# Parser error is typically someone specifying an encoding,
# but then not actually using that encoding. We'll do the best
# we can, which is cut it down to ascii and ignore errors
if x is None:
raise Exception()
return x
- except:
+ except Exception:
raise IgnorableException("Mandatory field '%s' is missing" % fieldname)
def get_optional(self, fieldname):
try:
return self.msg[fieldname]
- except:
+ except Exception:
return ''
def html_clean(self, html):
cleaner = HTMLCleaner()
cleaner.feed(html)
return cleaner.get_text()
- except Exception as e:
+ except Exception:
# Failed to parse the html, thus failed to clean it. so we must
# give up...
return None
cfg.read('%s/archives.ini' % os.path.realpath(os.path.dirname(sys.argv[0])))
try:
connstr = cfg.get('db', 'connstr')
- except:
+ except Exception:
connstr = 'need_connstr'
if cfg.has_option('pglister', 'subscribers') and cfg.getint('pglister', 'subscribers'):
cfg.read('%s/archives.ini' % os.path.realpath(os.path.dirname(sys.argv[0])))
try:
connstr = cfg.get('db', 'connstr')
- except:
+ except Exception:
connstr = 'need_connstr'
conn = psycopg2.connect(connstr)
cfg.read('%s/archives.ini' % os.path.realpath(os.path.dirname(sys.argv[0])))
try:
connstr = cfg.get('db', 'connstr')
- except:
+ except Exception:
connstr = 'need_connstr'
conn = psycopg2.connect(connstr)
cfg.read('%s/../archives.ini' % os.path.realpath(os.path.dirname(sys.argv[0])))
try:
connstr = cfg.get('db', 'connstr')
- except:
+ except Exception:
connstr = 'need_connstr'
conn = psycopg2.connect(connstr)
finally:
try:
f.close()
- except:
+ except Exception:
pass
os.unlink(f.name)
cfg.read('%s/../archives.ini' % os.path.realpath(os.path.dirname(sys.argv[0])))
try:
connstr = cfg.get('db', 'connstr')
- except:
+ except Exception:
connstr = 'need_connstr'
conn = psycopg2.connect(connstr)