Handle UnicodeDecodeError when reading configs.
(WTF are you guys doing?!)
This commit is contained in:
parent
e9786458fa
commit
4f1e0d32b0
@ -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))
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user