Handle UnicodeDecodeError when reading configs.

(WTF are you guys doing?!)
This commit is contained in:
Florian Bruhin 2015-01-16 07:10:12 +01:00
parent e9786458fa
commit 4f1e0d32b0
2 changed files with 3 additions and 3 deletions

View File

@ -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))

View File

@ -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: