diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index 089fd23a6..d83ada63e 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -45,6 +45,14 @@ Changed - `:download-open` and `:prompt-open-download` now have an optional `cmdline` argument to pass a commandline to open the download with. +v0.8.3 (unreleased) +------------------- + +Fixed +~~~~~ + +- Fixed crash when doing `:`, another corner-case introduced in v0.8.0 + v0.8.2 ------ diff --git a/qutebrowser/commands/runners.py b/qutebrowser/commands/runners.py index d1f15a415..f020b9199 100644 --- a/qutebrowser/commands/runners.py +++ b/qutebrowser/commands/runners.py @@ -119,7 +119,7 @@ class CommandRunner(QObject): Yields: ParseResult tuples. """ - if not text: + if not text.strip(): raise cmdexc.NoSuchCommandError("No command given") if aliases: diff --git a/tests/unit/commands/test_runners.py b/tests/unit/commands/test_runners.py index a16ad764a..50fcbde1c 100644 --- a/tests/unit/commands/test_runners.py +++ b/tests/unit/commands/test_runners.py @@ -53,14 +53,16 @@ class TestCommandRunner: with pytest.raises(cmdexc.NoSuchCommandError): list(cr.parse_all("alias_name")) - def test_parse_empty_with_alias(self): + @pytest.mark.parametrize('command', ['', ' ']) + def test_parse_empty_with_alias(self, command): """An empty command should not crash. See https://github.com/The-Compiler/qutebrowser/issues/1690 + and https://github.com/The-Compiler/qutebrowser/issues/1773 """ cr = runners.CommandRunner(0) with pytest.raises(cmdexc.NoSuchCommandError): - list(cr.parse_all('')) + list(cr.parse_all(command)) def test_parse_with_count(self): """Test parsing of commands with a count."""