Use toLocalFile function instead of slicing.
This commit is contained in:
parent
e6521b047d
commit
2969599390
@ -161,7 +161,7 @@ class BrowserPage(QWebPage):
|
|||||||
return False
|
return False
|
||||||
elif (error_str.endswith('Path is a directory') and
|
elif (error_str.endswith('Path is a directory') and
|
||||||
info.url.scheme() == 'file'):
|
info.url.scheme() == 'file'):
|
||||||
html = dirbrowser(info.url.url()[7:])
|
html = dirbrowser(info.url.toLocalFile())
|
||||||
errpage.content = html.encode('utf-8')
|
errpage.content = html.encode('utf-8')
|
||||||
errpage.encoding = 'utf-8'
|
errpage.encoding = 'utf-8'
|
||||||
return True
|
return True
|
||||||
|
@ -36,7 +36,6 @@ class TestFileList:
|
|||||||
assert {'name': 'testfile', 'absname': os.path.join(basedir,
|
assert {'name': 'testfile', 'absname': os.path.join(basedir,
|
||||||
'testfile')} in result
|
'testfile')} in result
|
||||||
|
|
||||||
"""Test get_file_list with os.path.isdir filter function."""
|
|
||||||
basedir = os.path.abspath('./qutebrowser/utils')
|
basedir = os.path.abspath('./qutebrowser/utils')
|
||||||
all_files = os.listdir(basedir)
|
all_files = os.listdir(basedir)
|
||||||
result = get_file_list(basedir, all_files, os.path.isdir)
|
result = get_file_list(basedir, all_files, os.path.isdir)
|
||||||
|
Loading…
Reference in New Issue
Block a user