diff --git a/qutebrowser/browser/webkit/network/filescheme.py b/qutebrowser/browser/webkit/network/filescheme.py index e379b6738..a8cade1db 100644 --- a/qutebrowser/browser/webkit/network/filescheme.py +++ b/qutebrowser/browser/webkit/network/filescheme.py @@ -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