diff --git a/gajim/advanced_configuration_window.py b/gajim/advanced_configuration_window.py index f0a58aff2..beff22016 100644 --- a/gajim/advanced_configuration_window.py +++ b/gajim/advanced_configuration_window.py @@ -306,7 +306,7 @@ class AdvancedConfigurationWindow: else: try: value = str(option) - except: + except Exception: value = option self.model.append(parent, [name, value, type_]) diff --git a/gajim/common/jingle_rtp.py b/gajim/common/jingle_rtp.py index 3eb3f211c..3bbaa7f2c 100644 --- a/gajim/common/jingle_rtp.py +++ b/gajim/common/jingle_rtp.py @@ -412,7 +412,7 @@ class JingleVideo(JingleRTPContent): framerate = '' try: w, h = app.config.get('video_size').split('x') - except: + except Exception: w = h = None if w and h: video_size = 'video/x-raw,width=%s,height=%s ! ' % (w, h) diff --git a/gajim/common/jingle_xtls.py b/gajim/common/jingle_xtls.py index 7c61f36a4..2db8ae273 100644 --- a/gajim/common/jingle_xtls.py +++ b/gajim/common/jingle_xtls.py @@ -85,7 +85,7 @@ def load_cert_file(cert_path, cert_store=None): except OpenSSL.crypto.Error as exception_obj: log.warning('Unable to load a certificate from file %s: %s', cert_path, exception_obj.args[0][0][2]) - except: + except Exception: log.warning('Unknown error while loading certificate from file ' '%s', cert_path) begin = -1 diff --git a/gajim/common/modules/dataforms.py b/gajim/common/modules/dataforms.py index 164854958..939ce5788 100644 --- a/gajim/common/modules/dataforms.py +++ b/gajim/common/modules/dataforms.py @@ -741,7 +741,7 @@ class MultipleDataForm(DataForm): # def reported(self, record): # try: # self.delChild('reported') -# except: +# except Exception: # pass # # record.setName('reported') diff --git a/gajim/common/protocol/bytestream.py b/gajim/common/protocol/bytestream.py index a1b48ea4e..5a84dfd0f 100644 --- a/gajim/common/protocol/bytestream.py +++ b/gajim/common/protocol/bytestream.py @@ -813,7 +813,7 @@ class ConnectionIBBytestream(ConnectionBytestream): file_props = FilesProp.getFilePropByTransportSid(self.name, sid) try: blocksize = int(blocksize) - except: + except Exception: err = nbxmpp.ERR_BAD_REQUEST if not sid or not blocksize: err = nbxmpp.ERR_BAD_REQUEST diff --git a/gajim/dev/ipython_view.py b/gajim/dev/ipython_view.py index f91b899a3..1161e5e71 100644 --- a/gajim/dev/ipython_view.py +++ b/gajim/dev/ipython_view.py @@ -193,7 +193,7 @@ class IterableIPShell: if self.iter_more: try: self.prompt = self.generatePrompt(True) - except: + except Exception: self.IP.showtraceback() if self.IP.autoindent: self.IP.rl_do_indent = True @@ -203,7 +203,7 @@ class IterableIPShell: except KeyboardInterrupt: self.IP.write('\nKeyboardInterrupt\n') self.IP.input_splitter.reset() - except: + except Exception: self.IP.showtraceback() else: self.IP.input_splitter.push(line) diff --git a/gajim/gtkgui_helpers.py b/gajim/gtkgui_helpers.py index 4b18623bd..a1ba27af4 100644 --- a/gajim/gtkgui_helpers.py +++ b/gajim/gtkgui_helpers.py @@ -37,7 +37,7 @@ import xml.etree.ElementTree as ET try: from PIL import Image -except: +except Exception: pass from io import BytesIO diff --git a/gajim/gui_interface.py b/gajim/gui_interface.py index 5b4517c67..3eba193b0 100644 --- a/gajim/gui_interface.py +++ b/gajim/gui_interface.py @@ -48,7 +48,7 @@ import OpenSSL try: from PIL import Image -except: +except Exception: pass from gajim.common import app @@ -934,7 +934,7 @@ class Interface: h = Hashes2() try: file_ = open(file_props.file_name, 'rb') - except: + except Exception: return hash_ = h.calculateHash(file_props.algo, file_) file_.close() diff --git a/gajim/htmltextview.py b/gajim/htmltextview.py index bb0038640..c4e4f71e8 100644 --- a/gajim/htmltextview.py +++ b/gajim/htmltextview.py @@ -283,7 +283,7 @@ class HtmlHandler(xml.sax.handler.ContentHandler): def get_val(min_val=minl, max_val=maxl): try: val = float(value[:-2]) - except: + except Exception: log.warning('Unable to parse length value "%s"', value) return None if val > 0: diff --git a/gajim/plugins/gajimplugin.py b/gajim/plugins/gajimplugin.py index 549ea938b..3a5d4fff5 100644 --- a/gajim/plugins/gajimplugin.py +++ b/gajim/plugins/gajimplugin.py @@ -258,7 +258,7 @@ class GajimPluginConfig(): try: self.data = pickle.load(fd) fd.close() - except: + except Exception: fd.close() try: import shelve @@ -269,7 +269,7 @@ class GajimPluginConfig(): raise GajimPluginException s.close() self.save() - except: + except Exception: log.warning('%s plugin config file not readable. Saving it as ' '%s and creating a new one' % (self.plugin.short_name, self.FILE_PATH.decode(locale.getpreferredencoding()) + '.bak')) diff --git a/plugins/dbus_plugin/plugin.py b/plugins/dbus_plugin/plugin.py index 2d20301a2..90fd5090f 100644 --- a/plugins/dbus_plugin/plugin.py +++ b/plugins/dbus_plugin/plugin.py @@ -328,7 +328,7 @@ if dbus_support.supported: jid = self._get_real_jid(jid, account) try: jid = helpers.parse_jid(jid) - except: + except Exception: # Jid is not conform, ignore it return DBUS_BOOLEAN(False)