Rev1940, Fix utf8 archive names on Safari

This commit is contained in:
shortcutme 2017-02-24 14:23:44 +01:00
parent f42ad03f91
commit 819f765bce
No known key found for this signature in database
GPG Key ID: 5B63BAE6CB9613AE
2 changed files with 4 additions and 4 deletions

View File

@ -31,9 +31,9 @@ def openArchive(archive_path, path_within):
archive = archive_cache[archive_path]
if archive_path.endswith(".zip"):
return archive.open(path_within.decode("utf8"))
return archive.open(path_within)
else:
return archive.extractfile(path_within)
return archive.extractfile(path_within.encode("utf8"))
@PluginManager.registerTo("UiRequest")
@ -41,7 +41,7 @@ class UiRequestPlugin(object):
def actionSiteMedia(self, path, header_length=True):
if ".zip/" in path or ".tar.gz/" in path:
path_parts = self.parsePath(path)
file_path = "%s/%s/%s" % (config.data_dir, path_parts["address"], path_parts["inner_path"])
file_path = u"%s/%s/%s" % (config.data_dir, path_parts["address"], path_parts["inner_path"].decode("utf8"))
match = re.match("^(.*\.(?:tar.gz|tar.bz2|zip))/(.*)", file_path)
archive_path, path_within = match.groups()
if not os.path.isfile(archive_path):

View File

@ -10,7 +10,7 @@ class Config(object):
def __init__(self, argv):
self.version = "0.5.2"
self.rev = 1936
self.rev = 1940
self.argv = argv
self.action = None
self.config_file = "zeronet.conf"