This makes it possible to switch to an alternative implementation if
there are weird issues like #1568. Some users might also prefer the
slightly better performance over more accurate hints.
colorlog was problematic for various reasons:
- Not commonly packaged for Linux distributions
- Calling colorama.init() automatically on import
- Not supporting {foo} log formatting
- Not supporting an easy way to turn colors off
Instead we now do the log coloring by hand, which is simpler and means
everyone will have colored logs.
When using :tab-prev/:tab-next (or :tab-focus which uses :tab-next
internally) immediately after the last tab, those functions could be
called with 0 tabs open, which caused a ZeroDivisionError when trying to
do % 0.
Fixes#1448.
Searching for that error doesn't turn up many helpful results, but it
seems to be harmless and shown when downloading a file - it's also new
in Qt 5.6 it seems, so let's just ignore it.
The previous fix didn't work in situations where the web view was
actually focused, but had no focused element (like about:blank).
The new fix always works, and even is a lot simpler!
Fixes#504.
When a download is finished with `removed-finished-download` set to a
delay, it's removed via a singleshot QTimer.
However, when the window was closed in the meantime, the slot still was
executed by Qt, even though the DownloadManager was already deleted.
Fixes#1242
Issues #1269, #866
qutebrowser would crash when XDG_DOWNLOAD_DIR was set to some
non-absolute value (which should not happen, but it can) and
"storage -> download-dir" was empty, since when the user didn't give an
absolute filename, even the joined path of download_dir() (i.e.
XDG_DOWNLOAD_DIR in this case) and the filename was not absolute either.
Since the path was not absolute, create_full_filename returned None,
which meant that os.path.basename(self._filename) raised an exception.
Now we display an error message and fall back to $HOME.
Before we raised QtValueError (via qtutils.ensure_valid), but maybe there are
more callers out there which call fuzzy_url with an empty input - and it makes
more sense to raise InvalidUrlError which gets displayed to the user than
raising QtValueError which is more like an assertion.
This logged an error on Windows:
ERROR misc networkmanager:on_authentication_required:269 Unable to read the netrc file
Traceback (most recent call last):
File "c:\python34\Lib\netrc.py", line 27, in __init__
file = os.path.join(os.environ['HOME'], ".netrc")
File "C:\Users\florian\buildbot\slave\win8\build\.tox\py34\lib\os.py", line 633, in __getitem__
raise KeyError(key) from None
KeyError: 'HOME'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\florian\buildbot\slave\win8\build\qutebrowser\browser\network\networkmanager.py", line 262, in on_authentication_required
net = netrc.netrc()
File "c:\python34\Lib\netrc.py", line 29, in __init__
raise OSError("Could not find .netrc: $HOME is not set")
Since this case is pretty common, we don't want to log it - and checking the
variable beforehand is easier than parsing the exception message.
This should fix the failing tests on Windows.
Since 2a705e2eb6 non-specialized config types are
String. However, String had an overloaded complete() which defaulted to
returning None.
Now we use the normal complete() which relies on valid_values if completions
isn't given instead.
Fixes#1223.