Skip to content
Browse files

Fix config values being lost with DELETED_OPTIONS

When an option was deleted, we accidentally stopped reading instead of
ignoring that one option and then resuming.
  • Loading branch information
The-Compiler committed Jul 14, 2016
1 parent 325846f commit 7b9d38e438189f33551e801ac31b44cd5a082e39
Showing with 18 additions and 1 deletion.
  1. +6 −0 CHANGELOG.asciidoc
  2. +1 −1 qutebrowser/config/
  3. +11 −0 tests/unit/config/
@@ -44,6 +44,12 @@ Changed
- New `taskadd` userscript to add a taskwarrior task annotated with the
current URL.

- Fixed some configuration values being lost when a config option gets removed
from qutebrowser's code.

@@ -518,7 +518,7 @@ def _from_cp_section(self, sectname, cp, relaxed):
k = k[1:]

if (sectname, k) in self.DELETED_OPTIONS:
if (sectname, k) in self.RENAMED_OPTIONS:
k = self.RENAMED_OPTIONS[sectname, k]
if (sectname, k) in self.CHANGED_OPTIONS:
@@ -198,6 +198,17 @@ def test_deleted_options(self, section, option):
"""Make sure renamed options don't exist anymore."""
assert option not in configdata.DATA[section]

def test_config_reading_with_deleted_options(self, objects):
"""Test an invalid option with relaxed=True."""
'general': collections.OrderedDict(
[('wrap-search', 'true'), ('save-session', 'true')])
with pytest.raises(configexc.NoOptionError):
objects.cfg.get('general', 'wrap-search')
assert objects.cfg.get('general', 'save-session')

class TestKeyConfigParser:

0 comments on commit 7b9d38e

Please sign in to comment.