diff --git a/qutebrowser/app.py b/qutebrowser/app.py index c03e34ec1..e1f3f87d7 100644 --- a/qutebrowser/app.py +++ b/qutebrowser/app.py @@ -131,7 +131,7 @@ class Application(QApplication): utils.actute_warning() try: self._init_modules() - except OSError as e: + except (OSError, UnicodeDecodeError) as e: msgbox = QMessageBox( QMessageBox.Critical, "Error while initializing!", "Error while initializing: {}".format(e)) diff --git a/qutebrowser/config/config.py b/qutebrowser/config/config.py index 03a7564ce..b12c33dcf 100644 --- a/qutebrowser/config/config.py +++ b/qutebrowser/config/config.py @@ -123,7 +123,7 @@ def init(args): try: app = objreg.get('app') config_obj = ConfigManager(confdir, 'qutebrowser.conf', app) - except (configexc.Error, configparser.Error) as e: + except (configexc.Error, configparser.Error, UnicodeDecodeError) as e: log.init.exception(e) errstr = "Error while reading config:" try: @@ -141,7 +141,7 @@ def init(args): objreg.register('config', config_obj) try: key_config = keyconf.KeyConfigParser(confdir, 'keys.conf') - except keyconf.KeyConfigError as e: + except (keyconf.KeyConfigError, UnicodeDecodeError) as e: log.init.exception(e) errstr = "Error while reading key config:\n" if e.lineno is not None: