adblock: Fix getting filename from URL
On Windows, we would end up with /C:/foo as "path".
This commit is contained in:
parent
237362663a
commit
f93b92cca8
@ -180,11 +180,12 @@ class HostBlocker:
|
|||||||
scope='window', window='last-focused')
|
scope='window', window='last-focused')
|
||||||
for url in config.val.content.host_blocking.lists:
|
for url in config.val.content.host_blocking.lists:
|
||||||
if url.scheme() == 'file':
|
if url.scheme() == 'file':
|
||||||
|
filename = url.toLocalFile()
|
||||||
try:
|
try:
|
||||||
fileobj = open(url.path(), 'rb')
|
fileobj = open(filename, 'rb')
|
||||||
except OSError as e:
|
except OSError as e:
|
||||||
message.error("adblock: Error while reading {}: {}".format(
|
message.error("adblock: Error while reading {}: {}".format(
|
||||||
url.path(), e.strerror))
|
filename, e.strerror))
|
||||||
continue
|
continue
|
||||||
download = FakeDownload(fileobj)
|
download = FakeDownload(fileobj)
|
||||||
self._in_progress.append(download)
|
self._in_progress.append(download)
|
||||||
|
Loading…
Reference in New Issue
Block a user