Merge remote-tracking branch 'origin/pr/3175'

This commit is contained in:
Florian Bruhin 2017-11-07 11:24:41 +01:00
commit fdc9dfdf87

View File

@ -127,7 +127,10 @@ class FileSchemeHandler(schemehandler.SchemeHandler):
A QNetworkReply for directories, None for files.
"""
path = request.url().toLocalFile()
if os.path.isdir(path):
data = dirbrowser_html(path)
return networkreply.FixedDataNetworkReply(
request, data, 'text/html', self.parent())
try:
if os.path.isdir(path):
data = dirbrowser_html(path)
return networkreply.FixedDataNetworkReply(
request, data, 'text/html', self.parent())
except UnicodeEncodeError:
return None