mirror of
https://github.com/onionshare/onionshare.git
synced 2025-01-13 16:29:31 -05:00
Solved Issue #80 UnicodeEncodeError
This commit is contained in:
parent
e138d4e865
commit
85c72f1980
@ -103,7 +103,7 @@ def index(slug_candidate):
|
|||||||
return render_template_string(
|
return render_template_string(
|
||||||
open('{0}/index.html'.format(onionshare_dir)).read(),
|
open('{0}/index.html'.format(onionshare_dir)).read(),
|
||||||
slug=slug,
|
slug=slug,
|
||||||
filename=os.path.basename(filename),
|
filename=os.path.basename(filename).decode("utf-8"),
|
||||||
filehash=filehash,
|
filehash=filehash,
|
||||||
filesize=filesize,
|
filesize=filesize,
|
||||||
filesize_human=human_readable_filesize(filesize),
|
filesize_human=human_readable_filesize(filesize),
|
||||||
|
@ -38,7 +38,7 @@ class Window(QWebView):
|
|||||||
def __init__(self, basename, webapp_port):
|
def __init__(self, basename, webapp_port):
|
||||||
global window_icon
|
global window_icon
|
||||||
QWebView.__init__(self)
|
QWebView.__init__(self)
|
||||||
self.setWindowTitle("{0} | OnionShare".format(basename))
|
self.setWindowTitle(u"{0} | OnionShare".format(basename.decode("utf-8")))
|
||||||
self.resize(580, 400)
|
self.resize(580, 400)
|
||||||
self.setMinimumSize(580, 400)
|
self.setMinimumSize(580, 400)
|
||||||
self.setMaximumSize(580, 400)
|
self.setMaximumSize(580, 400)
|
||||||
@ -65,7 +65,7 @@ def select_file(strings, filename=None):
|
|||||||
if not filename:
|
if not filename:
|
||||||
return False, False
|
return False, False
|
||||||
|
|
||||||
filename = str(filename)
|
filename = str(unicode(filename).encode("utf-8"))
|
||||||
|
|
||||||
# validate filename
|
# validate filename
|
||||||
if not os.path.isfile(filename):
|
if not os.path.isfile(filename):
|
||||||
|
Loading…
Reference in New Issue
Block a user